# storage-providers **Warning: Deprecated**: As of 15 July 2024, Gradient API endpoints are deprecated and no longer available for Paperspace users. ## create s3 Create storage providers #### Examples ## CLI ```bash gradient storageProviders create s3 \ --name "NewStorageProvider" \ --bucket "new-storage-provider" \ --accessKey "AKIAVWO7J5OJ47KDBSIV" \ --secretAccessKey "K8j7Qbh/rofyNRoIZotjlm..." ``` ## cURL ```bash curl -X POST 'https://api.paperspace.io/storageProviders' \ -H 'x-api-key: d44808a2785d6a...' \ -H 'Content-Type: application/json' \ --data-raw '{ "name": "NewStorageProvider", "type": "s3", "config": { "bucket": "new-storage-provider", "accessKey": "AKIAVWO7J5OJ47KDBSIV", "secretAccessKey": "K8j7Qbh/rofyNRoIZotjlm..." } }' ``` ## Python ```python from gradient import StorageProvidersClient api_key='d44808a2785d6a...' storage_provider_client = StorageProvidersClient(api_key) print(storage_provider_client.create_s3( name='NewStorageProvider', bucket='new-storage-provider', access_key='AKIAVWO7J5OJ47KDBSIV', secret_access_key='K8j7Qbh/rofyNRoIZotjlm...' )) ``` #### Options | Name | Type | Attributes | Description | |---|---|---|---| | `--name` | string | required | Storage provider name | | `--bucket` | string | required | S3 bucket | | `--accessKey` | string | required | S3 access key ID | | `--secretAccessKey` | string | required | S3 secret access key | | `--endpoint` | string | optional | S3 endpoint URL | | `--region` | string | optional | S3 region | | `--signatureVersion` | string | optional | S3 signature version | | `--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 Created new storage provider with id: splia57f7o5jqke ``` ## cURL ```json { "name": "NewStorageProvider", "config": { "bucket": "new-storage-provider", "accessKey": "AKIAVWO7J5OJ47KDBSIV", "retainData": false, "secretAccessKey": "********" }, "dtCreated": "2022-03-22T07:46:38.426Z", "dtModified": "2022-03-22T07:46:38.426Z", "isTeamDefault": false, "isGradientManaged": false, "id": "splia57f7o5jqke", "type": "s3" } ``` ## Python ```text splia57f7o5jqke ``` ## details Show storage provider details #### Examples ## CLI ```bash gradient storageProviders details \ --id "splia57f7o5jqke" ``` ## cURL ```bash curl -X GET 'https://api.paperspace.io/storageProviders/splia57f7o5jqke' \ -H 'x-api-key: d44808a2785d6a...' ``` ## Python ```python from gradient import StorageProvidersClient api_key='d44808a2785d6a...' storage_provider_client = StorageProvidersClient(api_key) print(storage_provider_client.get( storage_provider_id='splia57f7o5jqke' )) ``` #### Options | Name | Type | Attributes | Description | |---|---|---|---| | `--id` | string | required | Storage provider 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 | NewStorageProvider | +--------+---------------------------------+ | ID | splia57f7o5jqke | | Type | s3 | | Config | accessKey: AKIAVWO7J5OJ47KDBSIV | | | bucket: new-storage-provider | | | retainData: False | | | secretAccessKey: ******** | +--------+---------------------------------+ ``` ## cURL ```json { "name": "NewStorageProvider", "config": { "bucket": "new-storage-provider", "accessKey": "AKIAVWO7J5OJ47KDBSIV", "retainData": false, "secretAccessKey": "********" }, "dtCreated": "2022-03-22T07:46:38.426Z", "dtModified": "2022-03-22T07:46:38.426Z", "isTeamDefault": false, "isGradientManaged": false, "id": "splia57f7o5jqke", "type": "s3" } ``` ## Python ```js StorageProvider( (id = "splia57f7o5jqke"), (type = "s3"), (name = "NewStorageProvider"), (config = { bucket: "new-storage-provider", accessKey: "AKIAVWO7J5OJ47KDBSIV", retainData: False, secretAccessKey: "********", }) ); ``` ## list List storage providers #### Examples ## CLI ```bash gradient storageProviders list ``` ## cURL ```bash curl -X GET 'https://api.paperspace.io/storageProviders' \ -H 'x-api-key: d44808a2785d6a...' ``` ## Python ```python from gradient import StorageProvidersClient api_key='d44808a2785d6a...' storage_provider_client = StorageProvidersClient(api_key) print(storage_provider_client.list()) ``` #### Options | Name | Type | Attributes | Description | |---|---|---|---| | `--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 | ID | Type | Config | +--------------------+-----------------+------+------------------------------------------+ | Gradient Managed | sp65qbxcrsgiv43 | s3 | accessKey: 6P0NXXIKSB49ZW7ZXESL | | | | | bucket: tewr3st2z | | | | | endpoint: https://osg-ny2.paperspace.io/ | | | | | retainData: False | | | | | secretAccessKey: ******** | | NewStorageProvider | splia57f7o5jqke | s3 | accessKey: AKIAVWO7J5OJ47KDBSIV | | | | | bucket: new-storage-provider | | | | | retainData: False | | | | | secretAccessKey: ******** | +--------------------+-----------------+------+------------------------------------------+ ``` ## cURL ```json [ { "name": "Gradient Managed", "config": { "bucket": "tewr3st2z", "endpoint": "https://osg-ny2.paperspace.io/", "accessKey": "6P0NXXIKSB49ZW7ZXESL", "retainData": false, "secretAccessKey": "********" }, "dtCreated": "2022-03-14T15:00:11.060Z", "dtModified": "2022-03-14T15:00:11.060Z", "isTeamDefault": true, "isGradientManaged": true, "id": "sp65qbxcrsgiv43", "type": "s3" }, { "name": "NewStorageProvider", "config": { "bucket": "new-storage-provider", "accessKey": "AKIAVWO7J5OJ47KDBSIV", "retainData": false, "secretAccessKey": "********" }, "dtCreated": "2022-03-22T07:46:38.426Z", "dtModified": "2022-03-22T07:46:38.426Z", "isTeamDefault": false, "isGradientManaged": false, "id": "splia57f7o5jqke", "type": "s3" } ] ``` ## Python ```js [ StorageProvider( (id = "sp65qbxcrsgiv43"), (type = "s3"), (name = "Gradient Managed"), (config = { bucket: "tewr3st2z", endpoint: "https://osg-ny2.paperspace.io/", accessKey: "6P0NXXIKSB49ZW7ZXESL", retainData: False, secretAccessKey: "********", }) ), StorageProvider( (id = "splia57f7o5jqke"), (type = "s3"), (name = "NewStorageProvider"), (config = { bucket: "new-storage-provider", accessKey: "AKIAVWO7J5OJ47KDBSIV", retainData: False, secretAccessKey: "********", }) ), ]; ``` ## update s3 Update s3 storage provider #### Examples ## CLI ```bash gradient storageProviders update s3 \ --id "splia57f7o5jqke" \ --name "NewNameStorageProvider" ``` ## cURL ```bash curl -X POST 'https://api.paperspace.io/storageProviders/splia57f7o5jqke' \ -H 'x-api-key: d44808a2785d6a...' \ -H 'Content-Type: application/json' \ --data-raw '{ "name": "NewNameStorageProvider" }' ``` ## Python ```python from gradient import StorageProvidersClient api_key='d44808a2785d6a...' storage_provider_client = StorageProvidersClient(api_key) print(storage_provider_client.update_s3( storage_provider_id='splia57f7o5jqke', name='NewNameStorageProvider' )) ``` #### Options | Name | Type | Attributes | Description | |---|---|---|---| | `--id` | string | required | Storage provider ID | | `--name` | string | optional | Storage provider name | | `--bucket` | string | optional | S3 bucket | | `--accessKey` | string | optional | S3 access key ID | | `--secretAccessKey` | string | optional | S3 secret access key | | `--endpoint` | string | optional | S3 endpoint URL | | `--region` | string | optional | S3 region | | `--signatureVersion` | string | optional | S3 signature version | | `--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 Updated storage provider ``` ## cURL ```json { "name": "NewNameStorageProvider", "config": { "bucket": "new-storage-provider", "accessKey": "AKIAVWO7J5OJ47KDBSIV", "retainData": false, "secretAccessKey": "********" }, "dtCreated": "2022-03-22T07:46:38.426Z", "dtModified": "2022-03-22T08:01:57.489Z", "isTeamDefault": false, "isGradientManaged": false, "id": "splia57f7o5jqke", "type": "s3" } ``` ## Python ```text None ``` ## delete Delete storage providers #### Examples ## CLI ```bash gradient storageProviders delete \ --id "splia57f7o5jqke" ``` ## cURL ```bash curl -X DELETE 'https://api.paperspace.io/storageProviders/splia57f7o5jqke' \ -H 'x-api-key: d44808a2785d6a...' ``` ## Python ```python from gradient import StorageProvidersClient api_key='d44808a2785d6a...' storage_provider_client = StorageProvidersClient(api_key) print(storage_provider_client.delete( storage_provider_id='splia57f7o5jqke', )) ``` #### Options | Name | Type | Attributes | Description | |---|---|---|---| | `--id` | string | required | Storage provider 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 Deleted storage provider: splromkivaz8ztg ``` ## cURL ``` ``` ## Python ```text None ```