Skip to content

How To Create A Secret#

Introduction#

A Secret is a key-value pair used to store encrypted information accessible only to the owner of the secret. Also if you wish to, you can share the same secret API key with all the members of a Project.

UI#

Step 1: Navigate to Secrets#

In the Account Settings page you can find the Secrets section showing a list of all secrets.

API Keys
List of secrets

Step 2: Create a Secret#

Click New Secret to bring up the dialog for secret creation. Enter a name for the secret to be used for lookup, and the secret value.

If the secret should be private to this user, select Private, to share the secret with all members of a project select Project and enter the project name.

Create API Key
Create new secret dialog

Step 3: Secret created#

Click New Secret to bring up the dialog for secret creation. Enter a name for the secret to be used for lookup, and the secret value.

If the secret should be private to this user, select Private, to share the secret with all members of a project select Project and enter the project name.

Create API Key
Secret is now created

Code#

Step 1: Get secrets API#

import hopsworks

hopsworks.login()

secrets_api = hopsworks.get_secrets_api()

Step 2: Create secret#

secret = secrets_api.create_secret("my_secret", "Fk3MoPlQXCQvPo")

API Reference#

Secrets

Conclusion#

In this guide you learned how to create a secret.