Skip to content

Secrets API#

Handle#

[source]

get_secrets_api#

Connection.get_secrets_api()

Get the secrets api.

Returns

SecretsApi: The Secrets Api handle


Creation#

[source]

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")
Arguments

  • 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#

[source]

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

[source]

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#

[source]

created#

Date when secret was created


[source]

name#

Name of the secret


[source]

owner#

Owner of the secret


[source]

scope#

Scope of the secret


[source]

value#

Value of the secret


[source]

visibility#

Visibility of the secret


Methods#

[source]

delete#

Secret.delete()

Delete the secret

Potentially dangerous operation

This operation deletes the secret and may break applications using it.

Raises

RestAPIError.


[source]

get_url#

Secret.get_url()