Skip to content

unitycatalog.credentials

The classes of the credentials API.

Classes

Name Description
AwsCredentials Temporary AWS credentials.
AwsIamRoleRequest The AWS IAM role of a new or changed credential.
AwsIamRoleResponse The AWS IAM role of a credential.
AzureManagedIdentity The Azure managed identity of a credential: the server's own Azure identity.
AzureServicePrincipalRequest The Azure service principal of a new or changed credential.
AzureServicePrincipalResponse The Azure service principal of a credential. The client secret is not returned.
AzureUserDelegationSAS A shared access signature (SAS) for Azure storage, signed with a user delegation key.
CredentialClient The requests on one CredentialInfo.
CredentialInfo A credential that gives access to storage or to external services.
GcpOauthToken An OAuth token for Google Cloud Storage.
GcpServiceAccount The GCP service account of a credential: the server's own identity, or a service account that the server impersonates.
GcpServiceAccountKeyRequest The GCP service account key of a new or changed credential.
GcpServiceAccountKeyResponse The GCP service account key of a credential. The key is not returned.
ListCredentialsResponse  
TemporaryCredentials Temporary credentials for the cloud of a storage location. Empty for a local file: location.

Enums

Name Description
CredentialPurpose What a credential is used for.
ModelVersionOperation The operation on a model version that temporary credentials are for.
PathOperation The operation on a storage path that temporary credentials are for.
TableOperation The operation on a table that temporary credentials are for.
VolumeOperation The operation on a volume that temporary credentials are for.

class unitycatalog.credentials.AwsCredentials

Temporary AWS credentials.

Attributes

  • access_key_id (str) – The access key ID of the temporary credentials.
  • secret_access_key (str) – The secret access key of the temporary credentials.
  • session_token (str) – The session token of the temporary credentials.

class unitycatalog.credentials.AwsIamRoleRequest(role_arn: str)

The AWS IAM role of a new or changed credential.

Attributes

  • role_arn (str) – ARN of the AWS IAM role that the server assumes to make temporary credentials.

class unitycatalog.credentials.AwsIamRoleResponse

The AWS IAM role of a credential.

Attributes

  • external_id (str) – External ID that the server sends when it assumes the role. The trust policy of the role should require it. Each new role gets a new external ID.
  • role_arn (str) – ARN of the AWS IAM role that the server assumes to make temporary credentials.
  • unity_catalog_iam_arn (str | None) – ARN of the server's own AWS role, which assumes role_arn. Absent when the server has no role of its own.

class unitycatalog.credentials.AzureManagedIdentity(*, managed_identity_id: str | None = None)

The Azure managed identity of a credential: the server's own Azure identity.

Attributes

  • managed_identity_id (str | None) – Azure resource ID of a user-assigned managed identity, which the server gets from the instance metadata service. Absent: the identity that the server's environment gives, such as AKS workload identity or the managed identity of the VM.

class unitycatalog.credentials.AzureServicePrincipalRequest(directory_id: str,application_id: str,client_secret: str,)

The Azure service principal of a new or changed credential.

Attributes

  • application_id (str) – Application (client) ID of the service principal.
  • client_secret (str) – Client secret of the application. The server stores it and never returns it.
  • directory_id (str) – ID of the Microsoft Entra ID tenant (directory) of the application.

class unitycatalog.credentials.AzureServicePrincipalResponse

The Azure service principal of a credential. The client secret is not returned.

Attributes

  • application_id (str) – Application (client) ID of the service principal.
  • directory_id (str) – ID of the Microsoft Entra ID tenant (directory) of the application.

class unitycatalog.credentials.AzureUserDelegationSAS

A shared access signature (SAS) for Azure storage, signed with a user delegation key.

Attributes

  • sas_token (str) – The SAS token.

class unitycatalog.credentials.CredentialClient

The requests on one CredentialInfo.

delete(*, force: bool | None = None) → None

Delete a credential. A credential that external locations use needs force.

Parameters

  • force (bool | None, optional) – Delete the credential even when external locations use it.

Async: delete_async(…) → Future[None]

get() → CredentialInfo

Get a credential.

Returns

  • CredentialInfo – A credential that gives access to storage or to external services.

Async: get_async(…) → Future[CredentialInfo]

update(*,comment: str | None = None,aws_iam_role: AwsIamRoleRequest | None = None,new_name: str | None = None,azure_service_principal: AzureServicePrincipalRequest | None = None,azure_managed_identity: AzureManagedIdentity | None = None,gcp_service_account: GcpServiceAccount | None = None,gcp_service_account_key: GcpServiceAccountKeyRequest | None = None,owner: str | None = None,) → CredentialInfo

Change a credential.

Parameters

  • comment (str | None, optional) – User-provided free-form text description.
  • aws_iam_role (AwsIamRoleRequest | None, optional) – New AWS IAM role of the credential. The role gets a new external ID. Give at most one of aws_iam_role, azure_service_principal, azure_managed_identity, gcp_service_account and gcp_service_account_key: it replaces the identity of the credential.
  • new_name (str | None, optional) – New name of the credential.
  • azure_service_principal (AzureServicePrincipalRequest | None, optional) – New Azure service principal of the credential.
  • azure_managed_identity (AzureManagedIdentity | None, optional) – New Azure managed identity of the credential.
  • gcp_service_account (GcpServiceAccount | None, optional) – New GCP service account of the credential.
  • gcp_service_account_key (GcpServiceAccountKeyRequest | None, optional) – New GCP service account key of the credential.
  • owner (str | None, optional) – Username of the current owner of the credential. Accepted for compatibility with the upstream API; the owner does not change.

Returns

  • CredentialInfo – A credential that gives access to storage or to external services.

Async: update_async(…) → Future[CredentialInfo]

class unitycatalog.credentials.CredentialInfo

A credential that gives access to storage or to external services.

Attributes

  • aws_iam_role (AwsIamRoleResponse | None) – The AWS IAM role of the credential.
  • azure_managed_identity (AzureManagedIdentity | None) – The Azure managed identity of the credential.
  • azure_service_principal (AzureServicePrincipalResponse | None) – The Azure service principal of the credential.
  • comment (str | None) – User-provided free-form text description.
  • created_at (int) – Time at which the credential was created, in epoch milliseconds.
  • created_by (str | None) – Username of the creator of the credential.
  • full_name (str) – Full name of the credential: the same as name.
  • gcp_service_account (GcpServiceAccount | None) – The GCP service account of the credential.
  • gcp_service_account_key (GcpServiceAccountKeyResponse | None) – The GCP service account key of the credential.
  • id (str) – Unique identifier of the credential.
  • name (str) – Name of the credential.
  • owner (str | None) – Username of the owner of the credential.
  • purpose (CredentialPurpose | None) – What the credential is used for. Absent when the credential was created without one.
  • updated_at (int) – Time at which the credential was last changed, in epoch milliseconds.
  • updated_by (str | None) – Username of the user who last changed the credential.

class unitycatalog.credentials.GcpOauthToken

An OAuth token for Google Cloud Storage.

Attributes

  • oauth_token (str) – The OAuth token.

class unitycatalog.credentials.GcpServiceAccount(*, email: str | None = None)

The GCP service account of a credential: the server's own identity, or a service account that the server impersonates.

Attributes

  • email (str | None) – Email of the service account that the server impersonates. The server's identity needs the role Service Account Token Creator on it. Absent: the server's own identity, from Application Default Credentials or the metadata server.

class unitycatalog.credentials.GcpServiceAccountKeyRequest(json_key: str)

The GCP service account key of a new or changed credential.

Attributes

  • json_key (str) – The JSON key file of the service account. The server stores it and never returns it.

class unitycatalog.credentials.GcpServiceAccountKeyResponse

The GCP service account key of a credential. The key is not returned.

Attributes

  • email (str) – Email of the service account.
  • private_key_id (str) – ID of the key.

class unitycatalog.credentials.ListCredentialsResponse

Attributes

  • credentials (list[CredentialInfo]) – The credentials.
  • next_page_token (str | None) – Opaque token of the next page. Absent on the last page.

class unitycatalog.credentials.TemporaryCredentials

Temporary credentials for the cloud of a storage location. Empty for a local file: location.

Attributes

  • aws_temp_credentials (AwsCredentials | None) – Temporary credentials for AWS S3.
  • azure_user_delegation_sas (AzureUserDelegationSAS | None) – A SAS token for Azure storage.
  • expiration_time (int | None) – Time at which the credentials expire, in epoch milliseconds. Absent when the credentials do not expire.
  • gcp_oauth_token (GcpOauthToken | None) – An OAuth token for Google Cloud Storage.
  • url (str) – The storage path that the credentials give access to.

class unitycatalog.credentials.CredentialPurpose

What a credential is used for.

Members

  • SERVICE_PRINCIPAL – The credential gives access to external services.
  • STORAGE – The credential gives access to storage.

class unitycatalog.credentials.ModelVersionOperation

The operation on a model version that temporary credentials are for.

Members

  • UNKNOWN_MODEL_VERSION_OPERATION – The operation is not known. The server rejects it.
  • READ_MODEL_VERSION – Read the model version.
  • READ_WRITE_MODEL_VERSION – Read and write the model version. Only for a model version with the status PENDING_REGISTRATION.

class unitycatalog.credentials.PathOperation

The operation on a storage path that temporary credentials are for.

Members

  • UNKNOWN_PATH_OPERATION – The operation is not known.
  • PATH_READ – Read the path.
  • PATH_READ_WRITE – Read and write the path.
  • PATH_CREATE_TABLE – Create a table at the path.

class unitycatalog.credentials.TableOperation

The operation on a table that temporary credentials are for.

Members

  • UNKNOWN_TABLE_OPERATION – The operation is not known.
  • READ – Read the table.
  • READ_WRITE – Read and write the table.

class unitycatalog.credentials.VolumeOperation

The operation on a volume that temporary credentials are for.

Members

  • UNKNOWN_VOLUME_OPERATION – The operation is not known.
  • READ_VOLUME – Read the volume.
  • WRITE_VOLUME – Read and write the volume.