kamu-cli icon indicating copy to clipboard operation
kamu-cli copied to clipboard

Implement environment variables: graphql API

Open dmitriy-borzenko opened this issue 1 year ago • 0 comments

Create graphql API for support environment variables.

Initial developments according to the API schema(prototype) Schema for a list of environment variables (Type Dataset already exists):

type Dataset {
  """
  Unique identifier of the dataset
  """
  id: DatasetID!
  """
  Symbolic name of the dataset.
  Name can change over the dataset's lifetime. For unique identifier use
  `id()`.
  """
  name: DatasetName!
  """
  Returns the user or organization that owns this dataset
  """
  owner: Account!
  """
  Returns dataset alias (user + name)
  """
  alias: DatasetAlias!
  """
  Returns the kind of a dataset (Root or Derivative)
  """
  kind: DatasetKind!
  """
  Access to the data of the dataset
  """
  data: DatasetData!
  """
  Access to the metadata of the dataset
  """
  metadata: DatasetMetadata!
  """
  Access to the flow configurations of this dataset
  """
  flows: DatasetFlows!
  """
  Creation time of the first metadata block in the chain
  """
  createdAt: DateTime!
  """
  Creation time of the most recent metadata block in the chain
  """
  lastUpdatedAt: DateTime!
  """
  Permissions of the current user
  """
  permissions: DatasetPermissions!
  """
  Various endpoints for interacting with data
  """
  endpoints: DatasetEndpoints!

--->  envVariables:EnvironmentVariables!
  
}

type EnvironmentVariablesResult {
  listVariables(page: Int, perPage: Int):DatasetEnvironmentVariables
}

type DatasetEnvironmentVariables {
  items: [EnvironmentVariable]!
  totalCount: Int!
  pageInfo: PageBasedInfo!
  edges: [EnvironmentVariableEdge!]!
}

union EnvironmentVariable = EnvironmentVariableValue | EnvironmentVariableSecret

type EnvironmentVariableValue {
  key: String!
  value: String!
}

type EnvironmentVariableSecret {
  key: String!
  secretValue: String!
}

type EnvironmentVariableEdge {
  node: EnvironmentVariable!
} 

Scheme for creating and editing tokens(type DatasetMut already exists):

type DatasetMut {
  """
  Access to the mutable metadata of the dataset
  """
  metadata: DatasetMetadataMut!
  """
  Access to the mutable flow configurations of this dataset
  """
  flows: DatasetFlowsMut!
  """
  Rename the dataset
  """
  rename(newName: DatasetName!): RenameResult!
  """
  Delete the dataset
  """
  delete: DeleteResult!
  """
  Manually advances the watermark of a root dataset
  """
  setWatermark(watermark: DateTime!): SetWatermarkResult!

 ----> setEnvVariable (key: String!, value: String!, secretKey: Boolean! ): SetEnvVariableResult!
}

interface SetEnvVariableResult {
  message: String!
}

type SetEnvVariableUpdate implements SetEnvVariableResult {
    message: String!
}

type SetEnvVariableCreated implements SetEnvVariableResult {
    message: String!
    value: String!
    secretKey: Boolean!
}

dmitriy-borzenko avatar Apr 09 '24 20:04 dmitriy-borzenko