serverscom

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 15 Imported by: 3

Documentation

Index

Constants

View Source
const (
	LoadBalancerClusterPath = "/load_balancer_clusters/%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment added in v1.0.8

type Attachment struct {
	ID           string `json:"id"`
	InstanceID   string `json:"instance_id"`
	InstanceName string `json:"instance_name"`
	Device       string `json:"device"`
}

type BadRequestError

type BadRequestError struct {
	StatusCode int
	ErrorCode  string
	Message    string
}

BadRequestError represents an errors related to 400 response status code

func (*BadRequestError) Error

func (e *BadRequestError) Error() string

type BandwidthOption

type BandwidthOption struct {
	ID     int64  `json:"id"`
	Name   string `json:"name"`
	Type   string `json:"type"`
	Commit *int64 `json:"commit,omitempty"`
}

BandwidthOption represents bandwidth option

type Client

type Client struct {
	UserAgent string

	CloudComputingInstances CloudComputingInstancesService
	Hosts                   HostsService
	L2Segments              L2SegmentsService

	Locations             LocationsService
	CloudComputingRegions CloudComputingRegionsService
	SSHKeys               SSHKeysService
	SSLCertificates       SSLCertificatesService

	NetworkPools NetworkPoolsService

	LoadBalancers LoadBalancersService

	LoadBalancerClusters LoadBalancerClustersService

	CloudBlockStorageBackups CloudBlockStorageBackupsService
	CloudBlockStorageVolumes CloudBlockStorageVolumesService

	Racks RacksService

	KubernetesClusters KubernetesClustersService
	// contains filtered or unexported fields
}

Client manages communication with Servers.com API V1

func NewClient

func NewClient(token string) *Client

NewClient builds a new client with token

func NewClientWithEndpoint

func NewClientWithEndpoint(token, baseURL string) *Client

NewClientWithEndpoint builds a new client with token and api endpoint

func (*Client) SetupUserAgent

func (cli *Client) SetupUserAgent(userAgent string)

SetupUserAgent setups custom User-Agent header, by default: go-serverscom-client

type CloudBlockStorageBackup added in v1.0.8

type CloudBlockStorageBackup struct {
	ID                  string            `json:"id"`
	OpenstackUUID       *string           `json:"openstack_uuid"`
	OpenstackVolumeUUID string            `json:"openstack_volume_uuid"`
	RegionID            int               `json:"region_id"`
	Size                int               `json:"size"`
	Status              string            `json:"status"`
	Labels              map[string]string `json:"labels"`
	Created             *time.Time        `json:"created_at"`
	Name                string            `json:"name"`
}

CloudBlockStorageBackup represents backup for cloud block storage volume

type CloudBlockStorageBackupCreateInput added in v1.0.8

type CloudBlockStorageBackupCreateInput struct {
	VolumeID    string            `json:"volume_id"`
	Name        string            `json:"name"`
	Incremental bool              `json:"incremental,omitempty"`
	Force       bool              `json:"force,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
}

CloudBlockStorageBackupCreateInput represents cloud block storage volume backup create input

type CloudBlockStorageBackupRestoreInput added in v1.0.8

type CloudBlockStorageBackupRestoreInput struct {
	VolumeID string `json:"volume_id"`
}

CloudBlockStorageBackupRestoreInput represents cloud block storage backup restore input

type CloudBlockStorageBackupUpdateInput added in v1.0.8

type CloudBlockStorageBackupUpdateInput struct {
	Labels map[string]string `json:"labels,omitempty"`
}

CloudBlockStorageBackupUpdateInput represents cloud block storage volume backup update input

type CloudBlockStorageBackupsHandler added in v1.0.8

type CloudBlockStorageBackupsHandler struct {
	// contains filtered or unexported fields
}

CloudBlockStorageBackupsHandler handles operations around cloud backups

func (*CloudBlockStorageBackupsHandler) Collection added in v1.0.8

Collection builds a new Collection[CloudBlockStorageBackup] interface

func (*CloudBlockStorageBackupsHandler) Delete added in v1.0.8

Delete a volume backup Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Backup/operation/DeleteAVolumeBackup

func (*CloudBlockStorageBackupsHandler) Get added in v1.0.8

Get a volume backup Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Backup/operation/GetAVolumeBackup

type CloudBlockStorageBackupsService added in v1.0.8

type CloudBlockStorageBackupsService interface {
	// Primary collection
	Collection() Collection[CloudBlockStorageBackup]

	// Generic operations
	Get(ctx context.Context, id string) (*CloudBlockStorageBackup, error)
	Create(ctx context.Context, input CloudBlockStorageBackupCreateInput) (*CloudBlockStorageBackup, error)
	Update(ctx context.Context, id string, input CloudBlockStorageBackupUpdateInput) (*CloudBlockStorageBackup, error)
	Delete(ctx context.Context, id string) (*CloudBlockStorageBackup, error)
	Restore(ctx context.Context, id string, input CloudBlockStorageBackupRestoreInput) (*CloudBlockStorageBackup, error)
}

CloudBlockStorageBackupsService is an interface for interfacing with Cloud Backup endpoints API documentation: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Backup

type CloudBlockStorageVolume added in v1.0.8

type CloudBlockStorageVolume struct {
	ID            string            `json:"id"`
	OpenstackUUID *string           `json:"openstack_uuid"`
	RegionID      int64             `json:"region_id"`
	Size          int               `json:"size"`
	Status        string            `json:"status"`
	Bootable      bool              `json:"bootable"`
	Labels        map[string]string `json:"labels"`
	Created       *time.Time        `json:"created_at"`
	Description   *string           `json:"description"`
	Name          string            `json:"name"`
	Attachments   []Attachment      `json:"attachments"`
}

CloudBlockStorageVolume represents cloud block storage volume

type CloudBlockStorageVolumeAttachInput added in v1.0.8

type CloudBlockStorageVolumeAttachInput struct {
	InstanceID string `json:"instance_id"`
}

CloudBlockStorageVolumeAttachInput represents cloud block storage volume attach input

type CloudBlockStorageVolumeCreateInput added in v1.0.8

type CloudBlockStorageVolumeCreateInput struct {
	Name             string            `json:"name"`
	RegionID         int               `json:"region_id"`
	Size             int               `json:"size,omitempty"`
	Description      string            `json:"description,omitempty"`
	ImageID          string            `json:"image_id,omitempty"`
	SnapshotID       string            `json:"snapshot_id,omitempty"`
	AttachInstanceID string            `json:"attach_instance_id,omitempty"`
	BackupID         string            `json:"backup_id,omitempty"`
	Labels           map[string]string `json:"labels,omitempty"`
}

CloudBlockStorageVolumeCreateInput represents cloud block storage volume create input

type CloudBlockStorageVolumeDetachInput added in v1.0.8

type CloudBlockStorageVolumeDetachInput struct {
	InstanceID string `json:"instance_id"`
}

CloudBlockStorageVolumeDetachInput represents cloud block storage volume detach input

type CloudBlockStorageVolumeUpdateInput added in v1.0.8

type CloudBlockStorageVolumeUpdateInput struct {
	Name        string            `json:"name"`
	Description string            `json:"description,omitempty"`
	ImageID     string            `json:"image_id,omitempty"`
	SnapshotID  string            `json:"snapshot_id,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
}

CloudBlockStorageVolumeUpdateInput represents cloud block storage volume update input

type CloudBlockStorageVolumesHandler added in v1.0.8

type CloudBlockStorageVolumesHandler struct {
	// contains filtered or unexported fields
}

CloudBlockStorageVolumesHandler handles operations around cloud volumes

func (*CloudBlockStorageVolumesHandler) Collection added in v1.0.8

Collection builds a new Collection[CloudBlockStorageVolume] interface

func (*CloudBlockStorageVolumesHandler) Delete added in v1.0.8

Delete a cloud volume Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Volume/operation/DeleteACloudVolume

func (*CloudBlockStorageVolumesHandler) Detach added in v1.0.8

Detach a cloud volume from a cloud instance Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Volume/operation/DetachACloudVolumeFromACloudInstance

func (*CloudBlockStorageVolumesHandler) Get added in v1.0.8

Get a cloud volume Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Volume/operation/GetACloudVolume

type CloudBlockStorageVolumesService added in v1.0.8

CloudBlockStorageVolumesService is an interface for interfacing with Cloud Volume endpoints API documentation: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Volume

type CloudComputingFlavor

type CloudComputingFlavor struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

CloudComputingFlavor represents cloud computing flavor

type CloudComputingImage

type CloudComputingImage struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

CloudComputingImage represents cloud computing image

type CloudComputingInstance

type CloudComputingInstance struct {
	Name               string            `json:"name"`
	ID                 string            `json:"id"`
	RegionID           int64             `json:"region_id"`
	RegionCode         string            `json:"region_code"`
	OpenstackUUID      string            `json:"openstack_uuid"`
	Status             string            `json:"status"`
	FlavorID           string            `json:"flavor_id"`
	FlavorName         string            `json:"flavor_name"`
	ImageID            string            `json:"image_id"`
	ImageName          *string           `json:"image_name"`
	PublicIPv4Address  *string           `json:"public_ipv4_address"`
	PrivateIPv4Address *string           `json:"private_ipv4_address"`
	PublicIPv6Address  *string           `json:"public_ipv6_address"`
	GPNEnabled         bool              `json:"gpn_enabled"`
	IPv6Enabled        bool              `json:"ipv6_enabled"`
	Labels             map[string]string `json:"labels"`
	Created            time.Time         `json:"created_at"`
	Updated            time.Time         `json:"updated_at"`
}

CloudComputingInstance represents cloud instance

type CloudComputingInstanceCreateInput

type CloudComputingInstanceCreateInput struct {
	Name              string            `json:"name"`
	RegionID          int64             `json:"region_id"`
	FlavorID          string            `json:"flavor_id"`
	ImageID           string            `json:"image_id"`
	GPNEnabled        *bool             `json:"gpn_enabled,omitempty"`
	IPv6Enabled       *bool             `json:"ipv6_enabled,omitempty"`
	SSHKeyFingerprint *string           `json:"ssh_key_fingerprint,omitempty"`
	BackupCopies      *int              `json:"backup_copies,omitempty"`
	Labels            map[string]string `json:"labels,omitempty"`
}

CloudComputingInstanceCreateInput represents cloud instance create input

type CloudComputingInstanceReinstallInput

type CloudComputingInstanceReinstallInput struct {
	ImageID string `json:"image_id"`
}

CloudComputingInstanceReinstallInput represents cloud instance reinstall input

type CloudComputingInstanceUpdateInput

type CloudComputingInstanceUpdateInput struct {
	Name         *string           `json:"name,omitempty"`
	BackupCopies *int              `json:"backup_copies,omitempty"`
	GPNEnabled   *bool             `json:"gpn_enabled,omitempty"`
	IPv6Enabled  *bool             `json:"ipv6_enabled,omitempty"`
	Labels       map[string]string `json:"labels,omitempty"`
}

CloudComputingInstanceUpdateInput represents cloud instance update input

type CloudComputingInstanceUpgradeInput

type CloudComputingInstanceUpgradeInput struct {
	FlavorID string `json:"flavor_id"`
}

CloudComputingInstanceUpgradeInput represents cloud instance upgrade input

type CloudComputingInstancesHandler

type CloudComputingInstancesHandler struct {
	// contains filtered or unexported fields
}

CloudComputingInstancesHandler handles operations around cloud instances

func (*CloudComputingInstancesHandler) Collection

Collection builds a new Collection[CloudComputingInstance] interface Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Instance/operation/ListCloudInstances

func (*CloudComputingInstancesHandler) CreatePTRRecord

func (h *CloudComputingInstancesHandler) CreatePTRRecord(ctx context.Context, cloudInstanceID string, input PTRRecordCreateInput) (*PTRRecord, error)

CreatePTRRecord creates ptr record for the cloud instance Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Instance/operation/CreateAPtrRecordForACloudInstance

func (*CloudComputingInstancesHandler) DeletePTRRecord

func (h *CloudComputingInstancesHandler) DeletePTRRecord(ctx context.Context, cloudInstanceID string, ptrRecordID string) error

DeletePTRRecord deleted ptr record for the cloud instance Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Instance/operation/DeleteAPtrRecordForACloudInstance

func (*CloudComputingInstancesHandler) PTRRecords

PTRRecords builds a new Collection[PTRRecord] interface Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Instance/operation/ListPtrRecordsForACloudInstance

type CloudComputingInstancesService

type CloudComputingInstancesService interface {
	// Primary collection
	Collection() Collection[CloudComputingInstance]

	// Generic operations
	Get(ctx context.Context, id string) (*CloudComputingInstance, error)
	Create(ctx context.Context, input CloudComputingInstanceCreateInput) (*CloudComputingInstance, error)
	Update(ctx context.Context, id string, input CloudComputingInstanceUpdateInput) (*CloudComputingInstance, error)
	Delete(ctx context.Context, id string) error

	// Additional operations
	Reinstall(ctx context.Context, id string, input CloudComputingInstanceReinstallInput) (*CloudComputingInstance, error)
	Rescue(ctx context.Context, id string) (*CloudComputingInstance, error)
	Unrescue(ctx context.Context, id string) (*CloudComputingInstance, error)
	Upgrade(ctx context.Context, id string, input CloudComputingInstanceUpgradeInput) (*CloudComputingInstance, error)
	RevertUpgrade(ctx context.Context, id string) (*CloudComputingInstance, error)
	ApproveUpgrade(ctx context.Context, id string) (*CloudComputingInstance, error)
	PowerOn(ctx context.Context, id string) (*CloudComputingInstance, error)
	PowerOff(ctx context.Context, id string) (*CloudComputingInstance, error)
	CreatePTRRecord(ctx context.Context, cloudInstanceID string, input PTRRecordCreateInput) (*PTRRecord, error)
	DeletePTRRecord(ctx context.Context, cloudInstanceID string, ptrRecordID string) error

	// Additional collections
	PTRRecords(id string) Collection[PTRRecord]
}

CloudComputingInstancesService is an interface to interfacing with the Cloud Instance endpoints API documentation: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Instance

type CloudComputingRegion

type CloudComputingRegion struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	Code string `json:"code"`
}

CloudComputingRegion represents cloud computing region

type CloudComputingRegionsHandler

type CloudComputingRegionsHandler struct {
	// contains filtered or unexported fields
}

CloudComputingRegionsHandler handles operations around cloud computing regions

func (*CloudComputingRegionsHandler) Collection

Collection builds a new Collection[CloudComputingRegion] interface

func (*CloudComputingRegionsHandler) Flavors

Flavors builds a new Collection[CloudComputingFlavor] interface

func (*CloudComputingRegionsHandler) Images

Images builds a new Collection[CloudComputingImage] interface

type CloudComputingRegionsService

type CloudComputingRegionsService interface {
	// Primary collection
	Collection() Collection[CloudComputingRegion]

	// Additional collections
	Images(regionID int64) Collection[CloudComputingImage]
	Flavors(regionID int64) Collection[CloudComputingFlavor]
}

CloudComputingRegionsService is an interface to interfacing with the cloud computing regions endpoints API documentation: https://developers.servers.com/api-documentation/v1/#tag/Cloud-Region

type Collection added in v1.0.0

type Collection[K any] interface {
	IsClean() bool

	HasPreviousPage() bool
	HasNextPage() bool
	HasFirstPage() bool
	HasLastPage() bool

	NextPage(ctx context.Context) ([]K, error)
	PreviousPage(ctx context.Context) ([]K, error)
	FirstPage(ctx context.Context) ([]K, error)
	LastPage(ctx context.Context) ([]K, error)

	Collect(ctx context.Context) ([]K, error)
	List(ctx context.Context) ([]K, error)

	SetPage(page int) Collection[K]
	SetPerPage(perPage int) Collection[K]
	SetParam(name, value string) Collection[K]

	Refresh(ctx context.Context) error
}

Collection is an interface for interfacing with the collection

type CollectionHandler added in v1.0.0

type CollectionHandler[K any] struct {
	// contains filtered or unexported fields
}

CollectionHandler handles operations around collection

func NewCollection added in v1.0.0

func NewCollection[K any](client *Client, path string) *CollectionHandler[K]

NewCollection produces a new CollectionHandler and represents this as an interface of Collection

func (*CollectionHandler[K]) Collect added in v1.0.0

func (col *CollectionHandler[K]) Collect(ctx context.Context) ([]K, error)

Collect navigates by pages until the last page is reached will be reached and returns accumulated data between pages.

This method uses NextPage.

func (*CollectionHandler[K]) FirstPage added in v1.0.0

func (col *CollectionHandler[K]) FirstPage(ctx context.Context) ([]K, error)

FirstPage navigates to the first page returns a []Network, produces an error, when a collection has no first page.

Before using this method please ensure IsClean returns false and HasFirstPage returns true. You can force to load pagination metadata by calling Refresh or List methods.

func (*CollectionHandler[K]) HasFirstPage added in v1.0.0

func (col *CollectionHandler[K]) HasFirstPage() bool

HasFirstPage returns a bool value where truth is means collection has a first page.

In case when IsClean returns true, this method will return false, which means no request(s) were made and collection doesn't have metadata to know about pagination.

First metadata will come with the first called methods such: NextPage, PreviousPage, LastPage, FirstPage, List, Refresh, Collect.

func (*CollectionHandler[K]) HasLastPage added in v1.0.0

func (col *CollectionHandler[K]) HasLastPage() bool

HasLastPage returns a bool value where truth is means collection has a last page.

In case when IsClean returns true, this method will return false, which means no request(s) were made and collection doesn't have metadata to know about pagination.

First metadata will come with the first called methods such: NextPage, PreviousPage, LastPage, FirstPage, List, Refresh, Collect.

func (*CollectionHandler[K]) HasNextPage added in v1.0.0

func (col *CollectionHandler[K]) HasNextPage() bool

HasNextPage returns a bool value where truth is means collection has a next page.

In case when IsClean returns true, this method will return false, which means no request(s) were made and collection doesn't have metadata to know about pagination.

First metadata will come with the first called methods such: NextPage, PreviousPage, LastPage, FirstPage, List, Refresh, Collect.

func (*CollectionHandler[K]) HasPreviousPage added in v1.0.0

func (col *CollectionHandler[K]) HasPreviousPage() bool

HasPreviousPage returns a bool value where truth is means collection has a previous page.

In case when IsClean returns true, this method will return false, which means no request(s) were made and collection doesn't have metadata to know about pagination.

First metadata will come with the first called methods such: NextPage, PreviousPage, LastPage, FirstPage, List, Refresh, Collect.

func (*CollectionHandler[K]) IsClean added in v1.0.0

func (col *CollectionHandler[K]) IsClean() bool

IsClean returns a bool value where true is means, this collection not used yet and doesn't contain any state.

func (*CollectionHandler[K]) LastPage added in v1.0.0

func (col *CollectionHandler[K]) LastPage(ctx context.Context) ([]K, error)

LastPage navigates to the last page returns a []Network, produces an error, when a collection has no last page.

Before using this method please ensure IsClean returns false and HasLastPage returns true. You can force to load pagination metadata by calling Refresh or List methods.

func (*CollectionHandler[K]) List added in v1.0.0

func (col *CollectionHandler[K]) List(ctx context.Context) ([]K, error)

List returns a []BandwidthOption limited by pagination.

This method performs request only once when IsClean returns false, also this request doesn't perform request when such methods were called before: NextPage, PreviousPage, LastPage, FirstPage, Refresh, Collect.

In the case when previously called method is Collect, this method returns data from the last page.

func (*CollectionHandler[K]) NextPage added in v1.0.0

func (col *CollectionHandler[K]) NextPage(ctx context.Context) ([]K, error)

NextPage navigates to the next page returns a []Network, produces an error, when a collection has no next page.

Before using this method please ensure IsClean returns false and HasNextPage returns true. You can force to load pagination metadata by calling Refresh or List methods.

func (*CollectionHandler[K]) PreviousPage added in v1.0.0

func (col *CollectionHandler[K]) PreviousPage(ctx context.Context) ([]K, error)

PreviousPage navigates to the previous page returns a []Network, produces an error, when a collection has no previous page.

Before using this method please ensure IsClean returns false and HasPreviousPage returns true. You can force to load pagination metadata by calling Refresh or List methods.

func (*CollectionHandler[K]) Refresh added in v1.0.0

func (col *CollectionHandler[K]) Refresh(ctx context.Context) error

Refresh performs the request and then updates accumulated data limited by pagination.

After calling this method accumulated data can be extracted by List method.

func (*CollectionHandler[K]) SetPage added in v1.0.0

func (col *CollectionHandler[K]) SetPage(page int) Collection[K]

SetPage sets current page param.

func (*CollectionHandler[K]) SetParam added in v1.0.0

func (col *CollectionHandler[K]) SetParam(name, value string) Collection[K]

SetParam sets param.

func (*CollectionHandler[K]) SetPerPage added in v1.0.0

func (col *CollectionHandler[K]) SetPerPage(perPage int) Collection[K]

SetPerPage sets current per page param.

type ConfigurationDetails

type ConfigurationDetails struct {
	RAMSize                 int     `json:"ram_size"`
	ServerModelID           *int64  `json:"server_model_id"`
	ServerModelName         *string `json:"server_model_name"`
	PublicUplinkID          *int64  `json:"public_uplink_id"`
	PublicUplinkName        *string `json:"public_uplink_name"`
	PrivateUplinkID         *int64  `json:"private_uplink_id"`
	PrivateUplinkName       *string `json:"private_uplink_name"`
	BandwidthID             *int64  `json:"bandwidth_id"`
	BandwidthName           *string `json:"bandwidth_name"`
	OperatingSystemID       *int64  `json:"operating_system_id"`
	OperatingSystemFullName *string `json:"operating_system_full_name"`
}

ConfigurationDetails represents host configuration details

type ConflictError

type ConflictError struct {
	StatusCode int
	ErrorCode  string
	Message    string
}

ConflictError represents an errors related to 409 response status code

func (*ConflictError) Error

func (e *ConflictError) Error() string

type DedicatedServer

type DedicatedServer struct {
	ID                   string               `json:"id"`
	Type                 string               `json:"type"`
	Title                string               `json:"title"`
	LocationID           int64                `json:"location_id"`
	LocationCode         string               `json:"location_code"`
	Status               string               `json:"status"`
	OperationalStatus    string               `json:"operational_status"`
	PowerStatus          string               `json:"power_status"`
	Configuration        string               `json:"configuration"`
	PrivateIPv4Address   *string              `json:"private_ipv4_address"`
	PublicIPv4Address    *string              `json:"public_ipv4_address"`
	ScheduledRelease     *time.Time           `json:"scheduled_release_at"`
	ConfigurationDetails ConfigurationDetails `json:"configuration_details"`
	Labels               map[string]string    `json:"labels"`
	Created              time.Time            `json:"created_at"`
	Updated              time.Time            `json:"updated_at"`
}

DedicatedServer represents dedicated server

type DedicatedServerCreateInput

type DedicatedServerCreateInput struct {
	ServerModelID      int64                            `json:"server_model_id"`
	LocationID         int64                            `json:"location_id"`
	RAMSize            int                              `json:"ram_size"`
	UplinkModels       DedicatedServerUplinkModelsInput `json:"uplink_models"`
	Drives             DedicatedServerDrivesInput       `json:"drives"`
	Features           []string                         `json:"features,omitempty"`
	IPv6               bool                             `json:"ipv6"`
	Hosts              []DedicatedServerHostInput       `json:"hosts"`
	OperatingSystemID  *int64                           `json:"operating_system_id,omitempty"`
	SSHKeyFingerprints []string                         `json:"ssh_key_fingerprints,omitempty"`
	UserData           *string                          `json:"user_data,omitempty"`
}

DedicatedServerCreateInput represents dedicated server create input, example:

driveModelID := int64(1)
osUbuntuServerID := int64(1)
rootFilesystem := "ext4"
raidLevel := 0

input := DedicatedServerCreateInput{
  ServerModelID: int64(1),
  LocationID: int64(1),
  RAMSize: 32,
  UplinkModels: DedicatedServerUplinkModelInput{
    PublicUplink &DedicatedServerPublicUplinkInput{ID: int64(1), BandwidthModelID: int64(1)},
    PrivateUplink: DedicatedServerPrivateUplinkInput{ID: int64(2)},
  },
  Drives: DedicatedServerDrivesInput{
    Slots: []DedicatedServerSlotInput{
      DedicatedServerSlotInput{Position: 0, DriveModelID: &driveModelID},
      DedicatedServerSlotInput{Position: 1, DriveModelID: &driveModelID},
    },
    Layout: []DedicatedServerLayoutInput{
      DedicatedServerLayoutInput{
        SlotPositions: []int{0, 1},
        Riad:          &raidLevel,
        Partitions:    []DedicatedServerLayoutPartitionInput{
          DedicatedServerLayoutPartitionInput{Target: "swap", Size: 4096, Fill: false},
          DedicatedServerLayoutPartitionInput{Target: "/", Fs: &rootFilesystem, Size: 100000, Fill: true},
        },
      },
    },
  },
  IPv6: true,
  OperatingSystemID: &osUbuntuServerID,
  SSHKeyFingerprints: []string{
    "48:81:0c:43:99:12:71:5e:ba:fd:e7:2f:20:d7:95:e8"
  },
  Hosts: []DedicatedServerHostInput{
	{
 	   Hostname: "example-host",
	},
  },
}

type DedicatedServerDrivesInput

type DedicatedServerDrivesInput struct {
	Slots  []DedicatedServerSlotInput   `json:"slots"`
	Layout []DedicatedServerLayoutInput `json:"layout"`
}

DedicatedServerDrivesInput represents drives for DedicatedServerCreateInput

type DedicatedServerHostInput

type DedicatedServerHostInput struct {
	Hostname             string            `json:"hostname"`
	PublicIPv4NetworkID  *string           `json:"public_ipv4_network_id,omitempty"`
	PrivateIPv4NetworkID *string           `json:"private_ipv4_network_id,omitempty"`
	Labels               map[string]string `json:"labels,omitempty"`
}

DedicatedServerHostInput represents hosts for DedicatedServerCreateInput

type DedicatedServerLayoutInput

type DedicatedServerLayoutInput struct {
	SlotPositions []int                                 `json:"slot_positions"`
	Raid          *int                                  `json:"raid,omitempty"`
	Partitions    []DedicatedServerLayoutPartitionInput `json:"partitions"`
}

DedicatedServerLayoutInput represents layout for DedicatedServerDrivesInput

type DedicatedServerLayoutPartitionInput

type DedicatedServerLayoutPartitionInput struct {
	Target string  `json:"target"`
	Size   int     `json:"size"`
	Fs     *string `json:"fs,omitempty"`
	Fill   bool    `json:"fill,omitempty"`
}

DedicatedServerLayoutPartitionInput represents partition for DedicatedServerLayoutInput

type DedicatedServerPrivateUplinkInput

type DedicatedServerPrivateUplinkInput struct {
	ID int64 `json:"id"`
}

DedicatedServerPrivateUplinkInput represents private uplink for DedicatedServerUplinkModelsInput

type DedicatedServerPublicUplinkInput

type DedicatedServerPublicUplinkInput struct {
	ID               int64 `json:"id"`
	BandwidthModelID int64 `json:"bandwidth_model_id"`
}

DedicatedServerPublicUplinkInput represents public uplink for DedicatedServerUplinkModelsInput

type DedicatedServerSlotInput

type DedicatedServerSlotInput struct {
	Position     int    `json:"position"`
	DriveModelID *int64 `json:"drive_model_id,omitempty"`
}

DedicatedServerSlotInput represents slot for DedicatedServerDrivesInput

type DedicatedServerUpdateInput added in v1.0.8

type DedicatedServerUpdateInput struct {
	Labels map[string]string `json:"labels,omitempty"`
}

DedicatedServerUpdateInput represents dedicated server update input

type DedicatedServerUplinkModelsInput

type DedicatedServerUplinkModelsInput struct {
	Public  *DedicatedServerPublicUplinkInput `json:"public,omitempty"`
	Private DedicatedServerPrivateUplinkInput `json:"private"`
}

DedicatedServerUplinkModelsInput represents uplinks for DedicatedServerCreateInput

type DriveModel

type DriveModel struct {
	ID         int64  `json:"id"`
	Name       string `json:"name"`
	Capacity   int    `json:"capacity"`
	Interface  string `json:"interface"`
	FormFactor string `json:"form_factor"`
	MediaType  string `json:"media_type"`
}

DriveModel represents drive model

type ForbiddenError

type ForbiddenError struct {
	StatusCode int
	ErrorCode  string
	Message    string
}

ForbiddenError represents an errors related to 403 response status code

func (*ForbiddenError) Error

func (e *ForbiddenError) Error() string

type Host

type Host struct {
	ID                 string     `json:"id"`
	Type               string     `json:"type"`
	Title              string     `json:"title"`
	LocationID         int64      `json:"location_id"`
	LocationCode       string     `json:"location_code"`
	Status             string     `json:"status"`
	OperationalStatus  string     `json:"operational_status"`
	PowerStatus        string     `json:"power_status"`
	Configuration      string     `json:"configuration"`
	PrivateIPv4Address *string    `json:"private_ipv4_address"`
	PublicIPv4Address  *string    `json:"public_ipv4_address"`
	ScheduledRelease   *time.Time `json:"scheduled_release_at"`
	Created            time.Time  `json:"created_at"`
	Updated            time.Time  `json:"updated_at"`
}

Host represents host

type HostConnection

type HostConnection struct {
	Port       string  `json:"port"`
	Type       string  `json:"type"`
	MACAddress *string `json:"macaddr"`
}

HostConnection represents host connection

type HostDriveSlot

type HostDriveSlot struct {
	Position   int         `json:"position"`
	Interface  string      `json:"interface"`
	FormFactor string      `json:"form_factor"`
	DriveModel *DriveModel `json:"drive_model"`
}

HostDriveSlot represents host drive slot

type HostPowerFeed

type HostPowerFeed struct {
	Name   string `json:"name"`
	Status string `json:"status"`
}

HostPowerFeed represents feed status

type HostsHandler

type HostsHandler struct {
	// contains filtered or unexported fields
}

HostsHandler handles operations around hosts

func (*HostsHandler) AbortReleaseForDedicatedServer

func (h *HostsHandler) AbortReleaseForDedicatedServer(ctx context.Context, id string) (*DedicatedServer, error)

AbortReleaseForDedicatedServer aborts scheduled release for the dedicated server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/AbortReleaseForADedicatedServer

func (*HostsHandler) Collection

func (h *HostsHandler) Collection() Collection[Host]

Collection builds a new Collection[Host] interface

func (*HostsHandler) CreateDedicatedServers

func (h *HostsHandler) CreateDedicatedServers(ctx context.Context, input DedicatedServerCreateInput) ([]DedicatedServer, error)

CreateDedicatedServers creates a dedicated servers Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/CreateADedicatedServer

func (*HostsHandler) CreatePTRRecordForDedicatedServer

func (h *HostsHandler) CreatePTRRecordForDedicatedServer(ctx context.Context, id string, input PTRRecordCreateInput) (*PTRRecord, error)

CreatePTRRecordForDedicatedServer creates ptr record for the dedicated server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/ListPtrRecordsForADedicatedServer

func (*HostsHandler) CreateSBMServers added in v1.0.4

func (h *HostsHandler) CreateSBMServers(ctx context.Context, input SBMServerCreateInput) ([]SBMServer, error)

CreateSBMServers creates an SBM servers Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Scalable-Baremetal-Server/operation/CreateAnSbmServer

func (*HostsHandler) DedicatedServerConnections

func (h *HostsHandler) DedicatedServerConnections(id string) Collection[HostConnection]

DedicatedServerConnections builds a new Collection[HostConnection] interface Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/ListConnectionsForADedicatedServer

func (*HostsHandler) DedicatedServerDriveSlots

func (h *HostsHandler) DedicatedServerDriveSlots(id string) Collection[HostDriveSlot]

DedicatedServerDriveSlots builds a new Collection[HostDriveSlot] interface Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/ListDriveSlotsForADedicatedServer

func (*HostsHandler) DedicatedServerNetworks

func (h *HostsHandler) DedicatedServerNetworks(id string) Collection[Network]

DedicatedServerNetworks builds a new Collection[Network] interface Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/ListNetworksForADedicatedServer

func (*HostsHandler) DedicatedServerPTRRecords

func (h *HostsHandler) DedicatedServerPTRRecords(id string) Collection[PTRRecord]

DedicatedServerPTRRecords builds a new Collection[PTRRecord] interface Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/ListPtrRecordsForADedicatedServer

func (*HostsHandler) DedicatedServerPowerFeeds

func (h *HostsHandler) DedicatedServerPowerFeeds(ctx context.Context, id string) ([]HostPowerFeed, error)

DedicatedServerPowerFeeds returns list of dedicated server power feeds with status Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/ListPowerFeedsForADedicatedServer

func (*HostsHandler) DeletePTRRecordForDedicatedServer

func (h *HostsHandler) DeletePTRRecordForDedicatedServer(ctx context.Context, hostID string, ptrRecordID string) error

DeletePTRRecordForDedicatedServer deleted ptr record for the dedicated server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/DeleteAPtrRecordForADedicatedServer

func (*HostsHandler) GetDedicatedServer

func (h *HostsHandler) GetDedicatedServer(ctx context.Context, id string) (*DedicatedServer, error)

GetDedicatedServer returns a dedicated server Endpoint: https://developers.servers.com/api-documentation/v1/#operation/RetrieveAnExistingDedicatedServer

func (*HostsHandler) GetKubernetesBaremetalNode added in v1.0.0

func (h *HostsHandler) GetKubernetesBaremetalNode(ctx context.Context, id string) (*KubernetesBaremetalNode, error)

GetKubernetesBaremetalNode returns a kubernetes baremetal node Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Kubernetes-Baremetal-Node/operation/GetAKubernetesBareMetalNode

func (*HostsHandler) GetSBMServer added in v1.0.4

func (h *HostsHandler) GetSBMServer(ctx context.Context, id string) (*SBMServer, error)

GetSBMServer returns an sbm server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Scalable-Baremetal-Server/operation/GetAnSbmServer

func (*HostsHandler) PowerCycleDedicatedServer

func (h *HostsHandler) PowerCycleDedicatedServer(ctx context.Context, id string) (*DedicatedServer, error)

PowerCycleDedicatedServer sends power-cycle command to the dedicated server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/PowercycleADedicatedServer

func (*HostsHandler) PowerCycleKubernetesBaremetalNode added in v1.0.8

func (h *HostsHandler) PowerCycleKubernetesBaremetalNode(ctx context.Context, id string) (*KubernetesBaremetalNode, error)

Powercycle a Kubernetes bare metal node Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Kubernetes-Baremetal-Node/operation/PowercycleAKubernetesBareMetalNode

func (*HostsHandler) PowerCycleSBMServer added in v1.0.8

func (h *HostsHandler) PowerCycleSBMServer(ctx context.Context, id string) (*SBMServer, error)

Send a power cycle command for an SBM server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Scalable-Baremetal-Server/operation/SendAPowerCycleCommandForAnSbmServer

func (*HostsHandler) PowerOffDedicatedServer

func (h *HostsHandler) PowerOffDedicatedServer(ctx context.Context, id string) (*DedicatedServer, error)

PowerOffDedicatedServer sends power-off command to the dedicated server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/PowerOffADedicatedServer

func (*HostsHandler) PowerOffKubernetesBaremetalNode added in v1.0.8

func (h *HostsHandler) PowerOffKubernetesBaremetalNode(ctx context.Context, id string) (*KubernetesBaremetalNode, error)

Power off a Kubernetes bare metal node Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Kubernetes-Baremetal-Node/operation/PowerOffAKubernetesBareMetalNode

func (*HostsHandler) PowerOffSBMServer added in v1.0.8

func (h *HostsHandler) PowerOffSBMServer(ctx context.Context, id string) (*SBMServer, error)

Send a power off command for an SBM server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Scalable-Baremetal-Server/operation/SendAPowerOffCommandForAnSbmServer

func (*HostsHandler) PowerOnDedicatedServer

func (h *HostsHandler) PowerOnDedicatedServer(ctx context.Context, id string) (*DedicatedServer, error)

PowerOnDedicatedServer sends power-on command to the dedicated server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/PowerOnADedicatedServer

func (*HostsHandler) PowerOnKubernetesBaremetalNode added in v1.0.8

func (h *HostsHandler) PowerOnKubernetesBaremetalNode(ctx context.Context, id string) (*KubernetesBaremetalNode, error)

Power on a Kubernetes bare metal node Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Kubernetes-Baremetal-Node/operation/PowerOnAKubernetesBareMetalNode

func (*HostsHandler) PowerOnSBMServer added in v1.0.8

func (h *HostsHandler) PowerOnSBMServer(ctx context.Context, id string) (*SBMServer, error)

Send a power on command for an SBM server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Scalable-Baremetal-Server/operation/SendAPowerOnCommandForAnSbmServer

func (*HostsHandler) ReinstallOperatingSystemForDedicatedServer

func (h *HostsHandler) ReinstallOperatingSystemForDedicatedServer(ctx context.Context, id string, input OperatingSystemReinstallInput) (*DedicatedServer, error)

ReinstallOperatingSystemForDedicatedServer performs operating system reinstallation Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/ReinstallOsForADedicatedServer

func (*HostsHandler) ReinstallOperatingSystemForSBMServer added in v1.0.8

func (h *HostsHandler) ReinstallOperatingSystemForSBMServer(ctx context.Context, id string, input SBMOperatingSystemReinstallInput) (*SBMServer, error)

Reinstall an OS for an SBM server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Scalable-Baremetal-Server/operation/ReinstallAnOsForAnSbmServer

func (*HostsHandler) ReleaseSBMServer added in v1.0.4

func (h *HostsHandler) ReleaseSBMServer(ctx context.Context, id string) (*SBMServer, error)

ReleaseSBMServer removes an SBM server from account. This action is irreversible and the removal process will be initiated immediately!!! Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Scalable-Baremetal-Server/operation/ReleaseAnSbmServer

func (*HostsHandler) ScheduleReleaseForDedicatedServer

func (h *HostsHandler) ScheduleReleaseForDedicatedServer(ctx context.Context, id string) (*DedicatedServer, error)

ScheduleReleaseForDedicatedServer schedules release for for the dedicated server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/ScheduleReleaseForADedicatedServer

func (*HostsHandler) UpdateSBMServer added in v1.0.8

func (h *HostsHandler) UpdateSBMServer(ctx context.Context, id string, input SBMServerUpdateInput) (*SBMServer, error)

UpdateSBMServer updates an SBM server Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Scalable-Baremetal-Server/operation/UpdateAnSbmServer

type HostsService

type HostsService interface {
	// Primary collection
	Collection() Collection[Host]

	// Generic operations
	// dedicated
	CreateDedicatedServers(ctx context.Context, input DedicatedServerCreateInput) ([]DedicatedServer, error)
	GetDedicatedServer(ctx context.Context, id string) (*DedicatedServer, error)
	UpdateDedicatedServer(ctx context.Context, id string, input DedicatedServerUpdateInput) (*DedicatedServer, error)

	// kubernetes
	GetKubernetesBaremetalNode(ctx context.Context, id string) (*KubernetesBaremetalNode, error)
	UpdateKubernetesBaremetalNode(ctx context.Context, id string, input KubernetesBaremetalNodeUpdateInput) (*KubernetesBaremetalNode, error)

	// sbm
	CreateSBMServers(ctx context.Context, input SBMServerCreateInput) ([]SBMServer, error)
	GetSBMServer(ctx context.Context, id string) (*SBMServer, error)
	UpdateSBMServer(ctx context.Context, id string, input SBMServerUpdateInput) (*SBMServer, error)
	ReleaseSBMServer(ctx context.Context, id string) (*SBMServer, error)

	// Additional operations
	// dedicated
	ScheduleReleaseForDedicatedServer(ctx context.Context, id string) (*DedicatedServer, error)
	AbortReleaseForDedicatedServer(ctx context.Context, id string) (*DedicatedServer, error)
	PowerOnDedicatedServer(ctx context.Context, id string) (*DedicatedServer, error)
	PowerOffDedicatedServer(ctx context.Context, id string) (*DedicatedServer, error)
	PowerCycleDedicatedServer(ctx context.Context, id string) (*DedicatedServer, error)
	CreatePTRRecordForDedicatedServer(ctx context.Context, id string, input PTRRecordCreateInput) (*PTRRecord, error)
	DeletePTRRecordForDedicatedServer(ctx context.Context, hostID string, ptrRecordID string) error
	ReinstallOperatingSystemForDedicatedServer(ctx context.Context, id string, input OperatingSystemReinstallInput) (*DedicatedServer, error)

	// sbm
	PowerOnSBMServer(ctx context.Context, id string) (*SBMServer, error)
	PowerOffSBMServer(ctx context.Context, id string) (*SBMServer, error)
	PowerCycleSBMServer(ctx context.Context, id string) (*SBMServer, error)
	ReinstallOperatingSystemForSBMServer(ctx context.Context, id string, input SBMOperatingSystemReinstallInput) (*SBMServer, error)

	// kubernetes
	PowerOnKubernetesBaremetalNode(ctx context.Context, id string) (*KubernetesBaremetalNode, error)
	PowerOffKubernetesBaremetalNode(ctx context.Context, id string) (*KubernetesBaremetalNode, error)
	PowerCycleKubernetesBaremetalNode(ctx context.Context, id string) (*KubernetesBaremetalNode, error)

	// Additional collections
	DedicatedServerPowerFeeds(ctx context.Context, id string) ([]HostPowerFeed, error)
	DedicatedServerConnections(id string) Collection[HostConnection]
	DedicatedServerNetworks(id string) Collection[Network]
	DedicatedServerDriveSlots(id string) Collection[HostDriveSlot]
	DedicatedServerPTRRecords(id string) Collection[PTRRecord]
}

HostsService is an interface for interfacing with Host, Dedicated Server endpoints API documentation: https://developers.servers.com/api-documentation/v1/#tag/Host https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server https://developers.servers.com/api-documentation/v1/#tag/Kubernetes-Baremetal-Node https://developers.servers.com/api-documentation/v1/#tag/Scalable-Baremetal-Server

type InternalServerError

type InternalServerError struct {
	StatusCode int
	ErrorCode  string
	Message    string
}

InternalServerError represents an errors related to 500 response status code

func (*InternalServerError) Error

func (e *InternalServerError) Error() string

type KubernetesBaremetalNode added in v1.0.0

type KubernetesBaremetalNode struct {
	ID                   string               `json:"id"`
	Type                 string               `json:"type"`
	Title                string               `json:"title"`
	LocationID           int64                `json:"location_id"`
	LocationCode         string               `json:"location_code"`
	Status               string               `json:"status"`
	OperationalStatus    string               `json:"operational_status"`
	PowerStatus          string               `json:"power_status"`
	Configuration        string               `json:"configuration"`
	PrivateIPv4Address   *string              `json:"private_ipv4_address"`
	PublicIPv4Address    *string              `json:"public_ipv4_address"`
	ScheduledRelease     *time.Time           `json:"scheduled_release_at"`
	ConfigurationDetails ConfigurationDetails `json:"configuration_details"`
	Labels               map[string]string    `json:"labels"`
	Created              time.Time            `json:"created_at"`
	Updated              time.Time            `json:"updated_at"`
}

KubernetesBaremetalNode represents kubernetes baremetal node

type KubernetesBaremetalNodeUpdateInput added in v1.0.8

type KubernetesBaremetalNodeUpdateInput struct {
	Labels map[string]string `json:"labels,omitempty"`
}

KubernetesBaremetalNodeUpdateInput represents kubernetes baremetal node update input

type KubernetesCluster added in v1.0.8

type KubernetesCluster struct {
	ID         string            `json:"id"`
	Name       string            `json:"name"`
	Status     string            `json:"status"`
	LocationID int64             `json:"location_id"`
	Labels     map[string]string `json:"labels"`
	Created    time.Time         `json:"created_at"`
	Updated    time.Time         `json:"updated_at"`
}

KubernetesCluster represents Kubernetes cluster

type KubernetesClusterNode added in v1.0.8

type KubernetesClusterNode struct {
	ID                 string            `json:"id"`
	Number             int64             `json:"number"`
	Hostname           string            `json:"hostname"`
	Configuration      string            `json:"configuration"`
	Type               string            `json:"type"`
	Role               string            `json:"role"`
	Status             string            `json:"status"`
	PrivateIPv4Address string            `json:"private_ipv4_address"`
	PublicIPv4Address  string            `json:"public_ipv4_address"`
	RefID              string            `json:"ref_id"`
	ClusterID          string            `json:"cluster_id"`
	Labels             map[string]string `json:"labels"`
	Created            time.Time         `json:"created_at"`
	Updated            time.Time         `json:"updated_at"`
}

type KubernetesClusterUpdateInput added in v1.0.8

type KubernetesClusterUpdateInput struct {
	Labels map[string]string `json:"labels,omitempty"`
}

KubernetesClusterUpdateInput represents Kubernetes cluster update input

type KubernetesClustersHandler added in v1.0.8

type KubernetesClustersHandler struct {
	// contains filtered or unexported fields
}

KubernetesClustersHandler handles operations around kubernetes clusters

func (*KubernetesClustersHandler) Collection added in v1.0.8

Collection builds a new Collection[KubernetesCluster] interface Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Kubernetes-Cluster/operation/ListKubernetesClusters

func (*KubernetesClustersHandler) Get added in v1.0.8

Get a Kubernetes cluster Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Kubernetes-Cluster/operation/GetAKubernetesCluster

func (*KubernetesClustersHandler) GetNode added in v1.0.8

func (h *KubernetesClustersHandler) GetNode(ctx context.Context, clusterID string, nodeID string) (*KubernetesClusterNode, error)

Get a node for a Kubernetes cluster Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Kubernetes-Cluster/operation/GetANodeForAKubernetesCluster

func (*KubernetesClustersHandler) Nodes added in v1.0.8

Nodes builds a new Collection[KubernetesClusterNode] interface Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Kubernetes-Cluster/operation/ListNodesForAKubernetesCluster

type KubernetesClustersService added in v1.0.8

type KubernetesClustersService interface {
	// Primary collection
	Collection() Collection[KubernetesCluster]

	// Generic operations
	Get(ctx context.Context, id string) (*KubernetesCluster, error)
	GetNode(ctx context.Context, clusterID string, nodeID string) (*KubernetesClusterNode, error)
	Update(ctx context.Context, id string, input KubernetesClusterUpdateInput) (*KubernetesCluster, error)

	// Additional collections
	Nodes(id string) Collection[KubernetesClusterNode]
}

KubernetesClustersService is an interface for interfacing with Kubernetes Cluster endpoints API documentation: https://developers.servers.com/api-documentation/v1/#tag/Kubernetes-Cluster

type L2LocationGroup

type L2LocationGroup struct {
	ID          int64   `json:"id"`
	Name        string  `json:"name"`
	Code        string  `json:"code"`
	GroupType   string  `json:"group_type"`
	LocationIDs []int64 `json:"location_ids"`
}

L2LocationGroup represents l2 location groups

type L2Member

type L2Member struct {
	ID      string            `json:"id"`
	Title   string            `json:"title"`
	Mode    string            `json:"mode"`
	Vlan    *int              `json:"vlan"`
	Status  string            `json:"status"`
	Labels  map[string]string `json:"labels"`
	Created time.Time         `json:"created_at"`
	Updated time.Time         `json:"updated_at"`
}

L2Member respresents l2 segment member

type L2Segment

type L2Segment struct {
	ID                string            `json:"id"`
	Name              string            `json:"name"`
	Type              string            `json:"type"`
	Status            string            `json:"status"`
	LocationGroupID   int64             `json:"location_group_id"`
	LocationGroupCode string            `json:"location_group_code"`
	Labels            map[string]string `json:"labels"`
	Created           time.Time         `json:"created_at"`
	Updated           time.Time         `json:"updated_at"`
}

L2Segment represents l2 segment

type L2SegmentChangeNetworksInput

type L2SegmentChangeNetworksInput struct {
	Create []L2SegmentCreateNetworksInput `json:"create,omitempty"`
	Delete []string                       `json:"delete,omitempty"`
}

L2SegmentChangeNetworksInput represents input to change networks

type L2SegmentCreateInput

type L2SegmentCreateInput struct {
	Name            *string                `json:"name,omitempty"`
	Type            string                 `json:"type"`
	LocationGroupID int64                  `json:"location_group_id"`
	Members         []L2SegmentMemberInput `json:"members"`
	Labels          map[string]string      `json:"labels,omitempty"`
}

L2SegmentCreateInput represents l2 segment create input

type L2SegmentCreateNetworksInput

type L2SegmentCreateNetworksInput struct {
	Mask               int    `json:"mask"`
	DistributionMethod string `json:"distribution_method"`
}

L2SegmentCreateNetworksInput represents input to create networks for L2SegmentChangeNetworksInput

type L2SegmentMemberInput

type L2SegmentMemberInput struct {
	ID   string `json:"id"`
	Mode string `json:"mode"`
}

L2SegmentMemberInput represents l2 segment member input for L2SegmentCreateInput and L2SegmentUpdateInput

type L2SegmentUpdateInput

type L2SegmentUpdateInput struct {
	Name    *string                `json:"name,omitempty"`
	Members []L2SegmentMemberInput `json:"members,omitempty"`
	Labels  map[string]string      `json:"labels,omitempty"`
}

L2SegmentUpdateInput represents l2 segment update input

type L2SegmentsHandler

type L2SegmentsHandler struct {
	// contains filtered or unexported fields
}

L2SegmentsHandler handles operatings around l2 segments

func (*L2SegmentsHandler) ChangeNetworks

func (h *L2SegmentsHandler) ChangeNetworks(ctx context.Context, segmentID string, input L2SegmentChangeNetworksInput) (*L2Segment, error)

ChangeNetworks changes networks set Endpoint: https://developers.servers.com/api-documentation/v1/#operation/UpdateAnExistingL2SegmentNetworks

func (*L2SegmentsHandler) Collection

func (h *L2SegmentsHandler) Collection() Collection[L2Segment]

Collection builds a new Collection[L2Segment] interface

func (*L2SegmentsHandler) Delete

func (h *L2SegmentsHandler) Delete(ctx context.Context, segmentID string) error

Delete l2 segment Endpoint: https://developers.servers.com/api-documentation/v1/#operation/DeleteAnExistingL2Segment

func (*L2SegmentsHandler) LocationGroups

func (h *L2SegmentsHandler) LocationGroups() Collection[L2LocationGroup]

LocationGroups builds a new Collection[L2LocationGroup] interface

func (*L2SegmentsHandler) Members

func (h *L2SegmentsHandler) Members(segmentID string) Collection[L2Member]

Members builds a new Collection[L2Member] interface

func (*L2SegmentsHandler) Networks

func (h *L2SegmentsHandler) Networks(segmentID string) Collection[Network]

Networks builds a new L2NetworksCollection interface

type L2SegmentsService

type L2SegmentsService interface {
	// Primary collection
	Collection() Collection[L2Segment]

	// Extra collections
	LocationGroups() Collection[L2LocationGroup]

	// Generic operations
	Get(ctx context.Context, segmentID string) (*L2Segment, error)
	Create(ctx context.Context, input L2SegmentCreateInput) (*L2Segment, error)
	Update(ctx context.Context, segmentID string, input L2SegmentUpdateInput) (*L2Segment, error)
	Delete(ctx context.Context, segmentID string) error

	// Additional operations
	ChangeNetworks(ctx context.Context, segmentID string, input L2SegmentChangeNetworksInput) (*L2Segment, error)

	// Additional collections
	Members(segmentID string) Collection[L2Member]
	Networks(segmentID string) Collection[Network]
}

L2SegmentsService is an interface for interfacing with Host, Dedicated Server endpoints API documentation: https://developers.servers.com/api-documentation/v1/#tag/L2-Segment

type L4LoadBalancer added in v1.0.0

type L4LoadBalancer struct {
	ID                string            `json:"id"`
	Name              string            `json:"name"`
	Type              string            `json:"type"`
	Status            string            `json:"status"`
	ExternalAddresses []string          `json:"external_addresses"`
	LocationID        int64             `json:"location_id"`
	StoreLogs         bool              `json:"store_logs"`
	ClusterID         *string           `json:"cluster_id"`
	Labels            map[string]string `json:"labels"`
	Created           time.Time         `json:"created_at"`
	Updated           time.Time         `json:"updated_at"`
}

L4LoadBalancer represents l4 load balancer

type L4LoadBalancerCreateInput added in v1.0.0

type L4LoadBalancerCreateInput struct {
	Name          string                `json:"name"`
	LocationID    int64                 `json:"location_id"`
	StoreLogs     *bool                 `json:"store_logs,omitempty"`
	ClusterID     *string               `json:"cluster_id,omitempty"`
	VHostZones    []L4VHostZoneInput    `json:"vhost_zones"`
	UpstreamZones []L4UpstreamZoneInput `json:"upstream_zones"`
	Labels        map[string]string     `json:"labels,omitempty"`
}

L4LoadBalancerUpdateInput represents l4 load balancer create input

type L4LoadBalancerUpdateInput added in v1.0.0

type L4LoadBalancerUpdateInput struct {
	Name          *string               `json:"name,omitempty"`
	StoreLogs     *bool                 `json:"store_logs,omitempty"`
	ClusterID     *string               `json:"cluster_id,omitempty"`
	SharedCluster *bool                 `json:"shared_cluster,omitempty"`
	VHostZones    []L4VHostZoneInput    `json:"vhost_zones,omitempty"`
	UpstreamZones []L4UpstreamZoneInput `json:"upstream_zones,omitempty"`
	Labels        map[string]string     `json:"labels,omitempty"`
}

L4LoadBalancerUpdateInput represents l4 load balancer update input

type L4UpstreamInput added in v1.0.0

type L4UpstreamInput struct {
	IP     string `json:"ip"`
	Port   int32  `json:"port"`
	Weight int32  `json:"weight"`
}

L4UpstreamInput represents l4 upstream input

type L4UpstreamZoneInput added in v1.0.0

type L4UpstreamZoneInput struct {
	ID         string            `json:"id"`
	Method     *string           `json:"method,omitempty"`
	UDP        bool              `json:"udp"`
	HCInterval *int              `json:"hc_interval,omitempty"`
	HCJitter   *int              `json:"hc_jitter,omitempty"`
	Upstreams  []L4UpstreamInput `json:"upstreams"`
}

L4UpstreamZoneInput represents l4 upstream zone input

type L4VHostZoneInput added in v1.0.0

type L4VHostZoneInput struct {
	ID            string  `json:"id"`
	UDP           bool    `json:"udp"`
	ProxyProtocol bool    `json:"proxy_protocol"`
	Ports         []int32 `json:"ports"`
	Description   *string `json:"description"`
	UpstreamID    string  `json:"upstream_id"`
}

L4VHostZoneInput represents l4 vhost zone input

type L7LoadBalancer added in v1.0.2

type L7LoadBalancer struct {
	ID                string            `json:"id"`
	Name              string            `json:"name"`
	Type              string            `json:"type"`
	Domains           []string          `json:"domains"`
	Status            string            `json:"status"`
	ExternalAddresses []string          `json:"external_addresses"`
	LocationID        int64             `json:"location_id"`
	Geoip             bool              `json:"geoip"`
	StoreLogs         bool              `json:"store_logs"`
	StoreLogsRegionID int64             `json:"store_logs_region_id"`
	ClusterID         *string           `json:"cluster_id"`
	Labels            map[string]string `json:"labels"`
	Created           time.Time         `json:"created_at"`
	Updated           time.Time         `json:"updated_at"`
}

L7LoadBalancer represents l7 load balancer

type L7LoadBalancerCreateInput added in v1.0.2

type L7LoadBalancerCreateInput struct {
	Name              string                `json:"name"`
	LocationID        int64                 `json:"location_id"`
	StoreLogs         *bool                 `json:"store_logs,omitempty"`
	StoreLogsRegionID *int                  `json:"store_logs_region_id,,omitempty"`
	Geoip             *bool                 `json:"geoip,omitempty"`
	ClusterID         *string               `json:"cluster_id,omitempty"`
	VHostZones        []L7VHostZoneInput    `json:"vhost_zones"`
	UpstreamZones     []L7UpstreamZoneInput `json:"upstream_zones"`
	Labels            map[string]string     `json:"labels,omitempty"`
}

L7LoadBalancerUpdateInput represents l7 load balancer create input

type L7LoadBalancerUpdateInput added in v1.0.2

type L7LoadBalancerUpdateInput struct {
	Name                string                `json:"name,omitempty"`
	StoreLogs           *bool                 `json:"store_logs,omitempty"`
	StoreLogsRegionID   *int                  `json:"store_logs_region_id,,omitempty"`
	Geoip               *bool                 `json:"geoip,omitempty"`
	NewExternalIpsCount *int                  `json:"new_external_ips_count,omitempty"`
	DeleteExternalIps   []string              `json:"delete_external_ips,omitempty"`
	ClusterID           *string               `json:"cluster_id,omitempty"`
	SharedCluster       *bool                 `json:"shared_cluster,omitempty"`
	VHostZones          []L7VHostZoneInput    `json:"vhost_zones,omitempty"`
	UpstreamZones       []L7UpstreamZoneInput `json:"upstream_zones,omitempty"`
	Labels              map[string]string     `json:"labels,omitempty"`
}

L7LoadBalancerUpdateInput represents l7 load balancer update input

type L7LocationZoneInput added in v1.0.2

type L7LocationZoneInput struct {
	Location     string `json:"location"`
	UpstreamID   string `json:"upstream_id"`
	UpstreamPath string `json:"upstream_path"`
}

L7LocationZoneInput represents l7 location zone input

type L7UpstreamInput added in v1.0.2

type L7UpstreamInput struct {
	IP          string `json:"ip"`
	Port        int32  `json:"port"`
	Weight      int32  `json:"weight,omitempty"`
	MaxConns    int32  `json:"max_conns,omitempty"`
	MaxFails    int32  `json:"max_fails,omitempty"`
	FailTimeout int32  `json:"fail_timeout,omitempty"`
}

L7UpstreamInput represents l7 upstream input

type L7UpstreamZoneInput added in v1.0.2

type L7UpstreamZoneInput struct {
	ID            string            `json:"id"`
	Method        *string           `json:"method,omitempty"`
	SSL           bool              `json:"ssl"`
	Sticky        bool              `json:"sticky"`
	HCInterval    *int              `json:"hc_interval,omitempty"`
	HCJitter      *int              `json:"hc_jitter,omitempty"`
	HCFails       *int              `json:"hc_fails,omitempty"`
	HCPasses      *int              `json:"hc_passes,omitempty"`
	HCDomain      *string           `json:"hc_domain,omitempty"`
	HCPath        *string           `json:"hc_path,omitempty"`
	HCMethod      *string           `json:"hc_method,omitempty"`
	HCMandatory   bool              `json:"hc_mandatory,omitempty"`
	HCStatus      *string           `json:"hc_status,omitempty"`
	TLSPreset     *string           `json:"tls_preset,omitempty"`
	GRPC          bool              `json:"grpc,omitempty"`
	HCGRPCService *string           `json:"hc_grpc_service,omitempty"`
	HCGRPCStatus  *int              `json:"hc_grpc_status,omitempty"`
	Upstreams     []L7UpstreamInput `json:"upstreams"`
}

L7UpstreamZoneInput represents l7 upstream zone input

type L7VHostZoneInput added in v1.0.2

type L7VHostZoneInput struct {
	ID                  string                `json:"id"`
	Ports               []int32               `json:"ports"`
	SSL                 bool                  `json:"ssl"`
	HTTP2               bool                  `json:"http2"`
	HTTPToHttpsRedirect bool                  `json:"http_to_https_redirect"`
	HTTP2PushPreload    bool                  `json:"http2_push_preload"`
	Domains             []string              `json:"domains"`
	SSLCertID           string                `json:"ssl_certificate_id"`
	LocationZones       []L7LocationZoneInput `json:"location_zones"`
}

L7VHostZoneInput represents l7 vhost zone input

type LoadBalancer added in v1.0.0

type LoadBalancer struct {
	ID                string            `json:"id"`
	Name              string            `json:"name"`
	Type              string            `json:"type"`
	Status            string            `json:"status"`
	ExternalAddresses []string          `json:"external_addresses"`
	LocationID        int64             `json:"location_id"`
	ClusterID         *string           `json:"cluster_id"`
	Labels            map[string]string `json:"labels"`
	Created           time.Time         `json:"created_at"`
	Updated           time.Time         `json:"updated_at"`
}

LoadBalancer represents load balancer

type LoadBalancerCluster added in v1.0.6

type LoadBalancerCluster struct {
	ID         string    `json:"id"`
	Name       string    `json:"name"`
	LocationID int64     `json:"location_id"`
	Status     string    `json:"status"`
	Created    time.Time `json:"created_at"`
	Updated    time.Time `json:"updated_at"`
}

LoadBalancerCluster represents load balancer cluster

type LoadBalancerClustersHandler added in v1.0.6

type LoadBalancerClustersHandler struct {
	// contains filtered or unexported fields
}

LoadBalancersHandler handles operations around hosts

func (*LoadBalancerClustersHandler) Collection added in v1.0.6

Collection builds a new Collection[LoadBalancer] interface

func (*LoadBalancerClustersHandler) GetLoadBalancerCluster added in v1.0.6

func (h *LoadBalancerClustersHandler) GetLoadBalancerCluster(ctx context.Context, id string) (*LoadBalancerCluster, error)

GetLoadBalancerCluster returns a load balancer cluster

type LoadBalancerClustersService added in v1.0.6

type LoadBalancerClustersService interface {
	// Primary collection
	Collection() Collection[LoadBalancerCluster]

	// Generic operations
	GetLoadBalancerCluster(ctx context.Context, id string) (*LoadBalancerCluster, error)
}

LoadBalancersService is an interface for interfacing with Load balancers endpoints

type LoadBalancersHandler added in v1.0.0

type LoadBalancersHandler struct {
	// contains filtered or unexported fields
}

LoadBalancersHandler handles operations around hosts

func (*LoadBalancersHandler) Collection added in v1.0.0

func (h *LoadBalancersHandler) Collection() Collection[LoadBalancer]

Collection builds a new Collection[LoadBalancer] interface

func (*LoadBalancersHandler) CreateL4LoadBalancer added in v1.0.0

func (h *LoadBalancersHandler) CreateL4LoadBalancer(ctx context.Context, input L4LoadBalancerCreateInput) (*L4LoadBalancer, error)

CreateL4LoadBalancer creates a l4 load balancer Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Load-Balancer/operation/CreateANewL4LoadBalancer

func (*LoadBalancersHandler) CreateL7LoadBalancer added in v1.0.2

func (h *LoadBalancersHandler) CreateL7LoadBalancer(ctx context.Context, input L7LoadBalancerCreateInput) (*L7LoadBalancer, error)

CreateL7LoadBalancer creates a l7 load balancer Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Load-Balancer/operation/CreateANewL7LoadBalancer

func (*LoadBalancersHandler) DeleteL4LoadBalancer added in v1.0.0

func (h *LoadBalancersHandler) DeleteL4LoadBalancer(ctx context.Context, id string) error

DeleteL4LoadBalancer deletes l4 load balancer Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Load-Balancer/operation/DeleteAnExistingL4LoadBalancer

func (*LoadBalancersHandler) DeleteL7LoadBalancer added in v1.0.2

func (h *LoadBalancersHandler) DeleteL7LoadBalancer(ctx context.Context, id string) error

DeleteL7LoadBalancer deletes l7 load balancer Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Load-Balancer/operation/DeleteAnExistingL7LoadBalancer

func (*LoadBalancersHandler) GetL4LoadBalancer added in v1.0.0

func (h *LoadBalancersHandler) GetL4LoadBalancer(ctx context.Context, id string) (*L4LoadBalancer, error)

GetL4LoadBalancer returns a l4 load balancer Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Load-Balancer/operation/RetrieveAnExisitingL4LoadBalancer

func (*LoadBalancersHandler) GetL7LoadBalancer added in v1.0.2

func (h *LoadBalancersHandler) GetL7LoadBalancer(ctx context.Context, id string) (*L7LoadBalancer, error)

GetL7LoadBalancer returns a l7 load balancer Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Load-Balancer/operation/RetrieveAnExistingL7LoadBalancer

func (*LoadBalancersHandler) UpdateL4LoadBalancer added in v1.0.0

func (h *LoadBalancersHandler) UpdateL4LoadBalancer(ctx context.Context, id string, input L4LoadBalancerUpdateInput) (*L4LoadBalancer, error)

UpdateL4LoadBalancer updates l4 load balancer Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Load-Balancer/operation/UpdateAnExisitingL4LoadBalancer

func (*LoadBalancersHandler) UpdateL7LoadBalancer added in v1.0.2

func (h *LoadBalancersHandler) UpdateL7LoadBalancer(ctx context.Context, id string, input L7LoadBalancerUpdateInput) (*L7LoadBalancer, error)

UpdateL7LoadBalancer updates l7 load balancer Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Load-Balancer/operation/UpdateAnExistingL7LoadBalancer

type LoadBalancersService added in v1.0.0

type LoadBalancersService interface {
	// Primary collection
	Collection() Collection[LoadBalancer]

	// Generic operations
	GetL4LoadBalancer(ctx context.Context, id string) (*L4LoadBalancer, error)
	CreateL4LoadBalancer(ctx context.Context, input L4LoadBalancerCreateInput) (*L4LoadBalancer, error)
	UpdateL4LoadBalancer(ctx context.Context, id string, input L4LoadBalancerUpdateInput) (*L4LoadBalancer, error)
	DeleteL4LoadBalancer(ctx context.Context, id string) error
	GetL7LoadBalancer(ctx context.Context, id string) (*L7LoadBalancer, error)
	CreateL7LoadBalancer(ctx context.Context, input L7LoadBalancerCreateInput) (*L7LoadBalancer, error)
	UpdateL7LoadBalancer(ctx context.Context, id string, input L7LoadBalancerUpdateInput) (*L7LoadBalancer, error)
	DeleteL7LoadBalancer(ctx context.Context, id string) error
}

LoadBalancersService is an interface for interfacing with Load balancers endpoints API documentation: https://developers.servers.com/api-documentation/v1/#tag/LoadBalancers

type Location

type Location struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	Code string `json:"code"`
}

Location represents location

type LocationsHandler

type LocationsHandler struct {
	// contains filtered or unexported fields
}

LocationsHandler handles operations around cloud instances

func (*LocationsHandler) BandwidthOptions

func (h *LocationsHandler) BandwidthOptions(LocationID, ServerModelID, uplinkID int64) Collection[BandwidthOption]

BandwidthOptions builds a new Collection[BandwidthOption] interface

func (*LocationsHandler) Collection

func (h *LocationsHandler) Collection() Collection[Location]

Collection builds a new LocationsCollection interface

func (*LocationsHandler) DriveModelOptions

func (h *LocationsHandler) DriveModelOptions(LocationID, ServerModelID int64) Collection[DriveModel]

DriveModelOptions builds a new Collection[DriveModel] interface

func (*LocationsHandler) OperatingSystemOptions

func (h *LocationsHandler) OperatingSystemOptions(LocationID, ServerModelID int64) Collection[OperatingSystemOption]

OperatingSystemOptions builds a new Collection[OperatingSystemOption] interface

func (*LocationsHandler) RAMOptions

func (h *LocationsHandler) RAMOptions(LocationID, ServerModelID int64) Collection[RAMOption]

RAMOptions builds a new Collection[RAMOption] interface

func (*LocationsHandler) SBMFlavorOptions added in v1.0.4

func (h *LocationsHandler) SBMFlavorOptions(LocationID int64) Collection[SBMFlavor]

SBMFlavorOptions builds a new Collection[SBMFlavor] interface

func (*LocationsHandler) SBMOperatingSystemOptions added in v1.0.4

func (h *LocationsHandler) SBMOperatingSystemOptions(LocationID, SBMFlavorModelID int64) Collection[OperatingSystemOption]

SBMOperatingSystemOptions builds a new Collection[OperatingSystemOption] interface

func (*LocationsHandler) ServerModelOptions

func (h *LocationsHandler) ServerModelOptions(LocationID int64) Collection[ServerModelOption]

ServerModelOptions builds a new Collection[ServerModelOption interface

func (*LocationsHandler) UplinkOptions

func (h *LocationsHandler) UplinkOptions(LocationID, ServerModelID int64) Collection[UplinkOption]

UplinkOptions builds a new Collection[UplinkOption] interface

type LocationsService

type LocationsService interface {
	// Primary collection
	Collection() Collection[Location]

	// Generic operations
	ServerModelOptions(LocationID int64) Collection[ServerModelOption]
	RAMOptions(LocationID, ServerModelID int64) Collection[RAMOption]
	OperatingSystemOptions(LocationID, ServerModelID int64) Collection[OperatingSystemOption]
	DriveModelOptions(LocationID, ServerModelID int64) Collection[DriveModel]
	UplinkOptions(LocationID, ServerModelID int64) Collection[UplinkOption]
	BandwidthOptions(LocationID, ServerModelID, uplinkID int64) Collection[BandwidthOption]
	SBMFlavorOptions(LocationID int64) Collection[SBMFlavor]
	SBMOperatingSystemOptions(LocationID, sbmFlavorModelID int64) Collection[OperatingSystemOption]
}

LocationsService is an interface to interfacing with the Location and Order options endpoints API documentation: https://developers.servers.com/api-documentation/v1/#tag/Location https://developers.servers.com/api-documentation/v1/#tag/Server-Model-Option https://developers.servers.com/api-documentation/v1/#tag/Drive-Model-Option https://developers.servers.com/api-documentation/v1/#tag/Ram-Option https://developers.servers.com/api-documentation/v1/#tag/Operating-System-Option https://developers.servers.com/api-documentation/v1/#tag/Uplink-Model-Option https://developers.servers.com/api-documentation/v1/#tag/Bandwidth-Option

type Network

type Network struct {
	ID                 string    `json:"id"`
	Title              *string   `json:"title,omitempty"`
	Status             string    `json:"status"`
	Cidr               *string   `json:"cidr,omitempty"`
	Family             string    `json:"family"`
	InterfaceType      string    `json:"interface_type"`
	DistributionMethod string    `json:"distribution_method"`
	Additional         bool      `json:"additional"`
	Created            time.Time `json:"created_at"`
	Updated            time.Time `json:"updated_at"`

	// DEPRECATED: should be replaced by Statu
	State string `json:"state"`
}

Network represents network

type NetworkPool

type NetworkPool struct {
	ID          string            `json:"id"`
	Title       *string           `json:"title"`
	CIDR        string            `json:"cidr"`
	Type        string            `json:"type"`
	LocationIDs []int             `json:"location_ids"`
	Labels      map[string]string `json:"labels"`
	Created     time.Time         `json:"created_at"`
	Updated     time.Time         `json:"updated_at"`
}

NetworkPool represents network pool

type NetworkPoolInput

type NetworkPoolInput struct {
	Title  *string           `json:"title"`
	Labels map[string]string `json:"labels,omitempty"`
}

NetworkPoolInput represents network pool input

type NetworkPoolsHandler

type NetworkPoolsHandler struct {
	// contains filtered or unexported fields
}

NetworkPoolsHandler handles operations around network pools

func (*NetworkPoolsHandler) Collection

func (h *NetworkPoolsHandler) Collection() Collection[NetworkPool]

Collection builds a new Collection[NetworkPool] interface

func (*NetworkPoolsHandler) CreateSubnetwork

func (h *NetworkPoolsHandler) CreateSubnetwork(ctx context.Context, networkPoolID string, input SubnetworkCreateInput) (*Subnetwork, error)

CreateSubnetwork returns created subnetwork from the pool Endpoint: https://developers.servers.com/api-documentation/v1/#operation/CreateOrAllocateSubnetworkFromTheNetworkPool

func (*NetworkPoolsHandler) DeleteSubnetwork

func (h *NetworkPoolsHandler) DeleteSubnetwork(ctx context.Context, networkPoolID, subnetworkID string) error

DeleteSubnetwork delete subnetwork Endpoint: https://developers.servers.com/api-documentation/v1/#operation/DeleteAnExistingSubnetwork

func (*NetworkPoolsHandler) Get

Get returns a network pool Endpoint: https://developers.servers.com/api-documentation/v1/#operation/RetrieveAnExistingNetworkPool

func (*NetworkPoolsHandler) GetSubnetwork

func (h *NetworkPoolsHandler) GetSubnetwork(ctx context.Context, networkPoolID, subnetworkID string) (*Subnetwork, error)

GetSubnetwork returns subnetwork from the pool Endpoint: https://developers.servers.com/api-documentation/v1/#operation/RetrieveAnExistingSubnetwork

func (*NetworkPoolsHandler) Subnetworks

func (h *NetworkPoolsHandler) Subnetworks(networkPoolID string) Collection[Subnetwork]

Subnetworks builds a new Collection[Subnetwork] interface

func (*NetworkPoolsHandler) Update

Update returns updated network pool Endpoint: https://developers.servers.com/api-documentation/v1/#operation/UpdateAnExistingNetworkPool

func (*NetworkPoolsHandler) UpdateSubnetwork

func (h *NetworkPoolsHandler) UpdateSubnetwork(ctx context.Context, networkPoolID, subnetworkID string, input SubnetworkUpdateInput) (*Subnetwork, error)

UpdateSubnetwork returns subnetwork from the pool Endpoint: https://developers.servers.com/api-documentation/v1/#operation/UpdateAnExistingSubnetwork

type NetworkPoolsService

type NetworkPoolsService interface {
	// Primary collection
	Collection() Collection[NetworkPool]

	// Generic operations
	Get(ctx context.Context, id string) (*NetworkPool, error)
	Update(ctx context.Context, id string, input NetworkPoolInput) (*NetworkPool, error)

	CreateSubnetwork(ctx context.Context, networkPoolID string, input SubnetworkCreateInput) (*Subnetwork, error)
	GetSubnetwork(ctx context.Context, networkPoolID, subnetworkID string) (*Subnetwork, error)
	UpdateSubnetwork(ctx context.Context, networkPoolID, subnetworkID string, input SubnetworkUpdateInput) (*Subnetwork, error)
	DeleteSubnetwork(ctx context.Context, networkPoolID, subnetworkID string) error

	// Additional collections
	Subnetworks(networkPoolID string) Collection[Subnetwork]
}

NetworkPoolsService is an interface to interfacing with the Network Pool endpoints API documentation: https://developers.servers.com/api-documentation/v1/#tag/Network-Pool

type NotFoundError

type NotFoundError struct {
	StatusCode int
	ErrorCode  string
	Message    string
}

NotFoundError represents an errors related to 404 response status code

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type OperatingSystemOption

type OperatingSystemOption struct {
	ID          int64    `json:"id"`
	FullName    string   `json:"full_name"`
	Name        string   `json:"name"`
	Version     string   `json:"version"`
	Arch        string   `json:"arch"`
	Filesystems []string `json:"filesystems"`
}

OperatingSystemOption represents operating system option

type OperatingSystemReinstallDrivesInput

type OperatingSystemReinstallDrivesInput struct {
	Layout []OperatingSystemReinstallLayoutInput `json:"layout,omitempty"`
}

OperatingSystemReinstallDrivesInput represents drives for os reinstallation input

type OperatingSystemReinstallInput

type OperatingSystemReinstallInput struct {
	Hostname           string                              `json:"hostname"`
	Drives             OperatingSystemReinstallDrivesInput `json:"drives"`
	OperatingSystemID  *int64                              `json:"operating_system_id,omitempty"`
	SSHKeyFingerprints []string                            `json:"ssh_key_fingerprints,omitempty"`
}

OperatingSystemReinstallInput represents os reinstallation input

type OperatingSystemReinstallLayoutInput

type OperatingSystemReinstallLayoutInput struct {
	SlotPositions []int                                    `json:"slot_positions"`
	Raid          *int                                     `json:"raid,omitempty"`
	Ignore        *bool                                    `json:"ignore,omitempty"`
	Partitions    []OperatingSystemReinstallPartitionInput `json:"partitions,omitempty"`
}

OperatingSystemReinstallLayoutInput represents layout for os reinstallation drives input

type OperatingSystemReinstallPartitionInput

type OperatingSystemReinstallPartitionInput struct {
	Target string  `json:"target"`
	Size   int     `json:"size"`
	Fs     *string `json:"fs,omitempty"`
	Fill   bool    `json:"fill,omitempty"`
}

OperatingSystemReinstallPartitionInput represents partition for os reinstallation layout input

type PTRRecord

type PTRRecord struct {
	ID       string `json:"id"`
	IP       string `json:"ip"`
	Domain   string `json:"domain"`
	Priority int    `json:"priority"`
	TTL      int    `json:"ttl"`
}

PTRRecord represents ptr record

type PTRRecordCreateInput

type PTRRecordCreateInput struct {
	IP       string `json:"ip"`
	Domain   string `json:"domain"`
	Priority *int   `json:"priority"`
	TTL      *int   `json:"ttl"`
}

PTRRecordCreateInput represents ptr record create input

type ParsingError

type ParsingError struct {
	StatusCode   int
	Body         string
	ParsingError error
}

ParsingError represents any error related to the problem with parsing a body

func (*ParsingError) Error

func (e *ParsingError) Error() string

type RAMOption

type RAMOption struct {
	RAM  int    `json:"ram"`
	Type string `json:"type"`
}

RAMOption represents ram option

type Rack added in v1.0.8

type Rack struct {
	ID           string            `json:"id"`
	Name         string            `json:"name"`
	LocationID   int64             `json:"location_id"`
	LocationCode string            `json:"location_code"`
	Labels       map[string]string `json:"labels,omitempty"`
}

Rack represents rack

type RackUpdateInput added in v1.0.8

type RackUpdateInput struct {
	Labels map[string]string `json:"labels,omitempty"`
}

RackUpdateInput represents rack update input

type RacksHandler added in v1.0.8

type RacksHandler struct {
	// contains filtered or unexported fields
}

RacksHandler handles operations around hosts

func (*RacksHandler) Collection added in v1.0.8

func (h *RacksHandler) Collection() Collection[Rack]

Collection builds a new Collection[Rack] interface Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Rack/operation/ListRacks

func (*RacksHandler) Get added in v1.0.8

func (h *RacksHandler) Get(ctx context.Context, id string) (*Rack, error)

GetRack returns a rack Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Rack/operation/GetARack

func (*RacksHandler) Update added in v1.0.8

func (h *RacksHandler) Update(ctx context.Context, id string, input RackUpdateInput) (*Rack, error)

UpdateRack updates rack Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Rack/operation/UpdateARack

type RacksService added in v1.0.8

type RacksService interface {
	// Primary collection
	Collection() Collection[Rack]

	// Generic operations
	Get(ctx context.Context, id string) (*Rack, error)
	Update(ctx context.Context, id string, input RackUpdateInput) (*Rack, error)
}

RacksService is an interface for interfacing with Rack endpoints Endpoint: https://developers.servers.com/api-documentation/v1/#tag/Rack

type SBMFlavor added in v1.0.4

type SBMFlavor struct {
	ID                     int64  `json:"id"`
	Name                   string `json:"name"`
	CPUName                string `json:"cpu_name"`
	CPUCount               int    `json:"cpu_count"`
	CPUCoresCount          int    `json:"cpu_cores_count"`
	CPUFrequency           string `json:"cpu_frequency"`
	RAMSize                int    `json:"ram_size"`
	DrivesConfiguration    string `json:"drives_configuration"`
	PublicUplinkModelID    int    `json:"public_uplink_model_id"`
	PublicUplinkModelName  string `json:"public_uplink_model_name"`
	PrivateUplinkModelID   int    `json:"private_uplink_model_id"`
	PrivateUplinkModelName string `json:"private_uplink_model_name"`
	BandwidthID            int    `json:"bandwidth_id"`
	BandwidthName          string `json:"bandwidth_name"`
}

type SBMOperatingSystemReinstallInput added in v1.0.8

type SBMOperatingSystemReinstallInput struct {
	Hostname           string   `json:"hostname"`
	OperatingSystemID  int64    `json:"operating_system_id"`
	SSHKeyFingerprints []string `json:"ssh_key_fingerprints,omitempty"`
	UserData           *string  `json:"user_data,omitempty"`
}

OperatingSystemReinstallInput represents os reinstallation input

type SBMServer added in v1.0.4

type SBMServer struct {
	ID                   string               `json:"id"`
	Type                 string               `json:"type"`
	Title                string               `json:"title"`
	LocationID           int64                `json:"location_id"`
	LocationCode         string               `json:"location_code"`
	Status               string               `json:"status"`
	OperationalStatus    string               `json:"operational_status"`
	PowerStatus          string               `json:"power_status"`
	Configuration        string               `json:"configuration"`
	PrivateIPv4Address   *string              `json:"private_ipv4_address"`
	PublicIPv4Address    *string              `json:"public_ipv4_address"`
	ScheduledRelease     *time.Time           `json:"scheduled_release_at"`
	ConfigurationDetails ConfigurationDetails `json:"configuration_details"`
	Labels               map[string]string    `json:"labels"`
	Created              time.Time            `json:"created_at"`
	Updated              time.Time            `json:"updated_at"`
}

SBMServer represents scalable baremetal server

type SBMServerCreateInput added in v1.0.4

type SBMServerCreateInput struct {
	FlavorModelID      int64                `json:"sbm_flavor_model_id"`
	LocationID         int64                `json:"location_id"`
	Hosts              []SBMServerHostInput `json:"hosts"`
	OperatingSystemID  *int64               `json:"operating_system_id,omitempty"`
	SSHKeyFingerprints []string             `json:"ssh_key_fingerprints,omitempty"`
	UserData           *string              `json:"user_data,omitempty"`
}

SBMServerCreateInput represents SBM server create input, example:

input := &SBMServerCreateInput{
	SBMFlavorModelID: 1,
	LocationID: 2,
	Hosts: []SBMServerHostInput{
		{
			Hostname: "test",
		},
	},
}

type SBMServerHostInput added in v1.0.4

type SBMServerHostInput struct {
	Hostname             string            `json:"hostname"`
	PublicIPv4NetworkID  *string           `json:"public_ipv4_network_id,omitempty"`
	PrivateIPv4NetworkID *string           `json:"private_ipv4_network_id,omitempty"`
	Labels               map[string]string `json:"labels,omitempty"`
}

SBMServerHostInput represents hosts for SBMServerCreateInput

type SBMServerUpdateInput added in v1.0.8

type SBMServerUpdateInput struct {
	Labels map[string]string `json:"labels,omitempty"`
}

SBMServerUpdateInput represents sbm server update input

type SSHKey

type SSHKey struct {
	Name        string            `json:"name"`
	Fingerprint string            `json:"fingerprint"`
	Labels      map[string]string `json:"labels"`
	Created     time.Time         `json:"created_at"`
	Updated     time.Time         `json:"updated_at"`
}

SSHKey represents ssh key

type SSHKeyCreateInput

type SSHKeyCreateInput struct {
	Name      string            `json:"name"`
	PublicKey string            `json:"public_key"`
	Labels    map[string]string `json:"labels,omitempty"`
}

SSHKeyCreateInput represents ssh key create input

type SSHKeyUpdateInput

type SSHKeyUpdateInput struct {
	Name   string            `json:"name"`
	Labels map[string]string `json:"labels,omitempty"`
}

SSHKeyUpdateInput represents ssh key update input

type SSHKeysHandler

type SSHKeysHandler struct {
	// contains filtered or unexported fields
}

SSHKeysHandler handles operations around ssh keys

func (*SSHKeysHandler) Collection

func (h *SSHKeysHandler) Collection() Collection[SSHKey]

Collection builds a new Collection[SSHKey] interface Endpoint: https://developers.servers.com/api-documentation/v1/#tag/SSH-Key/operation/ListSshKeys

func (*SSHKeysHandler) Delete

func (h *SSHKeysHandler) Delete(ctx context.Context, fingerprint string) error

Delete ssh key Endpoint: https://developers.servers.com/api-documentation/v1/#tag/SSH-Key/operation/DeleteAnSshKey

func (*SSHKeysHandler) Get

func (h *SSHKeysHandler) Get(ctx context.Context, fingerprint string) (*SSHKey, error)

Get ssh key Endpoint: https://developers.servers.com/api-documentation/v1/#tag/SSH-Key/operation/GetAnSshKey

type SSHKeysService

type SSHKeysService interface {
	// Primary collection
	Collection() Collection[SSHKey]

	// Generic operations
	Get(ctx context.Context, fingerprint string) (*SSHKey, error)
	Create(ctx context.Context, input SSHKeyCreateInput) (*SSHKey, error)
	Update(ctx context.Context, fingerprint string, input SSHKeyUpdateInput) (*SSHKey, error)
	Delete(ctx context.Context, fingerprint string) error
}

SSHKeysService is an interface to interfacing with the SSH Key endpoints API documentation: https://developers.servers.com/api-documentation/v1/#tag/SSH-Key

type SSLCertificate

type SSLCertificate struct {
	ID              string            `json:"id"`
	Name            string            `json:"name"`
	Sha1Fingerprint string            `json:"sha1_fingerprint"`
	Labels          map[string]string `json:"labels"`
	Expires         *time.Time        `json:"expires_at"`
	Created         time.Time         `json:"created_at"`
	Updated         time.Time         `json:"updated_at"`
}

SSLCertificate represents ssl certificate

type SSLCertificateCreateCustomInput

type SSLCertificateCreateCustomInput struct {
	Name       string            `json:"name"`
	PublicKey  string            `json:"public_key"`
	PrivateKey string            `json:"private_key"`
	ChainKey   string            `json:"chain_key,omitempty"`
	Labels     map[string]string `json:"labels,omitempty"`
}

SSLCertificateCreateCustomInput represents custom ssl certificate create input

type SSLCertificateCustom

type SSLCertificateCustom struct {
	ID              string            `json:"id"`
	Name            string            `json:"name"`
	Type            string            `json:"type"`
	Issuer          *string           `json:"issuer"`
	Subject         string            `json:"subject"`
	DomainNames     []string          `json:"domain_names"`
	Sha1Fingerprint string            `json:"sha1_fingerprint"`
	Labels          map[string]string `json:"labels"`
	Expires         *time.Time        `json:"expires_at"`
	Created         time.Time         `json:"created_at"`
	Updated         time.Time         `json:"updated_at"`
}

SSLCertificateCustom represents custom ssl certificate

type SSLCertificateLE added in v1.0.8

type SSLCertificateLE struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Type        string            `json:"type"`
	Issuer      *string           `json:"issuer"`
	Subject     string            `json:"subject"`
	DomainNames []string          `json:"domain_names"`
	Labels      map[string]string `json:"labels"`
	Expires     *time.Time        `json:"expires_at"`
	Created     time.Time         `json:"created_at"`
	Updated     time.Time         `json:"updated_at"`
}

SSLCertificateLE represents let's encrypt ssl certificate

type SSLCertificateUpdateCustomInput added in v1.0.8

type SSLCertificateUpdateCustomInput struct {
	Labels map[string]string `json:"labels,omitempty"`
}

SSLCertificateUpdateCustomInput represents custom ssl certificate update input

type SSLCertificateUpdateLEInput added in v1.0.8

type SSLCertificateUpdateLEInput struct {
	Labels map[string]string `json:"labels,omitempty"`
}

SSLCertificateUpdateLEInput represents let's encrypt ssl certificate update input

type SSLCertificatesHandler

type SSLCertificatesHandler struct {
	// contains filtered or unexported fields
}

SSLCertificatesHandler handles operations around ssl certificates

func (*SSLCertificatesHandler) Collection

Collection builds a new Collection[SSLCertificate] interface

func (*SSLCertificatesHandler) CreateCustom

CreateCustom creates a custom ssl certificate

func (*SSLCertificatesHandler) DeleteCustom added in v1.0.8

func (h *SSLCertificatesHandler) DeleteCustom(ctx context.Context, id string) error

DeleteCustom deletes a custom SSL certificate Endpoint: https://developers.servers.com/api-documentation/v1/#tag/SSL-Certificate/operation/DeleteACustomSslCertificate

func (*SSLCertificatesHandler) DeleteLE added in v1.0.8

func (h *SSLCertificatesHandler) DeleteLE(ctx context.Context, id string) error

DeleteLE deletes a Let's Encrypt SSL certificate Endpoint: https://developers.servers.com/api-documentation/v1/#tag/SSL-Certificate/operation/DeleteALetsEncryptSslCertificate

func (*SSLCertificatesHandler) GetCustom

GetCustom returns a custom ssl certificate

func (*SSLCertificatesHandler) GetLE added in v1.0.8

GetLE returns a Let's Encrypt SSL certificate

func (*SSLCertificatesHandler) UpdateCustom added in v1.0.8

UpdateCustom updates a custom SSL certificate Endpoint: https://developers.servers.com/api-documentation/v1/#tag/SSL-Certificate/operation/UpdateACustomSslCertificate

func (*SSLCertificatesHandler) UpdateLE added in v1.0.8

UpdateLE updates a Let's Encrypt SSL certificate Endpoint: https://developers.servers.com/api-documentation/v1/#tag/SSL-Certificate/operation/UpdateALetsEncryptSslCertificate

type SSLCertificatesService

type SSLCertificatesService interface {
	// Primary collection
	Collection() Collection[SSLCertificate]

	// Generic operations
	CreateCustom(ctx context.Context, input SSLCertificateCreateCustomInput) (*SSLCertificateCustom, error)
	UpdateCustom(ctx context.Context, id string, input SSLCertificateUpdateCustomInput) (*SSLCertificateCustom, error)
	GetCustom(ctx context.Context, id string) (*SSLCertificateCustom, error)
	DeleteCustom(ctx context.Context, id string) error
	GetLE(ctx context.Context, id string) (*SSLCertificateLE, error)
	UpdateLE(ctx context.Context, id string, input SSLCertificateUpdateLEInput) (*SSLCertificateLE, error)
	DeleteLE(ctx context.Context, id string) error
}

SSLCertificatesService is an interface to interfacing with the SSL Certificate endpoints API documentation: https://developers.servers.com/api-documentation/v1/#tag/SSL-Certificate

type ServerModelOption

type ServerModelOption struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	RAM  int    `json:"ram"`
}

ServerModelOption represents server model option

type Subnetwork

type Subnetwork struct {
	ID            string    `json:"id"`
	NetworkPoolID string    `json:"network_pool_id"`
	Title         *string   `json:"title"`
	CIDR          string    `json:"cidr"`
	Attached      bool      `json:"attached"`
	InterfaceType string    `json:"interface_type"`
	Created       time.Time `json:"created_at"`
	Updated       time.Time `json:"updated_at"`
}

Subnetwork represents subnetwork

type SubnetworkCreateInput

type SubnetworkCreateInput struct {
	Title *string `json:"title"`
	CIDR  *string `json:"cidr,omitempty"`
	Mask  *int    `json:"mask,omitempty"`
}

SubnetworkCreateInput represents subnetwork create input

type SubnetworkUpdateInput

type SubnetworkUpdateInput struct {
	Title *string `json:"title"`
}

SubnetworkUpdateInput respresents subnetwork update input

type UnauthorizedError

type UnauthorizedError struct {
	StatusCode int
	ErrorCode  string
	Message    string
}

UnauthorizedError represents an errors related to 401 response status code

func (*UnauthorizedError) Error

func (e *UnauthorizedError) Error() string

type UnprocessableEntityError

type UnprocessableEntityError struct {
	StatusCode int
	ErrorCode  string
	Message    string
	Errors     map[string]string
}

UnprocessableEntityError represents an errors related to 422 response status code

func (*UnprocessableEntityError) Error

func (e *UnprocessableEntityError) Error() string

type UplinkOption

type UplinkOption struct {
	ID         int64  `json:"id"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	Speed      int    `json:"speed"`
	Redundancy bool   `json:"redundancy"`
}

UplinkOption represents uplink option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL