user
organization

POST /credentials/{namespace}

Changed on

Create a new credential for the namespace

Request

  • Base URL
    /v2 (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    • HTTP basic
    • or API key in header X-TILEDB-REST-API-KEY

Request body

uuidstring

The UUID of the credential

namestring

A user-specified name for the key

provider'AWS' | 'AZURE' | 'GCP'

A service where data is stored or computations take place.

provider_defaultboolean nullable

True if this is the namespace's default credential to be used when connecting to the given cloud provider. There can be at most one default for each unique provider.

created_atstring date-time

Time when the credential was created (rfc3339)

updated_atstring date-time

Time when the credential was last updated (rfc3339)

allowed_in_tasksboolean nullable

Is this credential allowed to be used in tasks

Example request

{
  "credential": {
    "aws": {
      "endpoint": "https://example.us-west-2.amazonaws.com",
      "sse_kms_key_id": "arn:aws:kms:us-east-1:1234:key/mykey"
    }
  },
  "role": {
    "aws": {
      "role_arn": "arn:partition:service:region:account-id:resource-type:resource-id",
      "external_id": "MzU0M2UwMTItMWJhYy00NWUwLThmZDItZTgwYmQ1NjE5Yjhm",
      "endpoint": "https://example.us-west-2.amazonaws.com",
      "sse_kms_key_id": "arn:aws:kms:us-east-1:1234:key/mykey"
    }
  },
  "token": {
    "azure": {
      "account_name": "tiledbpoc",
      "sas_token": "sv=2022-11-02&ss=bfqt&srt=sco&sp=dsafdssdfafasdfsda&se=2024-03-28T03:02:08Z&st=2024-03-27T19:02:08Z&spr=https&sig=444444555555555555555555555555555555555%3D"
    },
    "gcp": {
      "account_id": "identity-data-reader@cinco-research.iam.gserviceaccount.com",
      "key_id": "b85b7bac16fabf44fd9cd6885d4d1b444f07e9ab",
      "key_text": "{\n  \"type\": \"service_account\",\n  \"project_id\": \"cinco-research\",\n  \"private_key_id\": \"b85b7bac16fabf44fd9cd6885d4d1b444f07e9ab\",\n  \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n[lots of data goes here]\\n-----END PRIVATE KEY-----\\n\",\n  \"client_email\": \"identity-data-reader@cinco-research.iam.gserviceaccount.com\",\n  \"client_id\": \"105800434159734259879\",\n  \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n  \"token_uri\": \"https://oauth2.googleapis.com/token\",\n  \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n  \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/identity-data-reader%40cinco-research.iam.gserviceaccount.com\",\n  \"universe_domain\": \"googleapis.com\"\n}\n"
    }
  }
}

Response

The new credential was successfully added.

Changes