ai_core_sdk.resource_clients.secrets_client module¶
- class ai_core_sdk.resource_clients.secrets_client.SecretsClient(rest_client: RestClient)¶
Bases:
BaseClientSecretsClient is a class implemented for interacting with the secret related endpoints of the server. It implements the base class
ai_api_client_sdk.resource_clients.base_client.BaseClient- create(name: str, data: dict, resource_group: str = None, ai_tenant_scope=True) Message¶
Creates a secret.
- Parameters:
name (str) – name of the secret
data (dict) – data of secret
resource_group (str) – Resource Group which the request should be sent on behalf. Either this or a default resource group in the
ai_core_sdk.ai_core_v2_client.AICoreV2Clientshould be specified, defaults to Noneai_tenant_scope (bool) – Specify whether the main tenant scope is to be used
- Raises:
class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIForbiddenException if a 403 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIConflictException if a 409 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server
- Returns:
A list of metadata of available secrets
- Return type:
class:ai_core_sdk.models.base_models.Message
- delete(name: str, resource_group: str = None, ai_tenant_scope=True) Message¶
Deletes the secret.
- Parameters:
name (str) – name of the secret to be deleted
resource_group (str) – Resource Group which the request should be sent on behalf. Either this or a default resource group in the
ai_core_sdk.ai_core_v2_client.AICoreV2Clientshould be specified, defaults to Noneai_tenant_scope (bool) – Specify whether the main tenant scope is to be used
- Raises:
class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIForbiddenException if a 403 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPINotFoundException if a 404 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server
- Returns:
An object representing the response from the server
- Return type:
class:ai_api_client_sdk.models.base_models.Message
- modify(name: str, data: dict, resource_group: str = None, ai_tenant_scope=True) Message¶
Modifies the secret.
- Parameters:
name (str) – name of the secret to be modified
data (dict) – data of secret
resource_group (str) – Resource Group which the request should be sent on behalf. Either this or a default resource group in the
ai_core_sdk.ai_core_v2_client.AICoreV2Clientshould be specified, defaults to Noneai_tenant_scope (bool) – Specify whether the main tenant scope is to be used
- Raises:
class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIForbiddenException if a 403 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPINotFoundException if a 404 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIPreconditionFailedException if a 412 response is received from the server
- Returns:
An object representing the response from the server
- Return type:
class:ai_api_client_sdk.models.base_models.Message
- query(top: int = None, skip: int = None, resource_group: str = None, ai_tenant_scope: bool = True) SecretQueryResponse¶
Returns the secrets.
- Parameters:
top (int, optional) – Number of secrets to be retrieved, defaults to None
skip (int, optional) – Number of secrets to be skipped, from the list of the queried secrets, defaults to None
resource_group (str) – Resource Group which the request should be sent on behalf. Either this or a default resource group in the
ai_core_sdk.ai_core_v2_client.AICoreV2Clientshould be specified, defaults to Noneai_tenant_scope (bool) – Specify whether the main tenant scope is to be used
- Raises:
class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIForbiddenException if a 403 response is received from the server
- Raises:
class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server
- Returns:
A list of secrets
- Return type:
class:ai_core_sdk.models.secret_query_response.SecretQueryResponse