Secret module¶
A secret is an object containing sensitive information or confidential data such as a password, SSH private key, SSL certificate. It grants rapyuta.io access to private git repositories and private docker images so that the platform can build source code in private git repositories or use private docker images.
Client Module¶
- class Client(auth_token, project=None)¶
Client class provides access to device, package, volume and deployment classes.
- __init__(auth_token, project=None)¶
Get new client object
- Parameters
auth_token (string) – Authentication token
project (string) – project_guid of the user
- create_secret(secret)¶
Create a new Secret on the Platform under the project.
Following example demonstrates the use of this method for creating a new Secret.
>>> from rapyuta_io.clients.secret import Secret, SecretConfigSourceBasicAuth >>> client = Client(auth_token='auth_token', project='project_guid') >>> secret_config = SecretConfigSourceBasicAuth('user', 'password') >>> secret = Secret('secret-name', secret_config) >>> client.create_secret(secret)
- delete_secret(guid)¶
Delete a secret using its GUID.
- Parameters
guid (str) – Project’s GUID
Following example demonstrates how to delete a Secret using this method.
>>> client = Client(auth_token='auth_token', project='project_guid') >>> client.delete_secret('secret-guid')
- get_secret(guid)¶
Get a Secret using its GUID.
Following example demonstrates how a Secret can be fetched using this method.
>>> client = Client(auth_token='auth_token', project='project_guid') >>> client.get_secret('secret-guid')
- list_secrets()¶
List all the Secrets under the Project on the Platform.
- Returns
A list of all available Secrets under the selected Project.
- Return type
list(
Secret
)
Following example demonstrates how to fetch the list of all Secrets.
>>> client = Client(auth_token='auth_token', project='project_guid') >>> client.list_secrets()
Secret Module¶
- class Secret(name, secret_config)¶
Secret is a resource that let’s the IO Platform access private resources (Git or Docker Repositories) from third-party providers.
- Variables
name – Name of the Secret
guid – GUID of the Secret
secret_type – Type of the Secret
created_at – Creation Time of the Secret
creator – Create of the Secret
- Parameters
name (str) – Name of the Secret
secret_config (Union[
SecretConfigDocker
]) – Secret Configuration
- delete()¶
Delete the secret using the secret object.
Following example demonstrates how to delete a secret using secret object:
>>> from rapyuta_io import Client >>> client = Client(auth_token='auth_token', project='project_guid') >>> secret = client.get_secret(guid='secret-id') >>> secret.delete()
- class SecretConfigDocker(username, password, email, registry='https://index.docker.io/v1/')¶
SecretConfigDocker represents Docker Secret for Docker registries. This type of secrets can be used to access private Docker repositories for either pulling base images or pushing the images from Builds.
- class SecretType(value)¶
SecretType is a Enum type defining different types of Secrets possible on the Platform.
SecretType can be any of the following types
SecretType.DOCKER
SecretType.SOURCE_BASIC_AUTH
SecretType.SOURCE_SSH_AUTH