hetzner/volumes

Types

VolumeSortOption = enum
  sortId = "id", sortIdAsc = "id:asc", sortIdDesc = "id:desc",
  sortName = "name", sortNameAsc = "name:asc", sortNameDesc = "name:desc",
  sortCreated = "created", sortCreatedAsc = "created:asc",
  sortCreatedDesc = "created:desc"
VolumeStatusOption = enum
  statusAvailable = "available", statusCreating = "creating"

Procs

proc deleteVolumesId(client: HetznerClient; id: string): Future[AsyncResponse] {.
    ...stackTrace: false, raises: [Exception, ValueError, HttpRequestError,
                                LibraryError, SslError, OSError, IOError,
                                ProtocolError, KeyError],
    tags: [RootEffect, ReadIOEffect, TimeEffect], forbids: [].}
Deletes a volume. All Volume data is irreversibly destroyed. The Volume must not be attached to a Server and it must not have delete protection enabled.
proc getVolumes(client: HetznerClient; status: set[VolumeStatusOption] = {};
                sort: set[VolumeSortOption] = {};
                name: string = default(string);
                labelSelector: string = default(string)): Future[
    GetVolumesResponse] {....stackTrace: false, raises: [Exception, ValueError,
    KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError,
    ProtocolError, OpenParserJsonError, HetznerClientError],
                          tags: [RootEffect, ReadIOEffect, TimeEffect],
                          forbids: [].}
Gets all existing Volumes that you have available.
proc getVolumesId(client: HetznerClient; id: int64): Future[GetVolumesIdResponse] {.
    ...stackTrace: false, raises: [Exception, ValueError, HttpRequestError,
                                LibraryError, SslError, OSError, IOError,
                                ProtocolError, KeyError, OpenParserJsonError,
                                HetznerClientError],
    tags: [RootEffect, ReadIOEffect, TimeEffect], forbids: [].}
Gets a specific Volume object.
proc postVolumes(client: HetznerClient; body: PostVolumesRequest): Future[
    PostVolumesResponse] {....stackTrace: false, raises: [Exception, ValueError,
    HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError,
    KeyError, OpenParserJsonError, HetznerClientError],
                           tags: [RootEffect, ReadIOEffect, TimeEffect],
                           forbids: [].}
Creates a new Volume attached to a Server. If you want to create a Volume that
is not attached to a Server, you need to provide the `location` key instead of
`server`. This can be either the ID or the name of the Location this Volume will
be created in. Note that a Volume can be attached to a Server only in the same
Location as the Volume itself.

Specifying the Server during Volume creation will automatically attach the
Volume to that Server after it has been initialized. In that case, the
`next_actions` key in the response is an array which contains a single
`attach_volume` action.

The minimum Volume size is 10GB and the maximum size is 10TB (10240GB).

A volume’s name can consist of alphanumeric characters, dashes, underscores, and
dots, but has to start and end with an alphanumeric character. The total length
is limited to 64 characters. Volume names must be unique per Project.

#### Call specific error codes

| Code                                | Description
|
|-------------------------------------|-----------------------------------------
------------|
| `no_space_left_in_location`         | There is no volume space left in the
given location |
proc putVolumesId(client: HetznerClient; id: string; body: PutVolumesIdRequest): Future[
    PutVolumesIdResponse] {....stackTrace: false, raises: [Exception, ValueError,
    HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError,
    KeyError, OpenParserJsonError, HetznerClientError],
                            tags: [RootEffect, ReadIOEffect, TimeEffect],
                            forbids: [].}

Updates the Volume properties.

Note that when updating labels, the volume’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.