Set secret
cluster
, project
, team
gradient secrets set project \
--id "prjpkflqz" \
--name "NewKey" \
--value "NewValue"
curl -X PUT 'https://api.paperspace.io/projects/secrets/NewKey?projectId=prjpkflqz' \
-H 'x-api-key: d44808a2785d6a...' \
-H 'Content-Type: application/json' \
--data-raw '{
"value": "NewValue"
}'
from gradient import SecretsClient
api_key='d44808a2785d6a...'
secrets_client = SecretsClient(api_key)
print(secrets_client.set(
entity='project',
entity_id='prjpkflqz',
name='NewKey',
value='NewValue'
))
Name | Type | Attributes | Description |
---|---|---|---|
--id |
string | required | Entity ID |
--name |
string | required | Secret name |
--value |
string | required | Secret value |
--apiKey |
string | optional | API key to use this time only |
--optionsFile |
string | optional | Path to YAML with predefined options |
--createOptionsFile |
string | optional | Generate template options file |
List secrets
cluster
, project
, team
gradient secrets list project \
--id "prjpkflqz"
from gradient import SecretsClient
api_key='d44808a2785d6a...'
secrets_client = SecretsClient(api_key)
print(secrets_client.list(
entity='project',
entity_id='prjpkflqz'
))
Name | Type | Attributes | Description |
---|---|---|---|
--id |
string | required | Entity ID |
--apiKey |
string | optional | API key to use this time only |
--optionsFile |
string | optional | Path to YAML with predefined options |
--createOptionsFile |
string | optional | Generate template options file |
+--------+
| Name |
+--------+
| NewKey |
+--------+
[{ "name": "NewKey" }]
[Secret(name='NewKey')]
Delete secret
cluster
, project
, team
gradient secrets delete project \
--id "prjpkflqz" \
--name "NewKey"
curl -X DELETE 'https://api.paperspace.io/projects/secrets/NewKey?projectId=prjpkflqz' \
-H 'x-api-key: d44808a2785d6a...'
from gradient import SecretsClient
api_key='d44808a2785d6a...'
secrets_client = SecretsClient(api_key)
print(secrets_client.delete(
entity='project',
entity_id='prjpkflqz',
name='NewKey'
))
Name | Type | Attributes | Description |
---|---|---|---|
--id |
string | required | Entity ID |
--name |
string | required | Secret name |
--apiKey |
string | optional | API key to use this time only |
--optionsFile |
string | optional | Path to YAML with predefined options |
--createOptionsFile |
string | optional | Generate template options file |