hetzner/primary_ips

Types

PrimaryIpSortOption = enum
  sortId = "id", sortIdAsc = "id:asc", sortIdDesc = "id:desc",
  sortCreated = "created", sortCreatedAsc = "created:asc",
  sortCreatedDesc = "created:desc"

Procs

proc deletePrimaryIpsId(client: HetznerClient; id: int64): Future[AsyncResponse] {.
    ...stackTrace: false, raises: [Exception, ValueError, HttpRequestError,
                                LibraryError, SslError, OSError, IOError,
                                ProtocolError, KeyError],
    tags: [RootEffect, ReadIOEffect, TimeEffect], forbids: [].}

Deletes a Primary IP.

The Primary IP may be assigned to a Server. In this case it is unassigned automatically. The Server must be powered off (status off) in order for this operation to succeed.

proc getPrimaryIps(client: HetznerClient; name: string = default(string);
                   labelSelector: string = default(string);
                   ip: string = default(string);
                   sort: set[PrimaryIpSortOption] = {}): Future[
    GetPrimaryIpsResponse] {....stackTrace: false, raises: [Exception, ValueError,
    KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError,
    ProtocolError, OpenParserJsonError, HetznerClientError],
                             tags: [RootEffect, ReadIOEffect, TimeEffect],
                             forbids: [].}
Returns all Primary IP objects.
proc getPrimaryIpsId(client: HetznerClient; id: int64): Future[
    GetPrimaryIpsIdResponse] {....stackTrace: false, raises: [Exception,
    ValueError, HttpRequestError, LibraryError, SslError, OSError, IOError,
    ProtocolError, KeyError, OpenParserJsonError, HetznerClientError],
                               tags: [RootEffect, ReadIOEffect, TimeEffect],
                               forbids: [].}
Returns a specific Primary IP object.
proc postPrimaryIps(client: HetznerClient; body: PostPrimaryIpsRequest): Future[
    PostPrimaryIpsResponse] {....stackTrace: false, raises: [Exception, ValueError,
    HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError,
    KeyError, OpenParserJsonError, HetznerClientError],
                              tags: [RootEffect, ReadIOEffect, TimeEffect],
                              forbids: [].}
Creates a new Primary IP, optionally assigned to a Server.

If you want to create a Primary IP that is not assigned to a Server, you need to
provide the `datacenter` key instead of `assignee_id`. This can be either the ID
or the name of the Datacenter this Primary IP shall be created in.

Note that a Primary IP can only be assigned to a Server in the same Datacenter
later on.

#### Call specific error codes

| Code                          | Description
|
|------------------------------
|-------------------------------------------------------------- |
| `server_not_stopped`          | The specified server is running, but needs to
be powered off  |
| `server_has_ipv4`             | The server already has an ipv4 address
|
| `server_has_ipv6`             | The server already has an ipv6 address
|
proc putPrimaryIpsId(client: HetznerClient; id: int64;
                     body: PutPrimaryIpsIdRequest): Future[
    PutPrimaryIpsIdResponse] {....stackTrace: false, raises: [Exception,
    ValueError, HttpRequestError, LibraryError, SslError, OSError, IOError,
    ProtocolError, KeyError, OpenParserJsonError, HetznerClientError],
                               tags: [RootEffect, ReadIOEffect, TimeEffect],
                               forbids: [].}

Updates the Primary IP.

Note that when updating labels, the Primary IP'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.

If the Primary IP object changes during the request, the response will be a โ€œconflictโ€ error.