Secrets API#
get_secrets_api #
get_secrets_api() -> secret_api.SecretsApi
Get the secrets api.
| RETURNS | DESCRIPTION |
|---|---|
secret_api.SecretsApi | The Secrets API handle. |
SecretsApi #
create_secret #
Create a new secret.
import hopsworks
project = hopsworks.login()
secrets_api = hopsworks.get_secrets_api()
secret = secrets_api.create_secret("my_secret", "Fk3MoPlQXCQvPo")
| PARAMETER | DESCRIPTION |
|---|---|
name | Name of the secret. TYPE: |
value | The secret value. TYPE: |
project | Name of the project to share the secret with. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
secret.Secret | The Secret object. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
get #
Get the secret's value.
If the secret does not exist, it prompts the user to create the secret if the application is running interactively.
| PARAMETER | DESCRIPTION |
|---|---|
name | Name of the secret. TYPE: |
owner | Email of the owner for a secret shared with the current project. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
str | The secret value. |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |
get_secret #
Get a secret.
| PARAMETER | DESCRIPTION |
|---|---|
name | Name of the secret. TYPE: |
owner | Username of the owner for a secret shared with the current project. Users can find their username in the Account Settings > Profile section. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
secret.Secret | None | The Secret object or |
| RAISES | DESCRIPTION |
|---|---|
hopsworks.client.exceptions.RestAPIError | If the backend encounters an error when handling the request. |