Secrets API#
Handle#
get_secrets_api#
Connection.get_secrets_api()
Get the secrets api.
Returns
SecretsApi: The Secrets Api handle
Creation#
create_secret#
SecretsApi.create_secret(name, value, project=None)
Create a new secret.
import hopsworks
connection = hopsworks.connection()
secrets_api = connection.get_secrets_api()
secret = secrets_api.create_secret("my_secret", "Fk3MoPlQXCQvPo")
- name 
str: Name of the secret. - value 
str: The secret value. - project 
Optional[str]: Name of the project to share the secret with. 
Returns
Secret: The Secret object
Raises
RestAPIError: If unable to create the secret
Retrieval#
get_secret#
SecretsApi.get_secret(name, owner=None)
Get a secret.
Arguments
- name 
str: Name of the project. - owner 
Optional[str]: email of the owner for a secret shared with the current project. 
Returns
Secret: The Secret object
Raises
RestAPIError: If unable to get the secret
get_secrets#
SecretsApi.get_secrets()
Get all secrets
Returns
List[Secret]: List of all accessible secrets
Raises
RestAPIError: If unable to get the secrets
Properties#
created#
Date when secret was created
name#
Name of the secret
owner#
Owner of the secret
scope#
Scope of the secret
value#
Value of the secret
visibility#
Visibility of the secret
Methods#
delete#
Secret.delete()
Delete the secret
Potentially dangerous operation
This operation deletes the secret and may break applications using it.
Raises
RestAPIError.
get_url#
Secret.get_url()