Description of image

storage-providers

create s3

Create storage providers

Examples

gradient storageProviders create s3 \
  --name "NewStorageProvider" \
  --bucket "new-storage-provider" \
  --accessKey "AKIAVWO7J5OJ47KDBSIV" \
  --secretAccessKey "K8j7Qbh/rofyNRoIZotjlm..."
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..."
    }
}'
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

Created new storage provider with id: splia57f7o5jqke
{
  "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"
}
splia57f7o5jqke

details

Show storage provider details

Examples

gradient storageProviders details \
  --id "splia57f7o5jqke"
curl -X GET 'https://api.paperspace.io/storageProviders/splia57f7o5jqke' \
-H 'x-api-key: d44808a2785d6a...'
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

+--------+---------------------------------+
| Name   | NewStorageProvider              |
+--------+---------------------------------+
| ID     | splia57f7o5jqke                 |
| Type   | s3                              |
| Config | accessKey: AKIAVWO7J5OJ47KDBSIV |
|        | bucket: new-storage-provider    |
|        | retainData: False               |
|        | secretAccessKey: ********       |
+--------+---------------------------------+
{
  "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"
}
StorageProvider(
  (id = "splia57f7o5jqke"),
  (type = "s3"),
  (name = "NewStorageProvider"),
  (config = {
    bucket: "new-storage-provider",
    accessKey: "AKIAVWO7J5OJ47KDBSIV",
    retainData: False,
    secretAccessKey: "********",
  })
);

list

List storage providers

Examples

gradient storageProviders list
curl -X GET 'https://api.paperspace.io/storageProviders' \
-H 'x-api-key: d44808a2785d6a...'
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

+--------------------+-----------------+------+------------------------------------------+
| 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: ********                |
+--------------------+-----------------+------+------------------------------------------+
[
  {
    "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"
  }
]
[
  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

gradient storageProviders update s3 \
  --id "splia57f7o5jqke" \
  --name "NewNameStorageProvider"
curl -X POST 'https://api.paperspace.io/storageProviders/splia57f7o5jqke' \
-H 'x-api-key: d44808a2785d6a...' \
-H 'Content-Type: application/json' \
--data-raw '{
    "name": "NewNameStorageProvider"
}'
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

Updated storage provider
{
  "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"
}
None

delete

Delete storage providers

Examples

gradient storageProviders delete \
  --id "splia57f7o5jqke"
curl -X DELETE 'https://api.paperspace.io/storageProviders/splia57f7o5jqke' \
-H 'x-api-key: d44808a2785d6a...'
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

Deleted storage provider: splromkivaz8ztg
None