github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/api-docs/volumes.mdx (about)

     1  ---
     2  layout: api
     3  page_title: Volumes - HTTP API
     4  description: The `/volume` endpoints are used to query for and interact with volumes.
     5  ---
     6  
     7  # Volumes HTTP API
     8  
     9  The `/volume` and `/volumes` endpoints are used to query for and interact with
    10  volumes.
    11  
    12  ## List Volumes
    13  
    14  This endpoint lists all volumes.
    15  
    16  | Method | Path          | Produces           |
    17  | ------ | ------------- | ------------------ |
    18  | `GET`  | `/v1/volumes` | `application/json` |
    19  
    20  The table below shows this endpoint's support for
    21  [blocking queries](/api-docs#blocking-queries) and
    22  [required ACLs](/api-docs#acls).
    23  
    24  | Blocking Queries | ACL Required                |
    25  | ---------------- | --------------------------- |
    26  | `YES`            | `namespace:csi-list-volume` |
    27  
    28  ### Parameters
    29  
    30  - `type` `(string: "")` - Specifies the type of volume to
    31    query. Currently only supports `csi`. This is specified as a query
    32    string parameter. Returns an empty list if omitted.
    33  
    34  - `node_id` `(string: "")` - Specifies a string to filter volumes
    35    based on an Node ID prefix. Because the value is decoded to bytes,
    36    the prefix must have an even number of hexadecimal characters
    37    (0-9a-f). This is specified as a query string parameter.
    38  
    39  - `plugin_id` `(string: "")` - Specifies a string to filter volumes
    40    based on a plugin ID prefix. Because the value is decoded to bytes,
    41    the prefix must have an even number of hexadecimal characters
    42    (0-9a-f). This is specified as a query string parameter.
    43  
    44  - `next_token` `(string: "")` - This endpoint supports paging. The `next_token`
    45    parameter accepts a string which identifies the next expected volume. This
    46    value can be obtained from the `X-Nomad-NextToken` header from the previous
    47    response.
    48  
    49  - `per_page` `(int: 0)` - Specifies a maximum number of volumes to return for
    50    this request. If omitted, the response is not paginated. The value of the
    51    `X-Nomad-NextToken` header of the last response can be used as the
    52    `next_token` of the next request to fetch additional pages.
    53  
    54  - `filter` `(string: "")` - Specifies the [expression](/api-docs#filtering)
    55    used to filter the results. Consider using pagination or a query parameter to
    56    reduce resource used to serve the request.
    57  
    58  ### Sample Request
    59  
    60  ```shell-session
    61  $ curl \
    62      https://localhost:4646/v1/volumes?type=csi&node_id=foo&plugin_id=plugin-id1
    63  ```
    64  
    65  ### Sample Response
    66  
    67  ```json
    68  [
    69    {
    70      "ID": "volume-id1",
    71      "ExternalID": "vol-abcdef",
    72      "Namespace": "default",
    73      "Name": "volume id1",
    74      "Topologies": [
    75        {
    76          "foo": "bar"
    77        }
    78      ],
    79      "AccessMode": "multi-node-single-writer",
    80      "AttachmentMode": "file-system",
    81      "CurrentReaders": 2,
    82      "CurrentWriters": 1,
    83      "Schedulable": true,
    84      "PluginID": "plugin-id1",
    85      "Provider": "ebs",
    86      "ControllerRequired": true,
    87      "ControllersHealthy": 3,
    88      "ControllersExpected": 3,
    89      "NodesHealthy": 15,
    90      "NodesExpected": 18,
    91      "ResourceExhausted": 0,
    92      "CreateIndex": 42,
    93      "ModifyIndex": 64
    94    }
    95  ]
    96  ```
    97  
    98  ## Read Volume
    99  
   100  This endpoint reads information about a specific volume.
   101  
   102  | Method | Path                        | Produces           |
   103  | ------ | --------------------------- | ------------------ |
   104  | `GET`  | `/v1/volume/csi/:volume_id` | `application/json` |
   105  
   106  The table below shows this endpoint's support for
   107  [blocking queries](/api-docs#blocking-queries) and
   108  [required ACLs](/api-docs#acls).
   109  
   110  | Blocking Queries | ACL Required                |
   111  | ---------------- | --------------------------- |
   112  | `YES`            | `namespace:csi-read-volume` |
   113  
   114  ### Parameters
   115  
   116  - `:volume_id` `(string: <required>)` - Specifies the ID of the
   117    volume. This must be the full ID. This is specified as part of the
   118    path.
   119  
   120  ### Sample Request
   121  
   122  ```shell-session
   123  $ curl \
   124      https://localhost:4646/v1/volume/csi/volume-id1
   125  ```
   126  
   127  ### Sample Response
   128  
   129  ```json
   130  {
   131    "ID": "volume-id1",
   132    "Name": "volume id1",
   133    "Namespace": "default",
   134    "ExternalID": "vol-abcdef",
   135    "Topologies": [{ "foo": "bar" }],
   136    "AccessMode": "multi-node-single-writer",
   137    "AttachmentMode": "file-system",
   138    "RequestedCapabilities": [
   139      {
   140        "AccessMode": "single-node-writer",
   141        "AttachmentMode": "file-system"
   142      },
   143      {
   144        "AccessMode": "single-node-writer",
   145        "AttachmentMode": "block-device"
   146      }
   147    ],
   148    "Allocations": [
   149      {
   150        "ID": "a8198d79-cfdb-6593-a999-1e9adabcba2e",
   151        "EvalID": "5456bd7a-9fc0-c0dd-6131-cbee77f57577",
   152        "Name": "example.cache[0]",
   153        "NodeID": "fb2170a8-257d-3c64-b14d-bc06cc94e34c",
   154        "PreviousAllocation": "516d2753-0513-cfc7-57ac-2d6fac18b9dc",
   155        "NextAllocation": "cd13d9b9-4f97-7184-c88b-7b451981616b",
   156        "RescheduleTracker": {
   157          "Events": [
   158            {
   159              "PrevAllocID": "516d2753-0513-cfc7-57ac-2d6fac18b9dc",
   160              "PrevNodeID": "9230cd3b-3bda-9a3f-82f9-b2ea8dedb20e",
   161              "RescheduleTime": 1517434161192946200,
   162              "Delay": "5000000000"
   163            }
   164          ]
   165        },
   166        "JobID": "example",
   167        "TaskGroup": "cache",
   168        "DesiredStatus": "run",
   169        "DesiredDescription": "",
   170        "ClientStatus": "running",
   171        "ClientDescription": "",
   172        "TaskStates": {
   173          "redis": {
   174            "State": "running",
   175            "FinishedAt": "0001-01-01T00:00:00Z",
   176            "LastRestart": "0001-01-01T00:00:00Z",
   177            "Restarts": 0,
   178            "StartedAt": "2017-07-25T23:36:26.106431265Z",
   179            "Failed": false,
   180            "Events": [
   181              {
   182                "Type": "Received",
   183                "Time": 1495747371795703800,
   184                "FailsTask": false,
   185                "RestartReason": "",
   186                "SetupError": "",
   187                "DriverError": "",
   188                "ExitCode": 0,
   189                "Signal": 0,
   190                "Message": "",
   191                "KillTimeout": 0,
   192                "KillError": "",
   193                "KillReason": "",
   194                "StartDelay": 0,
   195                "DownloadError": "",
   196                "ValidationError": "",
   197                "DiskLimit": 0,
   198                "FailedSibling": "",
   199                "VaultError": "",
   200                "TaskSignalReason": "",
   201                "TaskSignal": "",
   202                "DriverMessage": ""
   203              },
   204              {
   205                "Type": "Driver",
   206                "Time": 1495747371798867200,
   207                "FailsTask": false,
   208                "RestartReason": "",
   209                "SetupError": "",
   210                "DriverError": "",
   211                "ExitCode": 0,
   212                "Signal": 0,
   213                "Message": "",
   214                "KillTimeout": 0,
   215                "KillError": "",
   216                "KillReason": "",
   217                "StartDelay": 0,
   218                "DownloadError": "",
   219                "ValidationError": "",
   220                "DiskLimit": 0,
   221                "FailedSibling": "",
   222                "VaultError": "",
   223                "TaskSignalReason": "",
   224                "TaskSignal": "",
   225                "DriverMessage": "Downloading image redis:7"
   226              },
   227              {
   228                "Type": "Started",
   229                "Time": 1495747379525667800,
   230                "FailsTask": false,
   231                "RestartReason": "",
   232                "SetupError": "",
   233                "DriverError": "",
   234                "ExitCode": 0,
   235                "Signal": 0,
   236                "Message": "",
   237                "KillTimeout": 0,
   238                "KillError": "",
   239                "KillReason": "",
   240                "StartDelay": 0,
   241                "DownloadError": "",
   242                "ValidationError": "",
   243                "DiskLimit": 0,
   244                "FailedSibling": "",
   245                "VaultError": "",
   246                "TaskSignalReason": "",
   247                "TaskSignal": "",
   248                "DriverMessage": ""
   249              }
   250            ]
   251          }
   252        },
   253        "CreateIndex": 54,
   254        "ModifyIndex": 57,
   255        "CreateTime": 1495747371794276400,
   256        "ModifyTime": 1495747371794276400
   257      }
   258    ],
   259    "ReadAllocs": {
   260      "a8198d79-cfdb-6593-a999-1e9adabcba2e": null
   261    },
   262    "WriteAllocs": {},
   263    "Schedulable": true,
   264    "PluginID": "plugin-id1",
   265    "Provider": "ebs",
   266    "Version": "1.0.1",
   267    "ControllerRequired": true,
   268    "ControllersHealthy": 3,
   269    "ControllersExpected": 3,
   270    "NodesHealthy": 15,
   271    "NodesExpected": 18,
   272    "ResourceExhausted": 0,
   273    "CreateIndex": 42,
   274    "ModifyIndex": 64
   275  }
   276  ```
   277  
   278  ## Register Volume
   279  
   280  This endpoint registers an external volume with Nomad. The volume must exist
   281  in the external storage provider (see [Create Volume] below). It is an error
   282  to register an already registered volume.
   283  
   284  | Method | Path                        | Produces           |
   285  | ------ | --------------------------- | ------------------ |
   286  | `PUT`  | `/v1/volume/csi/:volume_id` | `application/json` |
   287  
   288  The table below shows this endpoint's support for
   289  [blocking queries](/api-docs#blocking-queries) and
   290  [required ACLs](/api-docs#acls).
   291  
   292  | Blocking Queries | ACL Required                 |
   293  | ---------------- | ---------------------------- |
   294  | `NO`             | `namespace:csi-write-volume` |
   295  
   296  ### Parameters
   297  
   298  - `:volume_id` `(string: <required>)` - Specifies the ID of the
   299    volume. This must be the full ID. This is specified as part of the
   300    path.
   301  
   302  ### Sample Payload
   303  
   304  The payload must include a JSON document that describes the volume's
   305  parameters.
   306  
   307  ```json
   308  {
   309    "Volumes": [
   310      {
   311        "ExternalID": "vol-abcdef",
   312        "ID": "volume-id1",
   313        "Name": "volume one",
   314        "Namespace": "default",
   315        "PluginID": "plugin-id1",
   316        "RequestedCapabilities": [
   317          {
   318            "AccessMode": "single-node-writer",
   319            "AttachmentMode": "file-system"
   320          },
   321          {
   322            "AccessMode": "single-node-writer",
   323            "AttachmentMode": "block-device"
   324          }
   325        ],
   326        "Secrets": {
   327          "password": "xyzzy"
   328        },
   329        "Topologies": [{ "foo": "bar" }]
   330      }
   331    ]
   332  }
   333  ```
   334  
   335  ### Sample Request
   336  
   337  ```shell-session
   338  $ curl \
   339      --request PUT \
   340      --data @payload.json \
   341      https://localhost:4646/v1/volume/csi/volume-id1
   342  ```
   343  
   344  ## Create Volume
   345  
   346  This endpoint creates a volume in an external storage provider and registers
   347  it with Nomad. It is an error to create an already-registered volume. Only CSI
   348  plugins that implement the [Controller][csi_plugins_internals] interface with
   349  the `CREATE_DELETE_VOLUME` capability support this endpoint.
   350  
   351  | Method | Path                               | Produces           |
   352  | ------ | ---------------------------------- | ------------------ |
   353  | `PUT`  | `/v1/volume/csi/:volume_id/create` | `application/json` |
   354  
   355  The table below shows this endpoint's support for
   356  [blocking queries](/api-docs#blocking-queries) and
   357  [required ACLs](/api-docs#acls).
   358  
   359  | Blocking Queries | ACL Required                 |
   360  | ---------------- | ---------------------------- |
   361  | `NO`             | `namespace:csi-write-volume` |
   362  
   363  ### Parameters
   364  
   365  - `:volume_id` `(string: <required>)` - Specifies the ID of the
   366    volume. This must be the full ID. This is specified as part of the
   367    path.
   368  
   369  ### Sample Payload
   370  
   371  The payload must include a JSON document that describes the volume's
   372  parameters.
   373  
   374  ```json
   375  {
   376    "Volumes": [
   377      {
   378        "ID": "volume-id1",
   379        "Name": "volume one",
   380        "Namespace": "default",
   381        "PluginID": "plugin-id1",
   382        "MountOptions": {
   383          "FsType": "ext4",
   384          "MountFlags": ["ro", "noatime"],
   385        },
   386        "RequestedCapacityMin": 10737418240,
   387        "RequestedCapacityMax": 21474836480,
   388        "RequestedCapabilities": [
   389          {
   390            "AccessMode": "single-node-writer",
   391            "AttachmentMode": "file-system"
   392          },
   393          {
   394            "AccessMode": "single-node-writer",
   395            "AttachmentMode": "block-device"
   396          }
   397        ],
   398        "Secrets": {
   399          "password": "xyzzy"
   400        },
   401        "SnapshotID": "snap-12345",
   402        "Topologies": [{ "foo": "bar" }]
   403      }
   404    ]
   405  }
   406  ```
   407  
   408  ### Sample Request
   409  
   410  ```shell-session
   411  $ curl \
   412      --request PUT \
   413      --data @payload.json \
   414      https://localhost:4646/v1/volume/csi/volume-id1
   415  ```
   416  
   417  
   418  ## Deregister Volume
   419  
   420  This endpoint deregisters an external volume with Nomad. It is an error to
   421  deregister a volume that is in use.
   422  
   423  | Method   | Path                        | Produces           |
   424  | -------- | --------------------------- | ------------------ |
   425  | `DELETE` | `/v1/volume/csi/:volume_id` | `application/json` |
   426  
   427  The table below shows this endpoint's support for
   428  [blocking queries](/api-docs#blocking-queries) and
   429  [required ACLs](/api-docs#acls).
   430  
   431  | Blocking Queries | ACL Required                 |
   432  | ---------------- | ---------------------------- |
   433  | `NO`             | `namespace:csi-write-volume` |
   434  
   435  ### Parameters
   436  
   437  - `:volume_id` `(string: <required>)` - Specifies the ID of the
   438    volume. This must be the full ID. This is specified as part of the
   439    path.
   440  
   441  - `force` `(bool: false)` - Force deregistration of the volume and immediately
   442    drop claims for terminal allocations. Returns an error if the volume has
   443    running allocations. This does not detach the volume from client nodes.
   444    This is specified as a query string parameter.
   445  
   446  ### Sample Request
   447  
   448  ```shell-session
   449  $ curl \
   450      --request DELETE \
   451      https://localhost:4646/v1/volume/csi/volume-id1?force=false
   452  ```
   453  
   454  ## Delete Volume
   455  
   456  This endpoint deletes an external volume from the storage provider, and
   457  deregisters it from Nomad. It is an error to delete a volume that is in
   458  use. Only CSI plugins that implement the [Controller][csi_plugins_internals]
   459  interface with the `CREATE_DELETE_VOLUME` capability support this endpoint.
   460  
   461  | Method   | Path                               | Produces           |
   462  | -------- | ---------------------------------- | ------------------ |
   463  | `DELETE` | `/v1/volume/csi/:volume_id/delete` | `application/json` |
   464  
   465  The table below shows this endpoint's support for
   466  [blocking queries](/api-docs#blocking-queries) and
   467  [required ACLs](/api-docs#acls).
   468  
   469  | Blocking Queries | ACL Required                 |
   470  | ---------------- | ---------------------------- |
   471  | `NO`             | `namespace:csi-write-volume` |
   472  
   473  This endpoint accepts a `X-Nomad-CSI-Secrets` header to set secrets
   474  for deleting the volume as comma-separated key-value pairs (see the
   475  example below). These secrets will be merged with any secrets already
   476  stored when the CSI volume was created.
   477  
   478  ### Parameters
   479  
   480  - `:volume_id` `(string: <required>)` - Specifies the ID of the
   481    volume. This must be the full ID. This is specified as part of the
   482    path.
   483  
   484  ### Sample Request
   485  
   486  ```shell-session
   487  $ curl \
   488      --request DELETE \
   489      -H "X-Nomad-CSI-Secrets: secret-key-1=value-1,secret-key-2=value-2" \
   490      https://localhost:4646/v1/volume/csi/volume-id1/delete
   491  ```
   492  
   493  ## Detach Volume
   494  
   495  This endpoint detaches an external volume from a Nomad client node. It is an
   496  error to detach a volume that is in use.
   497  
   498  | Method   | Path                               | Produces           |
   499  | -------- | ---------------------------------- | ------------------ |
   500  | `DELETE` | `/v1/volume/csi/:volume_id/detach` | `application/json` |
   501  
   502  The table below shows this endpoint's support for
   503  [blocking queries](/api-docs#blocking-queries) and
   504  [required ACLs](/api-docs#acls).
   505  
   506  | Blocking Queries | ACL Required                 |
   507  | ---------------- | ---------------------------- |
   508  | `NO`             | `namespace:csi-write-volume` |
   509  
   510  ### Parameters
   511  
   512  - `:volume_id` `(string: <required>)` - Specifies the ID of the
   513    volume. This must be the full ID. This is specified as part of the
   514    path.
   515  
   516  - `node` `(string: <required>)` - The node to detach the volume from.
   517    This is specified as a query string parameter.
   518  
   519  ### Sample Request
   520  
   521  ```shell-session
   522  $ curl \
   523      --request DELETE \
   524      https://localhost:4646/v1/volume/csi/volume-id/detach?node=00000000-0000-0000-0000-000000000000
   525  ```
   526  
   527  ## List External Volumes
   528  
   529  This endpoint lists storage volumes that are known to the external storage
   530  provider but may not be registered with Nomad.  Only CSI plugins that
   531  implement the [Controller][csi_plugins_internals] interface with the
   532  `LIST_VOLUMES` capability support this endpoint.
   533  
   534  | Method | Path                   | Produces           |
   535  |--------|------------------------|--------------------|
   536  | `GET`  | `/v1/volumes/external` | `application/json` |
   537  
   538  The table below shows this endpoint's support for
   539  [blocking queries](/api-docs#blocking-queries) and
   540  [required ACLs](/api-docs#acls).
   541  
   542  | Blocking Queries | ACL Required                 |
   543  | ---------------- | ---------------------------- |
   544  | `YES`             | `namespace:csi-write-volume` |
   545  
   546  ### Parameters
   547  
   548  - `plugin_id` `(string: "")` - Specifies a string to filter volumes
   549    based on a plugin ID prefix. Because the value is decoded to bytes,
   550    the prefix must have an even number of hexadecimal characters
   551    (0-9a-f). This is specified as a query string parameter.
   552  
   553  - `next_token` `(string: "")` - This endpoint supports paging. The
   554    `next_token` parameter accepts a string returned in a previous response's
   555    `NextToken` field to request the next page of results.
   556  
   557  - `per_page` `(int: <required>)` - Specifies a maximum number of snapshots to
   558    return for this request. The response will include a `NextToken` field that
   559    can be passed to the next request to fetch additional pages.
   560  
   561  ### Sample Request
   562  
   563  ```shell-session
   564  $ curl \
   565      https://localhost:4646/v1/volumes/external?&plugin_id=plugin-id1&per_page=2
   566  ```
   567  
   568  ### Sample Response
   569  
   570  ```json
   571  {
   572    "NextToken": "eyJ2IjoiMiIsImMiOiJLZ",
   573    "Volumes": [
   574      {
   575        "ExternalID": "vol-37ac485e",
   576        "CapacityBytes": 1000000,
   577        "SnapshotID": "snap-12345",
   578        "PublishedExternalNodeIDs": ["i-12345", "i-abcde"],
   579        "IsAbnormal": false,
   580        "Status": ""
   581      },
   582      {
   583        "ExternalID": "vol-10ac4879",
   584        "CapacityBytes": 1000000,
   585        "SnapshotID": "snap-abcdef",
   586        "PublishedExternalNodeIDs": ["i-12345", "i-abcde"],
   587        "IsAbnormal": true,
   588        "Status": "example error message from provider"
   589      }
   590    ]
   591  }
   592  ```
   593  
   594  ## Create Snapshot
   595  
   596  This endpoint creates a snapshot of a volume on the external storage
   597  provider. Only CSI plugins that implement the
   598  [Controller][csi_plugins_internals] interface with the
   599  `CREATE_DELETE_SNAPSHOT` capability support this endpoint.
   600  
   601  | Method   | Path                              | Produces           |
   602  | -------- | --------------------------------- | ------------------ |
   603  | `POST`    | `/v1/volumes/snapshot`           | `application/json` |
   604  
   605  The table below shows this endpoint's support for
   606  [blocking queries](/api-docs#blocking-queries) and
   607  [required ACLs](/api-docs#acls).
   608  
   609  | Blocking Queries | ACL Required                 |
   610  | ---------------- | ---------------------------- |
   611  | `NO`             | `namespace:csi-write-volume` |
   612  
   613  
   614  ### Sample Payload
   615  
   616  The payload must include a JSON document that describes the snapshot's
   617  parameters.
   618  
   619  ```json
   620  {
   621    "Snapshots": [
   622      {
   623        "SourceVolumeID": "volume-id1",
   624        "PluginID": "plugin-id1",
   625        "Name": "mysnap",
   626        "Secrets": {
   627          "password": "xyzzy"
   628        },
   629        "Parameters": {
   630          "example": "infrequent_access"
   631        }
   632      }
   633    ]
   634  }
   635  ```
   636  
   637  ### Sample Request
   638  
   639  ```shell-session
   640  $ curl \
   641      --request POST \
   642      --data @payload.json \
   643      https://localhost:4646/v1/volumes/snapshot
   644  ```
   645  
   646  ### Sample Response
   647  
   648  ```json
   649  {
   650    "Snapshots": [
   651      {
   652        "ID": "snap-031f5f7e3406d594a",
   653        "SizeBytes": 10737418240,
   654        "CreateTime": 1617909982,
   655        "IsReady": false,
   656        "SourceVolumeID": "volume-id1"
   657      }
   658    ]
   659  }
   660  ```
   661  
   662  ## Delete Snapshot
   663  
   664  This endpoint deletes a volume snapshot from the external storage
   665  provider. Only CSI plugins that implement the
   666  [Controller][csi_plugins_internals] interface with the
   667  `CREATE_DELETE_SNAPSHOT` capability support this endpoint.
   668  
   669  | Method   | Path                   | Produces           |
   670  | -------- | ---------------------- | ------------------ |
   671  | `DELETE` | `/v1/volumes/snapshot` | `application/json` |
   672  
   673  The table below shows this endpoint's support for
   674  [blocking queries](/api-docs#blocking-queries) and
   675  [required ACLs](/api-docs#acls).
   676  
   677  | Blocking Queries | ACL Required                 |
   678  | ---------------- | ---------------------------- |
   679  | `NO`             | `namespace:csi-write-volume` |
   680  
   681  This endpoint accepts a `X-Nomad-CSI-Secrets` header to set secrets
   682  for deleting the snapshot as comma-separated key-value pairs (see the
   683  example below). These secrets will be merged with any secrets already
   684  stored when the CSI snapshot was created.
   685  
   686  ### Parameters
   687  
   688  - `plugin_id` `(string: <required>)` - Specifies the prefix of a CSI plugin ID
   689    to perform the delete. Because the value is decoded to bytes, the prefix
   690    must have an even number of hexadecimal characters (0-9a-f). This is
   691    specified as a query string parameter.
   692  
   693  - `snapshot_id` `(string: <required>)` - Specifies the snapshot ID to
   694    delete. This is specified as a query parameter.
   695  
   696  ### Sample Request
   697  
   698  ```shell-session
   699  $ curl \
   700      --request DELETE \
   701      -H "X-Nomad-CSI-Secrets: secret-key-1=value-1,secret-key-2=value-2" \
   702      https://localhost:4646/v1/volumes/snapshot
   703  ```
   704  
   705  ## List Snapshots
   706  
   707  This endpoint lists volume snapshots on the external storage provider. Only
   708  CSI plugins that implement the [Controller][csi_plugins_internals] interface
   709  with the `LIST_SNAPSHOTS` capability support this endpoint.
   710  
   711  
   712  | Method | Path                   | Produces           |
   713  | ------ | ---------------------- | ------------------ |
   714  | `GET`  | `/v1/volumes/snapshot` | `application/json` |
   715  
   716  The table below shows this endpoint's support for
   717  [blocking queries](/api-docs#blocking-queries) and
   718  [required ACLs](/api-docs#acls).
   719  
   720  | Blocking Queries | ACL Required                |
   721  | ---------------- | --------------------------- |
   722  | `YES`            | `namespace:csi-list-volume` |
   723  
   724  This endpoint accepts a `X-Nomad-CSI-Secrets` header to set secrets
   725  for deleting the snapshot as comma-separated key-value pairs (see the
   726  example below). These secrets will be merged with any secrets already
   727  stored when the CSI snapshot was created.
   728  
   729  ### Parameters
   730  
   731  - `plugin_id` `(string: <required>)` - Specifies the prefix of a CSI plugin ID
   732    to perform the list. Because the value is decoded to bytes, the prefix must
   733    have an even number of hexadecimal characters (0-9a-f). This is specified as
   734    a query string parameter.
   735  
   736  - `next_token` `(string: "")` - This endpoint supports paging. The
   737    `next_token` parameter accepts a string returned in a previous response's
   738    `NextToken` field to request the next page of results.
   739  
   740  - `per_page` `(int: <required>)` - Specifies a maximum number of snapshots to
   741    return for this request. The response will include a `NextToken` field that
   742    can be passed to the next request to fetch additional pages.
   743  
   744  ### Sample Request
   745  
   746  ```shell-session
   747  $ curl \
   748      -H "X-Nomad-CSI-Secrets: secret-key-1=value-1,secret-key-2=value-2" \
   749      https://localhost:4646/v1/volumes/snapshot?plugin_id=plugin-id1&per_page=2
   750  ```
   751  
   752  ### Sample Response
   753  
   754  ```json
   755  {
   756    "NextToken": "eyJ2IjoiMiIsImMiOiJLZ",
   757    "Snapshots": [
   758      {
   759        "CreateTime": 1227088980,
   760        "ExternalSourceVolumeID": "vol-37ac485e",
   761        "ID": "snap-9df717f4",
   762        "IsReady": true,
   763        "Parameters": null,
   764        "PluginID": "aws-ebs0",
   765        "SizeBytes": 2147483648
   766      },
   767      {
   768        "CreateTime": 1227091232,
   769        "ExternalSourceVolumeID": "vol-10ac4879",
   770        "ID": "snap-5cf81835",
   771        "IsReady": true,
   772        "Parameters": null,
   773        "PluginID": "aws-ebs0",
   774        "SizeBytes": 11811160064
   775      }
   776    ]
   777  }
   778  ```
   779  
   780  [csi]: https://github.com/container-storage-interface/spec
   781  [csi_plugin]: /docs/job-specification/csi_plugin
   782  [csi_plugins_internals]: /docs/concepts/plugins/csi#csi-plugins
   783  [Create Volume]: #create-volume