# secrets **Warning: Deprecated**: As of 15 July 2024, Gradient API endpoints are deprecated and no longer available for Paperspace users. ## set Set secret #### Arguments `cluster`, `project`, `team` #### Examples ## CLI ```bash gradient secrets set project \ --id "prjpkflqz" \ --name "NewKey" \ --value "NewValue" ``` ## cURL ```bash 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" }' ``` ## Python ```python 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' )) ``` #### Options | 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 | #### Response ## CLI ```text Set project secret 'NewKey' ``` ## cURL ``` ``` ## Python ```text None ``` ## list List secrets #### Arguments `cluster`, `project`, `team` #### Examples ## CLI ```bash gradient secrets list project \ --id "prjpkflqz" ``` ## cURL ``` ``` ## Python ```python from gradient import SecretsClient api_key='d44808a2785d6a...' secrets_client = SecretsClient(api_key) print(secrets_client.list( entity='project', entity_id='prjpkflqz' )) ``` #### Options | 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 | #### Response ## CLI ```text +--------+ | Name | +--------+ | NewKey | +--------+ ``` ## cURL ```json [{ "name": "NewKey" }] ``` ## Python ```python [Secret(name='NewKey')] ``` ## delete Delete secret #### Arguments `cluster`, `project`, `team` #### Examples ## CLI ```bash gradient secrets delete project \ --id "prjpkflqz" \ --name "NewKey" ``` ## cURL ```bash curl -X DELETE 'https://api.paperspace.io/projects/secrets/NewKey?projectId=prjpkflqz' \ -H 'x-api-key: d44808a2785d6a...' ``` ## Python ```python from gradient import SecretsClient api_key='d44808a2785d6a...' secrets_client = SecretsClient(api_key) print(secrets_client.delete( entity='project', entity_id='prjpkflqz', name='NewKey' )) ``` #### Options | 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 | #### Response ## CLI ```text Deleted project secret 'NewKey' ``` ## cURL ``` ``` ## Python ```text None ```