cloudsigma

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: BSD-3-Clause Imports: 11 Imported by: 2

Documentation

Overview

Package cloudsigma provides a client for using the CloudSigma API.

Index

Constants

View Source
const TokenCredentialsName = "TokenCredentials"
View Source
const UsernamePasswordCredentialsName = "UsernamePasswordCredentials"

Variables

View Source
var (
	// ErrEmptyPayloadNotAllowed is returned when a request body is empty
	// and does not contain a mandatory JSON payload.
	ErrEmptyPayloadNotAllowed = errors.New("cloudsigma-sdk-go: empty payload not allowed")

	// ErrEmptyArgument is returned when a mandatory function argument is empty.
	ErrEmptyArgument = errors.New("cloudsigma-sdk-go: argument cannot be empty")
)

Errors used by the CloudSigma SDK.

Functions

func CheckResponse

func CheckResponse(resp *Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range.

func Stringify added in v0.7.0

func Stringify(message interface{}) string

Stringify attempts to create a string representation of CloudSigma types

Types

type ACL added in v0.2.1

type ACL struct {
	Meta        map[string]interface{} `json:"meta,omitempty"`
	Name        string                 `json:"name,omitempty"`
	Owner       *ResourceLink          `json:"owner,omitempty"`
	ResourceURI string                 `json:"resource_uri,omitempty"`
	Rules       []ACLRule              `json:"rules,omitempty"`
	Tags        []Tag                  `json:"tags,omitempty"`
	UUID        string                 `json:"uuid,omitempty"`
}

ACL represents a CloudSigma ACL.

func (ACL) String added in v0.7.0

func (a ACL) String() string

type ACLCreateRequest added in v0.2.1

type ACLCreateRequest struct {
	ACLs []ACL `json:"objects"`
}

ACLCreateRequest represents a request to create an ACL.

type ACLRule added in v0.2.1

type ACLRule struct {
	Permission string `json:"permission,omitempty"`
}

ACLRule represents a CloudSigma ACL rule.

type ACLUpdateRequest added in v0.2.1

type ACLUpdateRequest struct {
	*ACL
}

ACLUpdateRequest represents a request to update an ACL.

type ACLsService added in v0.2.1

type ACLsService service

ACLsService handles communication with the ACL (Access Control Lists) related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/acls.html

func (*ACLsService) Create added in v0.2.1

func (s *ACLsService) Create(ctx context.Context, createRequest *ACLCreateRequest) ([]ACL, *Response, error)

Create makes a new ACL (or ACLs) with given payload.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/acls.html#creating

func (*ACLsService) Delete added in v0.2.1

func (s *ACLsService) Delete(ctx context.Context, uuid string) (*Response, error)

Delete removes a single ACL identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/acls.html#deleting

func (*ACLsService) Get added in v0.2.1

func (s *ACLsService) Get(ctx context.Context, uuid string) (*ACL, *Response, error)

Get provides detailed information for an ACL identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/acls.html#list-single-acl

func (*ACLsService) List added in v0.2.1

func (s *ACLsService) List(ctx context.Context) ([]ACL, *Response, error)

List provides a list of ACLs defined by the authenticated user.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/acls.html#listing

func (*ACLsService) Update added in v0.2.1

func (s *ACLsService) Update(ctx context.Context, uuid string, updateRequest *ACLUpdateRequest) (*ACL, *Response, error)

Update edits an ACL identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/acls.html#editing

type Capabilities added in v0.2.1

type Capabilities struct {
	Hosts       *CapabilitiesHosts       `json:"hosts,omitempty"`
	Hypervisors *CapabilitiesHypervisors `json:"hypervisors,omitempty"`
}

Capabilities represents CloudSigma capabilities.

type CapabilitiesHost added in v0.2.1

type CapabilitiesHost struct {
	CPU       *CapabilitiesLimitation `json:"cpu,omitempty"`
	CPUPerSMP *CapabilitiesLimitation `json:"cpu_per_smp,omitempty"`
	Memory    *CapabilitiesLimitation `json:"mem,omitempty"`
	SMP       *CapabilitiesLimitation `json:"smp,omitempty"`
}

CapabilitiesHost represents capabilities limitation for an host type

type CapabilitiesHosts added in v0.2.1

type CapabilitiesHosts struct {
	AMD   *CapabilitiesHost `json:"amd,omitempty"`
	Intel *CapabilitiesHost `json:"intel,omitempty"`
}

CapabilitiesHosts represents available host types and their limitations.

type CapabilitiesHypervisors added in v0.2.1

type CapabilitiesHypervisors struct {
	KVM []string `json:"kvm,omitempty"`
}

CapabilitiesHypervisors represents a list of hypervisors and which hosts they are available on.

type CapabilitiesLimitation added in v0.2.1

type CapabilitiesLimitation struct {
	Max int `json:"max,omitempty"`
	Min int `json:"min,omitempty"`
}

CapabilitiesLimitation represents capabilities limitation.

type CapabilitiesService added in v0.2.1

type CapabilitiesService service

CapabilitiesService handles communication with the capabilities related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/capabilities.html

func (*CapabilitiesService) Get added in v0.2.1

Get provides the capabilities object.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/capabilities.html#capabilities

type Client

type Client struct {
	ACLs             *ACLsService
	Capabilities     *CapabilitiesService
	CloudStatus      *CloudStatusService
	Drives           *DrivesService
	FirewallPolicies *FirewallPoliciesService
	IPs              *IPsService
	Keypairs         *KeypairsService
	Licenses         *LicensesService
	LibraryDrives    *LibraryDrivesService
	Locations        *LocationsService
	Profile          *ProfileService
	Pubkeys          *PubkeysService
	RemoteSnapshots  *RemoteSnapshotsService
	Servers          *ServersService
	Snapshots        *SnapshotsService
	Subscriptions    *SubscriptionsService
	Tags             *TagsService
	VLANs            *VLANsService
	// contains filtered or unexported fields
}

A Client manages communication with the CloudSigma API.

func NewClient added in v0.14.0

func NewClient(cred CredentialsProvider, opts ...ClientOption) *Client

NewClient returns a new CloudSigma API client.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred.

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the APIEndpoint of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

type ClientOption added in v0.14.0

type ClientOption func(*Client)

func WithHTTPClient added in v0.14.0

func WithHTTPClient(httpClient *http.Client) ClientOption

WithHTTPClient configures Client to use a specific http client for communication.

func WithLocation added in v0.14.0

func WithLocation(location string) ClientOption

WithLocation configures Client to use a specific location.

func WithUserAgent added in v0.14.0

func WithUserAgent(userAgent string) ClientOption

WithUserAgent configures Client to use a specific user agent.

type CloudStatus added in v0.5.0

type CloudStatus struct {
	FreeTier              *CloudStatusFreeTier        `json:"free_tier,omitempty"`
	FreeTierMonthly       *CloudStatusFreeTierMonthly `json:"free_tier_monthly,omitempty"`
	Guest                 bool                        `json:"guest,omitempty"`
	HostAvailabilityZones bool                        `json:"host_availability_zones,omitempty"`
	RemoteSnapshots       bool                        `json:"remote_snapshots,omitempty"`
	Signup                bool                        `json:"signup,omitempty"`
	SSO                   []string                    `json:"sso,omitempty"`
	Trial                 bool                        `json:"trial,omitempty"`
	VMware                bool                        `json:"vmware,omitempty"`
	VPC                   bool                        `json:"vpc,omitempty"`
}

CloudStatus represents a CloudSigma cloud status.

type CloudStatusFreeTier added in v0.5.0

type CloudStatusFreeTier struct {
	DSSD   int `json:"dssd,omitempty"`
	Memory int `json:"mem,omitempty"`
}

CloudStatusFreeTier represents a CloudSigma cloud status free tier.

type CloudStatusFreeTierMonthly added in v0.5.0

type CloudStatusFreeTierMonthly struct {
	TX int `json:"tx,omitempty"`
}

CloudStatusFreeTierMonthly represents a CloudSigma cloud status monthly free tier.

type CloudStatusService added in v0.5.0

type CloudStatusService service

CloudStatusService handles communication with the cloud status related methods of the CloudSigma API.

func (*CloudStatusService) Get added in v0.5.0

Get provides information for cloud status.

type Credentials added in v0.14.0

type Credentials struct {
	// Source of the credentials.
	Source string

	// The username (email address) used to communicate with CloudSigma API.
	Username string

	// The password used to communicate with CloudSigma API.
	Password string

	// The access token used to communicate with CloudSigma API.
	Token string
}

Credentials is the CloudSigma credentials value for individual credentials fields.

type CredentialsProvider added in v0.14.0

type CredentialsProvider interface {
	Retrieve() (Credentials, error)
}

A CredentialsProvider is the interface for any component which will provide credentials.

type Drive

type Drive struct {
	AllowMultimount bool                   `json:"allow_multimount,omitempty"`
	Licenses        []DriveLicense         `json:"licenses,omitempty"`
	Media           string                 `json:"media,omitempty"`
	Meta            map[string]interface{} `json:"meta,omitempty"`
	MountedOn       []ResourceLink         `json:"mounted_on,omitempty"`
	Name            string                 `json:"name,omitempty"`
	Owner           *ResourceLink          `json:"owner,omitempty"`
	RemoteSnapshots []ResourceLink         `json:"remote_snapshots,omitempty"`
	ResourceURI     string                 `json:"resource_uri,omitempty"`
	Runtime         *DriveRuntime          `json:"runtime,omitempty"`
	Size            int                    `json:"size,omitempty"`
	Snapshots       []ResourceLink         `json:"snapshots,omitempty"`
	Status          string                 `json:"status,omitempty"`
	StorageType     string                 `json:"storage_type,omitempty"`
	Tags            []Tag                  `json:"tags,omitempty"`
	UUID            string                 `json:"uuid,omitempty"`
}

Drive represents a CloudSigma drive.

func (Drive) String added in v0.7.0

func (d Drive) String() string

type DriveCloneRequest added in v0.3.0

type DriveCloneRequest struct {
	*Drive
}

DriveCloneRequest represents a request to clone a drive.

type DriveCreateRequest added in v0.3.0

type DriveCreateRequest struct {
	Drives []Drive `json:"objects"`
}

DriveCreateRequest represents a request to create a drive.

type DriveLicense added in v0.5.0

type DriveLicense struct {
	Amount  int           `json:"amount,omitempty"`
	License *License      `json:"license,omitempty"`
	User    *ResourceLink `json:"user,omitempty"`
}

DriveLicense represents a CloudSigma license attached to the drive.

type DriveListOptions added in v0.6.0

type DriveListOptions struct {
	// Names filters drives based on their name.
	Names []string `url:"name,comma,omitempty"`
	// Tags filters drives based on their tag.
	Tags []string `url:"tag,comma,omitempty"`
	// UUIDs filters drives based on their uuid.
	UUIDs []string `url:"uuid,comma,omitempty"`

	ListOptions
}

DriveListOptions specifies the optional parameters to the DrivesService.List.

type DriveRuntime added in v0.5.0

type DriveRuntime struct {
	IsSnapshotable         bool   `json:"is_snapshotable,omitempty"`
	SnapshotsAllocatedSize int    `json:"snapshots_allocated_size,omitempty"`
	StorageType            string `json:"storage_type,omitempty"`
}

DriveRuntime represents a CloudSigma runtime information of the drive.

type DriveUpdateRequest added in v0.3.0

type DriveUpdateRequest struct {
	*Drive
}

DriveUpdateRequest represents a request to update a drive.

type DrivesService

type DrivesService service

DrivesService handles communication with the drives related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/drives.html

func (*DrivesService) Clone added in v0.3.0

func (s *DrivesService) Clone(ctx context.Context, uuid string, cloneRequest *DriveCloneRequest) (*Drive, *Response, error)

Clone duplicates a drive. DriveCloneRequest is optional. Size of the cloned drive can only be bigger or the same.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/drives.html#cloning

func (*DrivesService) Create added in v0.3.0

func (s *DrivesService) Create(ctx context.Context, createRequest *DriveCreateRequest) ([]Drive, *Response, error)

Create makes a new drive (or drives) with given payload.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/drives.html#creating

func (*DrivesService) Delete added in v0.3.0

func (s *DrivesService) Delete(ctx context.Context, uuid string) (*Response, error)

Delete removes a single drive identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/drives.html#single-drive

func (*DrivesService) Get

func (s *DrivesService) Get(ctx context.Context, uuid string) (*Drive, *Response, error)

Get provides detailed information for drive identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/drives.html#list-single-drive

func (*DrivesService) List added in v0.3.0

func (s *DrivesService) List(ctx context.Context, opts *DriveListOptions) ([]Drive, *Response, error)

List provides a detailed list of drives with additional information to which the authenticated user has access.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/drives.html#detailed-listing

func (*DrivesService) Resize added in v0.3.0

func (s *DrivesService) Resize(ctx context.Context, uuid string, updateRequest *DriveUpdateRequest) ([]Drive, *Response, error)

Resize updates a drive definition. Note that the resize action is a full definition update (it can update even name and metadata), so a full definition should be provided to this call.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/drives.html#resizing-update-or-fail

func (*DrivesService) Update added in v0.3.0

func (s *DrivesService) Update(ctx context.Context, uuid string, updateRequest *DriveUpdateRequest) (*Drive, *Response, error)

Update edits a drive identified by uuid. Note that if the drive is mounted on a running server only the name, meta, tags, and allow_multimount can be changed.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/drives.html#editing

type EnclavePageCache added in v0.12.0

type EnclavePageCache struct {
	Size int `json:"size,omitempty"`
}

EnclavePageCache represents a protected memory region for enclaves in a server.

type Error

type Error struct {
	Message string `json:"error_message"`
	Point   string `json:"error_point"`
	Type    string `json:"error_type"`
}

Error represents a single error caused by an API request.

type ErrorResponse

type ErrorResponse struct {
	Response *Response // HTTP response that caused this error.
	Errors   []Error
}

An ErrorResponse reports one or more errors caused by an API request.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/errors.html

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

Error represents a string error message (may contain request id).

type FirewallPoliciesService added in v0.2.1

type FirewallPoliciesService service

FirewallPoliciesService handles communication with the firewall policies related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/fwpolicies.html

func (*FirewallPoliciesService) Create added in v0.2.1

Create makes a new firewall policy (or policies) with given payload.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/fwpolicies.html#create

func (*FirewallPoliciesService) Delete added in v0.2.1

func (s *FirewallPoliciesService) Delete(ctx context.Context, uuid string) (*Response, error)

Delete removes a firewall policy identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/fwpolicies.html#delete

func (*FirewallPoliciesService) Get added in v0.2.1

Get provides detailed information for a firewall policy identified by uuid.

CloudSigma API docs:

func (*FirewallPoliciesService) List added in v0.2.1

List provides a detailed list of firewall policies to which the authenticated user has access.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/fwpolicies.html#detailed-listing

func (*FirewallPoliciesService) Update added in v0.2.1

Update edits an existing firewall policy.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/fwpolicies.html#editing

type FirewallPolicy added in v0.2.1

type FirewallPolicy struct {
	Meta        map[string]interface{} `json:"meta,omitempty"`
	Name        string                 `json:"name,omitempty"`
	Owner       *ResourceLink          `json:"owner,omitempty"`
	ResourceURI string                 `json:"resource_uri,omitempty"`
	Rules       []FirewallPolicyRule   `json:"rules"`
	Servers     []ResourceLink         `json:"servers"`
	Tags        []Tag                  `json:"tags"`
	UUID        string                 `json:"uuid,omitempty"`
}

FirewallPolicy represents a CloudSigma firewall policy.

func (*FirewallPolicy) MarshalJSON added in v0.6.0

func (f *FirewallPolicy) MarshalJSON() ([]byte, error)

MarshalJSON is a custom marshaller for FirewallPolicy. It creates an empty array if Rules is nil, Servers is nil or Tags is nil.

func (FirewallPolicy) String added in v0.7.0

func (f FirewallPolicy) String() string

type FirewallPolicyCreateRequest added in v0.2.1

type FirewallPolicyCreateRequest struct {
	FirewallPolicies []FirewallPolicy `json:"objects,omitempty"`
}

FirewallPolicyCreateRequest represents a request to create a firewall policy.

type FirewallPolicyRule added in v0.2.1

type FirewallPolicyRule struct {
	Action          string `json:"action,omitempty"`
	Comment         string `json:"comment,omitempty"`
	Direction       string `json:"direction,omitempty"`
	DestinationIP   string `json:"dst_ip,omitempty"`
	DestinationPort string `json:"dst_port,omitempty"`
	Protocol        string `json:"ip_proto,omitempty"`
	SourceIP        string `json:"src_ip,omitempty"`
	SourcePort      string `json:"src_port,omitempty"`
}

FirewallPolicyRule represents a CloudSigma firewall policy rule.

type FirewallPolicyUpdateRequest added in v0.2.1

type FirewallPolicyUpdateRequest struct {
	*FirewallPolicy
}

FirewallPolicyUpdateRequest represents a request to update a firewall policy.

type IP

type IP struct {
	Gateway     string                 `json:"gateway,omitempty"`
	Meta        map[string]interface{} `json:"meta,omitempty"`
	Nameservers []string               `json:"nameservers,omitempty"`
	Netmask     int                    `json:"netmask,omitempty"`
	Owner       *ResourceLink          `json:"owner,omitempty"`
	ResourceURI string                 `json:"resource_uri,omitempty"`
	Server      *ResourceLink          `json:"server,omitempty"`
	UUID        string                 `json:"uuid,omitempty"`
}

IP represents a CloudSigma IP address.

func (IP) String added in v0.7.0

func (i IP) String() string

type IPsService

type IPsService service

IPsService handles communication with the IPs related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/networking.html#ips

func (*IPsService) Get

func (s *IPsService) Get(ctx context.Context, uuid string) (*IP, *Response, error)

Get provides detailed information for IP address identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/networking.html#get-single-ip

func (*IPsService) List added in v0.2.1

func (s *IPsService) List(ctx context.Context) ([]IP, *Response, error)

List provides a list of IPs to which the authenticated user has access.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/networking.html#id2

type Keypair

type Keypair struct {
	Fingerprint   string                 `json:"fingerprint,omitempty"`
	HasPrivateKey bool                   `json:"has_private_key,omitempty"`
	Meta          map[string]interface{} `json:"meta,omitempty"`
	Name          string                 `json:"name,omitempty"`
	PrivateKey    string                 `json:"private_key,omitempty"`
	PublicKey     string                 `json:"public_key,omitempty"`
	ResourceURI   string                 `json:"resource_uri,omitempty"`
	UUID          string                 `json:"uuid,omitempty"`
}

Keypair represents a CloudSigma keypair (ssh keys).

func (Keypair) String added in v0.7.0

func (k Keypair) String() string

type KeypairCreateRequest

type KeypairCreateRequest struct {
	Keypairs []Keypair `json:"objects"`
}

KeypairCreateRequest represents a request to create a keypair.

type KeypairUpdateRequest

type KeypairUpdateRequest struct {
	*Keypair
}

KeypairUpdateRequest represents a request to update a keypair.

type KeypairsService

type KeypairsService service

KeypairsService handles communication with the keypairs (SSH keys) related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/keypairs.html

func (*KeypairsService) Create

func (s *KeypairsService) Create(ctx context.Context, createRequest *KeypairCreateRequest) ([]Keypair, *Response, error)

Create makes a new keypair (or keypairs) with given payload.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/keypairs.html#creating-a-keypair

func (*KeypairsService) Delete

func (s *KeypairsService) Delete(ctx context.Context, uuid string) (*Response, error)

Delete removes a keypair identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/keypairs.html#listing-getting-updating-deleting

func (*KeypairsService) Get

func (s *KeypairsService) Get(ctx context.Context, uuid string) (*Keypair, *Response, error)

Get provides information for keypair identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/keypairs.html#listing-getting-updating-deleting

func (*KeypairsService) List

func (s *KeypairsService) List(ctx context.Context) ([]Keypair, *Response, error)

List provides a list of keypairs.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/keypairs.html#listing-getting-updating-deleting

func (*KeypairsService) Update

func (s *KeypairsService) Update(ctx context.Context, uuid string, updateRequest *KeypairUpdateRequest) (*Keypair, *Response, error)

Update edits a keypair identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/keypairs.html#listing-getting-updating-deleting

type LibraryDrive

type LibraryDrive struct {
	AllowMultimount   bool                   `json:"allow_multimount,omitempty"`
	Arch              string                 `json:"arch,omitempty"`
	Category          []string               `json:"category,omitempty"`
	CloudInitService  string                 `json:"cloud_init_service,omitempty"`
	CreatedAt         string                 `json:"created_at,omitempty"`
	DefaultAuthMethod string                 `json:"default_auth_method,omitempty"`
	DefaultPassword   string                 `json:"default_pass,omitempty"`
	DefaultUser       string                 `json:"default_user,omitempty"`
	Deprecated        bool                   `json:"deprecated,omitempty"`
	Description       string                 `json:"description,omitempty"`
	Distribution      string                 `json:"distribution,omitempty"`
	Favourite         bool                   `json:"favourite,omitempty"`
	ImageType         string                 `json:"image_type,omitempty"`
	InstallNotes      string                 `json:"install_notes,omitempty"`
	Licenses          []DriveLicense         `json:"licenses,omitempty"`
	Media             string                 `json:"media,omitempty"`
	Meta              map[string]interface{} `json:"meta,omitempty"`
	MountedOn         []ResourceLink         `json:"mounted_on,omitempty"`
	Name              string                 `json:"name,omitempty"`
	OS                string                 `json:"os,omitempty"`
	Paid              bool                   `json:"paid,omitempty"`
	RemoteSnapshots   []ResourceLink         `json:"remote_snapshots,omitempty"`
	ResourceURI       string                 `json:"resource_uri,omitempty"`
	Size              int                    `json:"size,omitempty"`
	Status            string                 `json:"status,omitempty"`
	StorageType       string                 `json:"storage_type,omitempty"`
	Tags              []Tag                  `json:"tags,omitempty"`
	URL               string                 `json:"url,omitempty"`
	UUID              string                 `json:"uuid"`
	Version           string                 `json:"version,omitempty"`
}

LibraryDrive represents a CloudSigma library drive.

func (LibraryDrive) String added in v0.7.0

func (l LibraryDrive) String() string

type LibraryDriveCloneRequest added in v0.3.0

type LibraryDriveCloneRequest struct {
	*LibraryDrive
}

LibraryDriveCloneRequest represents a request to clone a library drive.

type LibraryDriveListOptions added in v0.6.0

type LibraryDriveListOptions struct {
	// Arch filters library drives based on their operating system bit architecture.
	Arch int `url:"arch,omitempty"`
	// Distributions filter library drives based on their operating system distribution.
	Distributions []string `url:"distribution,comma,omitempty"`
	// ImageTypes filter library drives based on their exact image type.
	ImageTypes []string `url:"image_type,comma,omitempty"`
	// Names filter library drives based on their exact name.
	Names []string `url:"name,comma,omitempty"`
	// NamesContain filter library drives based on matching their name (case insensitive).
	NamesContain []string `url:"name__icontains,comma,omitempty"`
	// OSs filter library drives based on their operating system.
	OSs []string `url:"os,comma,omitempty"`
	// UUIDs filter library drives based on their uuid.
	UUIDs []string `url:"uuid,comma,omitempty"`
	// Versions filter library drives based on their version.
	Versions []string `url:"version,comma,omitempty"`

	ListOptions
}

LibraryDriveListOptions specifies the optional parameters to the LibraryDrivesService.List.

type LibraryDrivesService

type LibraryDrivesService service

LibraryDrivesService handles communication with the library drives related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/libdrives.html

func (*LibraryDrivesService) Clone

Clone duplicates a drive. LibraryDriveCloneRequest is optional. Size of the cloned drive can only be bigger or the same.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/libdrives.html#cloning-library-drive

func (*LibraryDrivesService) Get

Get provides detailed information for library drive identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/libdrives.html#list-single-drive

func (*LibraryDrivesService) List added in v0.3.0

List provides a list of library drives to which the authenticated user has access.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/libdrives.html#listing

type License added in v0.2.1

type License struct {
	Burstable                     bool   `json:"burstable,omitempty"`
	Free                          string `json:"free,omitempty"`
	InitialPurchaseRequirement    string `json:"initial_purchase_requirement,omitempty"`
	LongName                      string `json:"long_name,omitempty"`
	Name                          string `json:"name,omitempty"`
	ResourceURI                   string `json:"resource_uri,omitempty"`
	SubsequentPurchaseRequirement string `json:"subsequent_purchase_requirement,omitempty"`
	Type                          string `json:"type,omitempty"`
	UserMetric                    string `json:"user_metric"`
}

License represents a CloudSigma license.

type LicensesService added in v0.2.1

type LicensesService service

LicensesService handles communication with the license related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/billing.html#licenses-list

func (*LicensesService) List added in v0.2.1

func (s *LicensesService) List(ctx context.Context) ([]License, *Response, error)

List provides a list of licenses available on the cloud.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/billing.html#licenses-list

type ListOptions added in v0.6.0

type ListOptions struct {
	// Limit specifies the maximum number of objects to be returned. If set to 0,
	// all resources will be returned. Note, there is no omitempty struct tag!
	Limit int `url:"limit"`

	// Offset specifies the index at which to start returning objects. It is
	// a zero based index.
	Offset int `url:"offset,omitempty"`
}

ListOptions specifies the optional parameters to various List methods that support offset pagination.

type Location

type Location struct {
	AlternativeFrontendURL   string `json:"alternative_frontend_url,omitempty"`
	APIEndpoint              string `json:"api_endpoint,omitempty"`
	CountryCode              string `json:"country_code,omitempty"`
	DefaultFrontendSignupURL string `json:"default_frontend_signup_url,omitempty"`
	DefaultFrontendURL       string `json:"default_frontend_url,omitempty"`
	DisplayName              string `json:"display_name,omitempty"`
	DocumentationURL         string `json:"documentation_url,omitempty"`
	ID                       string `json:"id,omitempty"`
	UploadURL                string `json:"upload_url,omitempty"`
	WebsocketURL             string `json:"websocket_url,omitempty"`
}

Location represents a CloudSigma location.

type LocationsService

type LocationsService service

LocationsService handles communication with the location related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/locations.html

func (*LocationsService) List

func (s *LocationsService) List(ctx context.Context) ([]Location, *Response, error)

List provides a list of the currently available CloudSigma locations, and information on specific urls, such as the websockets and upload urls.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/locations.html#locations

type Meta

type Meta struct {
	Limit      int `json:"limit,omitempty"`
	Offset     int `json:"offset,omitempty"`
	TotalCount int `json:"total_count,omitempty"`
}

Meta represents an object with meta information about the request.

type Profile added in v0.2.1

type Profile struct {
	Address              string                 `json:"address,omitempty"`
	APIHTTPSOnly         bool                   `json:"api_https_only,omitempty"`
	AutoTopUpAmount      string                 `json:"autotopup_amount,omitempty"`
	AutoTopUpThreshold   string                 `json:"autotopup_threshold,omitempty"`
	BankReference        string                 `json:"bank_reference,omitempty"`
	CloneNaming          string                 `json:"clone_naming,omitempty"`
	Company              string                 `json:"company,omitempty"`
	Country              string                 `json:"country,omitempty"`
	Currency             string                 `json:"currency,omitempty"`
	Email                string                 `json:"email,omitempty"`
	FirstName            string                 `json:"first_name,omitempty"`
	HasAutoTopUp         bool                   `json:"has_autotopup,omitempty"`
	HasTxAutoTopUp       bool                   `json:"has_tx_autotopup,omitempty"`
	Invoicing            bool                   `json:"invoicing,omitempty"`
	KeyAuth              bool                   `json:"key_auth,omitempty"`
	Language             string                 `json:"language,omitempty"`
	LastName             string                 `json:"last_name,omitempty"`
	MailingList          bool                   `json:"mailing_list,omitempty"`
	Meta                 map[string]interface{} `json:"meta,omitempty"`
	MyNotes              string                 `json:"my_notes,omitempty"`
	NetworkRestrictions  string                 `json:"network_restrictions,omitempty"`
	Nickname             string                 `json:"nickname,omitempty"`
	Phone                string                 `json:"phone,omitempty"`
	Postcode             string                 `json:"postcode,omitempty"`
	Reseller             string                 `json:"reseller,omitempty"`
	SignupTime           string                 `json:"signup_time,omitempty"`
	State                string                 `json:"state,omitempty"`
	TaxName              string                 `json:"tax_name,omitempty"`
	TaxRate              string                 `json:"tax_rate,omitempty"`
	Title                string                 `json:"title,omitempty"`
	Town                 string                 `json:"town,omitempty"`
	TxAutoTopUpAmount    string                 `json:"tx_autotopup_amount,omitempty"`
	TxAutoTopUpThreshold string                 `json:"tx_autotopup_threshold,omitempty"`
	UUID                 string                 `json:"uuid"`
	VAT                  string                 `json:"vat,omitempty"`
}

Profile represents a CloudSigma user profile.

type ProfileService added in v0.2.1

type ProfileService service

ProfileService handles communication with the profile related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/profile.html

func (*ProfileService) Get added in v0.2.1

func (s *ProfileService) Get(ctx context.Context) (*Profile, *Response, error)

Get provides information for an user profile.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/profile.html#listing

func (*ProfileService) Update added in v0.2.1

func (s *ProfileService) Update(ctx context.Context, updateRequest *ProfileUpdateRequest) (*Profile, *Response, error)

Update edits a user profile.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/profile.html#editing

type ProfileUpdateRequest added in v0.2.1

type ProfileUpdateRequest struct {
	*Profile
}

ProfileUpdateRequest represents a request to update a profile.

type PubkeysService added in v0.5.0

type PubkeysService service

PubkeysService handles communication with the pubkeys (SSH keys) related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/keypairs.html#pubkeys-resource

func (*PubkeysService) Get added in v0.5.0

func (s *PubkeysService) Get(ctx context.Context, uuid string) (*Keypair, *Response, error)

Get provides information for keypair identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/keypairs.html#pubkeys-resource

func (*PubkeysService) List added in v0.5.0

func (s *PubkeysService) List(ctx context.Context) ([]Keypair, *Response, error)

List provides a list of keypairs.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/keypairs.html#pubkeys-resource

type RemoteSnapshot added in v0.7.0

type RemoteSnapshot struct {
	Location                    string                       `json:"location,omitempty"`
	RemoteSnapshotDriveMetadata *RemoteSnapshotDriveMetadata `json:"drive_meta,omitempty"`
	Snapshot
}

RemoteSnapshot represents a CloudSigma remote snapshot.

func (RemoteSnapshot) String added in v0.7.0

func (r RemoteSnapshot) String() string

type RemoteSnapshotCreateRequest added in v0.7.0

type RemoteSnapshotCreateRequest struct {
	RemoteSnapshots []RemoteSnapshot `json:"objects"`
}

RemoteSnapshotCreateRequest represents a request to create a remote snapshot.

type RemoteSnapshotDriveMetadata added in v0.7.0

type RemoteSnapshotDriveMetadata struct {
	Media       string `json:"media,omitempty"`
	Name        string `json:"name,omitempty"`
	Size        int    `json:"size,omitempty"`
	SourceUUID  string `json:"src_uuid,omitempty"`
	StorageType string `json:"storage_type,omitempty"`
}

RemoteSnapshotDriveMetadata represents a CloudSigma snapshot drive meta.

type RemoteSnapshotUpdateRequest added in v0.7.0

type RemoteSnapshotUpdateRequest struct {
	*RemoteSnapshot
}

RemoteSnapshotUpdateRequest represents a request to update a remote snapshot.

type RemoteSnapshotsService added in v0.7.0

type RemoteSnapshotsService service

RemoteSnapshotsService handles communication with the remote snapshot related methods of the CloudSigma API.

func (*RemoteSnapshotsService) Create added in v0.7.0

Create makes a new remote snapshot with given payload.

func (*RemoteSnapshotsService) Delete added in v0.7.0

func (s *RemoteSnapshotsService) Delete(ctx context.Context, uuid string) (*Response, error)

Delete removes a remote snapshot identified by uuid.

func (*RemoteSnapshotsService) Get added in v0.7.0

Get provides detail information for remote snapshot identified by uuid.

func (*RemoteSnapshotsService) List added in v0.7.0

List provides a detailed list of remote snapshots to which the authenticated user has access.

func (*RemoteSnapshotsService) Update added in v0.7.0

Update edits a remote snapshot identified by uuid.

type ResourceLink struct {
	ResourceURI string `json:"resource_uri,omitempty"`
	UUID        string `json:"uuid,omitempty"`
}

ResourceLink represents a link to other CloudSigma resource.

type Response

type Response struct {
	*http.Response

	Meta *Meta // Meta describes generic information about the response.

	RequestID string // RequestID returned from the API, useful to contact support.
}

Response is a CloudSigma response. This wraps the standard http.Response.

type Server

type Server struct {
	AutoStart          bool                   `json:"auto_start,omitempty"`
	Context            bool                   `json:"context,omitempty"`
	CPU                int                    `json:"cpu,omitempty"`
	CPUType            string                 `json:"cpu_type,omitempty"`
	CPUsInsteadOfCores bool                   `json:"cpus_instead_of_cores,omitempty"`
	Drives             []ServerDrive          `json:"drives,omitempty"`
	EnableNuma         bool                   `json:"enable_numa,omitempty"`
	EnclavePageCaches  []EnclavePageCache     `json:"epcs,omitempty"`
	Hypervisor         string                 `json:"hypervisor,omitempty"`
	Memory             int                    `json:"mem,omitempty"`
	Meta               map[string]interface{} `json:"meta,omitempty"`
	Name               string                 `json:"name,omitempty"`
	NICs               []ServerNIC            `json:"nics,omitempty"`
	Owner              *ResourceLink          `json:"owner,omitempty"`
	PublicKeys         []Keypair              `json:"pubkeys,omitempty"`
	ResourceURI        string                 `json:"resource_uri,omitempty"`
	Runtime            *ServerRuntime         `json:"runtime,omitempty"`
	SMP                int                    `json:"smp,omitempty"`
	Status             string                 `json:"status,omitempty"`
	Tags               []Tag                  `json:"tags,omitempty"`
	UUID               string                 `json:"uuid,omitempty"`
	VNCPassword        string                 `json:"vnc_password,omitempty"`
}

Server represents a CloudSigma server.

type ServerAction

type ServerAction struct {
	Action string `json:"action,omitempty"`
	Result string `json:"result,omitempty"`
	UUID   string `json:"uuid,omitempty"`
}

ServerAction represents a CloudSigma server action.

type ServerCreateRequest

type ServerCreateRequest struct {
	Servers []Server `json:"objects"`
}

ServerCreateRequest represents a request to create a server.

type ServerDrive

type ServerDrive struct {
	BootOrder  int    `json:"boot_order,omitempty"`
	DevChannel string `json:"dev_channel,omitempty"`
	Device     string `json:"device,omitempty"`
	Drive      *Drive `json:"drive,omitempty"`
}

ServerDrive represents a CloudSigma drive attached to a server.

type ServerIPConfiguration added in v0.5.0

type ServerIPConfiguration struct {
	Type      string `json:"conf,omitempty"`
	IPAddress *IP    `json:"ip,omitempty"`
}

ServerIPConfiguration represents a CloudSigma public IP configuration.

type ServerNIC added in v0.5.0

type ServerNIC struct {
	BootOrder        int                    `json:"boot_order,omitempty"`
	FirewallPolicy   *FirewallPolicy        `json:"firewall_policy,omitempty"`
	IP4Configuration *ServerIPConfiguration `json:"ip_v4_conf,omitempty"`
	IP6Configuration *ServerIPConfiguration `json:"ip_v6_conf,omitempty"`
	MACAddress       string                 `json:"mac,omitempty"`
	Model            string                 `json:"model,omitempty"`
	VLAN             *VLAN                  `json:"vlan,omitempty"`
}

ServerNIC represents a CloudSigma network interface card attached to a server.

type ServerRuntime added in v0.7.0

type ServerRuntime struct {
	RuntimeNICs []ServerRuntimeNIC `json:"nics,omitempty"`
}

ServerRuntime represents a CloudSigma server runtime information.

type ServerRuntimeIP added in v0.7.0

type ServerRuntimeIP struct {
	ResourceURI string `json:"resource_uri,omitempty"`
	UUID        string `json:"uuid,omitempty"`
}

ServerRuntimeIP represents a CloudSigma server's runtime IP configuration.

type ServerRuntimeNIC added in v0.7.0

type ServerRuntimeNIC struct {
	InterfaceType string          `json:"interface_type,omitempty"`
	IPv4          ServerRuntimeIP `json:"ip_v4,omitempty"`
	IPv6          ServerRuntimeIP `json:"ip_v6,omitempty"`
}

ServerRuntimeNIC represents a CloudSigma server's network interface card runtime.

type ServerUpdateRequest added in v0.4.0

type ServerUpdateRequest struct {
	*Server
}

ServerUpdateRequest represents a request to update a server.

type ServersService

type ServersService service

ServersService handles communication with the servers related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/servers.html

func (*ServersService) Create

func (s *ServersService) Create(ctx context.Context, createRequest *ServerCreateRequest) ([]Server, *Response, error)

Create makes a new virtual server with given payload.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/servers.html#creating

func (*ServersService) Delete

func (s *ServersService) Delete(ctx context.Context, uuid string) (*Response, error)

Delete removes a single server identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/servers.html#deleting

func (*ServersService) Get

func (s *ServersService) Get(ctx context.Context, uuid string) (*Server, *Response, error)

Get provides detailed information for server identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/servers.html#server-runtime-and-server-details

func (*ServersService) List added in v0.4.0

func (s *ServersService) List(ctx context.Context) ([]Server, *Response, error)

List provides a detailed list of servers to which the authenticated user has access.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/servers.html#detailed-listing

func (*ServersService) Shutdown

func (s *ServersService) Shutdown(ctx context.Context, uuid string) (*ServerAction, *Response, error)

Shutdown sends an ACPI shutdowns to a server with specific UUID for a minute.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/servers.html#acpi-shutdown

func (*ServersService) Start

func (s *ServersService) Start(ctx context.Context, uuid string) (*ServerAction, *Response, error)

Start sends 'start' action and starts a server with specific uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/servers.html#start

func (*ServersService) Stop

func (s *ServersService) Stop(ctx context.Context, uuid string) (*ServerAction, *Response, error)

Stop sends 'stop' action and stops a server with specific uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/servers.html#stop

func (*ServersService) Update added in v0.4.0

func (s *ServersService) Update(ctx context.Context, uuid string, updateRequest *ServerUpdateRequest) (*Server, *Response, error)

Update edits a server identified by uuid. Used also for attaching NIC’s and drives to servers. Note that if a server is running, only name, meta, and tags fields can be changed, and all other changes to the definition of a running server will be ignored.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/servers.html#editing

type Snapshot added in v0.5.0

type Snapshot struct {
	AllocatedSize int                    `json:"allocated_size,omitempty"`
	Drive         *Drive                 `json:"drive,omitempty"`
	Meta          map[string]interface{} `json:"meta,omitempty"`
	Name          string                 `json:"name,omitempty"`
	Owner         *ResourceLink          `json:"owner,omitempty"`
	ResourceURI   string                 `json:"resource_uri,omitempty"`
	Status        string                 `json:"status,omitempty"`
	Tags          []Tag                  `json:"tags"`
	Timestamp     string                 `json:"timestamp,omitempty"`
	UUID          string                 `json:"uuid,omitempty"`
}

Snapshot represents a CloudSigma snapshot.

func (*Snapshot) MarshalJSON added in v0.6.0

func (s *Snapshot) MarshalJSON() ([]byte, error)

MarshalJSON is a custom marshaller for Snapshot. It creates an empty array if Tags is nil.

func (Snapshot) String added in v0.7.0

func (s Snapshot) String() string

type SnapshotCreateRequest added in v0.5.0

type SnapshotCreateRequest struct {
	Snapshots []Snapshot `json:"objects"`
}

SnapshotCreateRequest represents a request to create a snapshot.

type SnapshotUpdateRequest added in v0.5.0

type SnapshotUpdateRequest struct {
	*Snapshot
}

SnapshotUpdateRequest represents a request to update a snapshot.

type SnapshotsService added in v0.5.0

type SnapshotsService service

SnapshotsService handles communication with the snapshot related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/snapshots.html

func (*SnapshotsService) Create added in v0.5.0

func (s *SnapshotsService) Create(ctx context.Context, createRequest *SnapshotCreateRequest) ([]Snapshot, *Response, error)

Create makes a new snapshot with given payload.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/snapshots.html#creating

func (*SnapshotsService) Delete added in v0.5.0

func (s *SnapshotsService) Delete(ctx context.Context, uuid string) (*Response, error)

Delete removes a snapshot identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/snapshots.html#deleting

func (*SnapshotsService) Get added in v0.5.0

func (s *SnapshotsService) Get(ctx context.Context, uuid string) (*Snapshot, *Response, error)

Get provides detailed information for snapshot identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/snapshots.html#list-single-snapshot

func (*SnapshotsService) List added in v0.5.0

func (s *SnapshotsService) List(ctx context.Context) ([]Snapshot, *Response, error)

List provides a detailed list of snapshots to which the authenticated user has access.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/snapshots.html#detailed-listing

func (*SnapshotsService) Update added in v0.5.0

func (s *SnapshotsService) Update(ctx context.Context, uuid string, updateRequest *SnapshotUpdateRequest) (*Snapshot, *Response, error)

Update edits a snapshot identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/snapshots.html#editing

type Subscription added in v0.3.0

type Subscription struct {
	Amount           string `json:"amount,omitempty"`
	AutoRenew        bool   `json:"auto_renew,omitempty"`
	EndTime          string `json:"end_time,omitempty"`
	FreeTier         bool   `json:"free_tier,omitempty"`
	ID               string `json:"id,omitempty"`
	Period           string `json:"period,omitempty"`
	Price            string `json:"price,omitempty"`
	Remaining        string `json:"remaining,omitempty"`
	Resource         string `json:"resource,omitempty"`
	ResourceURI      string `json:"resource_uri,omitempty"`
	StartTime        string `json:"start_time,omitempty"`
	Status           string `json:"status,omitempty"`
	SubscribedObject string `json:"subscribed_object,omitempty"`
	UUID             string `json:"uuid,omitempty"`
}

Subscription represents a CloudSigma subscription.

type SubscriptionCreateRequest added in v0.3.0

type SubscriptionCreateRequest struct {
	Subscriptions []Subscription `json:"objects"`
}

SubscriptionCreateRequest represents a request to create a subscription.

type SubscriptionsService added in v0.3.0

type SubscriptionsService service

SubscriptionsService handles communication with the subscriptions related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/subscriptions.html

func (*SubscriptionsService) Create added in v0.3.0

Create makes a new subscription with given payload.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/subscriptions.html#creating

func (*SubscriptionsService) List added in v0.3.0

List provides a list of subscriptions of the user.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/subscriptions.html#listing

type Tag

type Tag struct {
	Meta        map[string]interface{} `json:"meta,omitempty"`
	Name        string                 `json:"name,omitempty"`
	Owner       *ResourceLink          `json:"owner,omitempty"`
	ResourceURI string                 `json:"resource_uri,omitempty"`
	Resources   []TagResource          `json:"resources,omitempty"`
	UUID        string                 `json:"uuid,omitempty"`
}

Tag represents a CloudSigma tag.

func (Tag) String added in v0.7.0

func (t Tag) String() string

type TagCreateRequest

type TagCreateRequest struct {
	Tags []Tag `json:"objects"`
}

TagCreateRequest represents a request to create a tag.

type TagResource

type TagResource struct {
	Owner        *ResourceLink `json:"owner,omitempty"`
	ResourceType string        `json:"res_type,omitempty"`
	ResourceURI  string        `json:"resource_uri,omitempty"`
	UUID         string        `json:"uuid,omitempty"`
}

TagResource represents a resource assigned to the tag.

type TagUpdateRequest

type TagUpdateRequest struct {
	*Tag
}

TagUpdateRequest represents a request to update a tag.

type TagsService

type TagsService service

TagsService handles communication with the tags related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/tags.html

func (*TagsService) Create

func (s *TagsService) Create(ctx context.Context, createRequest *TagCreateRequest) ([]Tag, *Response, error)

Create makes a new tag (or tags) with given payload.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/tags.html#creating

func (*TagsService) Delete

func (s *TagsService) Delete(ctx context.Context, uuid string) (*Response, error)

Delete removes a single tag identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/tags.html#deleting

func (*TagsService) Get

func (s *TagsService) Get(ctx context.Context, uuid string) (*Tag, *Response, error)

Get provides detailed information for tag identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/tags.html#list-single-tag

func (*TagsService) List

func (s *TagsService) List(ctx context.Context) ([]Tag, *Response, error)

List provides a list of tags to which the authenticated user has access.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/tags.html#listing

func (*TagsService) Update

func (s *TagsService) Update(ctx context.Context, uuid string, updateRequest *TagUpdateRequest) (*Tag, *Response, error)

Update edits a tag identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/tags.html#editing

type TokenCredentialsProvider added in v0.14.0

type TokenCredentialsProvider struct {
	Value Credentials
}

func NewTokenCredentialsProvider added in v0.14.0

func NewTokenCredentialsProvider(token string) TokenCredentialsProvider

func (TokenCredentialsProvider) Retrieve added in v0.14.0

func (p TokenCredentialsProvider) Retrieve() (Credentials, error)

type UsernamePasswordCredentialsProvider added in v0.14.0

type UsernamePasswordCredentialsProvider struct {
	Value Credentials
}

func NewUsernamePasswordCredentialsProvider added in v0.14.0

func NewUsernamePasswordCredentialsProvider(username, password string) UsernamePasswordCredentialsProvider

func (UsernamePasswordCredentialsProvider) Retrieve added in v0.14.0

type VLAN added in v0.3.0

type VLAN struct {
	Meta         map[string]interface{} `json:"meta,omitempty"`
	Owner        *ResourceLink          `json:"owner,omitempty"`
	ResourceURI  string                 `json:"resource_uri,omitempty"`
	Servers      []ResourceLink         `json:"servers,omitempty"`
	Subscription *VLANSubscription      `json:"subscription,omitempty"`
	Tags         []Tag                  `json:"tags,omitempty"`
	UUID         string                 `json:"uuid,omitempty"`
}

VLAN represents a CloudSigma VLAN.

func (VLAN) String added in v0.7.0

func (v VLAN) String() string

type VLANSubscription added in v0.3.0

type VLANSubscription struct {
	ID          int    `json:"id"`
	ResourceURI string `json:"resource_uri,omitempty"`
}

VLANSubscription represents a CloudSigma subscription reference.

type VLANUpdateRequest added in v0.3.0

type VLANUpdateRequest struct {
	*VLAN
}

VLANUpdateRequest represents a request to update a VLAN.

type VLANsService added in v0.3.0

type VLANsService service

VLANsService handles communication with the VLAN related methods of the CloudSigma API.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/networking.html#vlan

func (*VLANsService) Get added in v0.3.0

func (s *VLANsService) Get(ctx context.Context, uuid string) (*VLAN, *Response, error)

Get provides detailed information for VLAN identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/networking.html#get-single-vlan

func (*VLANsService) List added in v0.3.0

func (s *VLANsService) List(ctx context.Context) ([]VLAN, *Response, error)

List provides a list of VLANs to which the authenticated user has access.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/networking.html#detailed-listing

func (*VLANsService) Update added in v0.3.0

func (s *VLANsService) Update(ctx context.Context, uuid string, vlanUpdateRequest *VLANUpdateRequest) (*VLAN, *Response, error)

Update edits a VLAN identified by uuid.

CloudSigma API docs: https://cloudsigma-docs.readthedocs.io/en/latest/networking.html#editing

Jump to

Keyboard shortcuts

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