Skip to main content

UpdateCredential

Update a credential.

Parameters​

  • name: A unique name that can be used to find this credential.
  • [optional] key
  • [optional] add_resources: Array of new resources that will now be accessible.
  • [optional] remove_resources: Array of resources that will no longer be accessible.

Details​

Credential's parameters that are not specified will remain unchanged.

If add_resources array is provided, it will introduce new resources that can now be accessed using this credential.

If remove_resources array is provided, it will remove existing resources that will now no longer be accessible through this credential.

Examples​

Add access to bucket3 and remove existing bucket access to bucket2 for credential "training_bucket_credential":


[{
"UpdateCredential": {
"name": "training_bucket_credential",
"add_resources": ["s3://bucket3"],
"remove_resources": ["s3://bucket2"]
}
}]

Result from a successful update:


[{
"UpdateCredential": {
"status": 0
}
}]

Change keys for AWS credential "training_bucket_credential":


[{
"UpdateCredential": {
"name": "training_bucket_credential",
"key": {
"access_key": "PKIAZ6XBPW80ZOCEQPWS",
"secret_access_key": "pH3JbcA/Y1rkncg2mLXiWtV9DY9-SsRvFv+HEHHJ",
"region": "us-west-2"
}
}
}]

Result from a successful update:


[{
"UpdateCredential": {
"status": 0
}
}]

Change keys for GCP credential "training_bucket_credential":


[{
"UpdateCredential": {
"name": "training_bucket_credential",
"key": {
"type": "service_account",
"project_id": "aperturedb",
"private_key_id": "0123456789012345678901234567890123456789",
"private_key": "-----BEGIN PRIVATE KEY-----\nmy/private/key\n-----END PRIVATE KEY-----\n",
"client_email": "tester@aperturedb.iam.gserviceaccount.com",
"client_id": "012345678901234567890",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/tester%40aperturedb.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
}
}]

Result from a successful update:


[{
"UpdateCredential": {
"status": 0
}
}]