instance

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: Apache-2.0 Imports: 20 Imported by: 45

Documentation

Overview

Package instance provides methods and message types of the instance v1 API.

Index

Constants

View Source
const (
	// ArchX86_64 is [insert doc].
	ArchX86_64 = Arch("x86_64")
	// ArchArm is [insert doc].
	ArchArm = Arch("arm")
)
View Source
const (
	// BootTypeLocal is [insert doc].
	BootTypeLocal = BootType("local")
	// BootTypeBootscript is [insert doc].
	BootTypeBootscript = BootType("bootscript")
	// BootTypeRescue is [insert doc].
	BootTypeRescue = BootType("rescue")
)
View Source
const (
	// ImageStateAvailable is [insert doc].
	ImageStateAvailable = ImageState("available")
	// ImageStateCreating is [insert doc].
	ImageStateCreating = ImageState("creating")
	// ImageStateError is [insert doc].
	ImageStateError = ImageState("error")
)
View Source
const (
	// PlacementGroupPolicyModeOptional is [insert doc].
	PlacementGroupPolicyModeOptional = PlacementGroupPolicyMode("optional")
	// PlacementGroupPolicyModeEnforced is [insert doc].
	PlacementGroupPolicyModeEnforced = PlacementGroupPolicyMode("enforced")
)
View Source
const (
	// PlacementGroupPolicyTypeMaxAvailability is [insert doc].
	PlacementGroupPolicyTypeMaxAvailability = PlacementGroupPolicyType("max_availability")
	// PlacementGroupPolicyTypeLowLatency is [insert doc].
	PlacementGroupPolicyTypeLowLatency = PlacementGroupPolicyType("low_latency")
)
View Source
const (
	// SecurityGroupPolicyAccept is [insert doc].
	SecurityGroupPolicyAccept = SecurityGroupPolicy("accept")
	// SecurityGroupPolicyDrop is [insert doc].
	SecurityGroupPolicyDrop = SecurityGroupPolicy("drop")
)
View Source
const (
	// SecurityGroupRuleActionAccept is [insert doc].
	SecurityGroupRuleActionAccept = SecurityGroupRuleAction("accept")
	// SecurityGroupRuleActionDrop is [insert doc].
	SecurityGroupRuleActionDrop = SecurityGroupRuleAction("drop")
)
View Source
const (
	// SecurityGroupRuleDirectionInbound is [insert doc].
	SecurityGroupRuleDirectionInbound = SecurityGroupRuleDirection("inbound")
	// SecurityGroupRuleDirectionOutbound is [insert doc].
	SecurityGroupRuleDirectionOutbound = SecurityGroupRuleDirection("outbound")
)
View Source
const (
	// SecurityGroupRuleProtocolTCP is [insert doc].
	SecurityGroupRuleProtocolTCP = SecurityGroupRuleProtocol("TCP")
	// SecurityGroupRuleProtocolUDP is [insert doc].
	SecurityGroupRuleProtocolUDP = SecurityGroupRuleProtocol("UDP")
	// SecurityGroupRuleProtocolICMP is [insert doc].
	SecurityGroupRuleProtocolICMP = SecurityGroupRuleProtocol("ICMP")
	// SecurityGroupRuleProtocolANY is [insert doc].
	SecurityGroupRuleProtocolANY = SecurityGroupRuleProtocol("ANY")
)
View Source
const (
	// ServerActionPoweron is [insert doc].
	ServerActionPoweron = ServerAction("poweron")
	// ServerActionBackup is [insert doc].
	ServerActionBackup = ServerAction("backup")
	// ServerActionStopInPlace is [insert doc].
	ServerActionStopInPlace = ServerAction("stop_in_place")
	// ServerActionPoweroff is [insert doc].
	ServerActionPoweroff = ServerAction("poweroff")
	// ServerActionTerminate is [insert doc].
	ServerActionTerminate = ServerAction("terminate")
	// ServerActionReboot is [insert doc].
	ServerActionReboot = ServerAction("reboot")
)
View Source
const (
	// ServerStateRunning is [insert doc].
	ServerStateRunning = ServerState("running")
	// ServerStateStopped is [insert doc].
	ServerStateStopped = ServerState("stopped")
	// ServerStateStoppedInPlace is [insert doc].
	ServerStateStoppedInPlace = ServerState("stopped in place")
	// ServerStateStarting is [insert doc].
	ServerStateStarting = ServerState("starting")
	// ServerStateStopping is [insert doc].
	ServerStateStopping = ServerState("stopping")
	// ServerStateLocked is [insert doc].
	ServerStateLocked = ServerState("locked")
)
View Source
const (
	// ServerTypesAvailabilityAvailable is [insert doc].
	ServerTypesAvailabilityAvailable = ServerTypesAvailability("available")
	// ServerTypesAvailabilityScarce is [insert doc].
	ServerTypesAvailabilityScarce = ServerTypesAvailability("scarce")
	// ServerTypesAvailabilityShortage is [insert doc].
	ServerTypesAvailabilityShortage = ServerTypesAvailability("shortage")
)
View Source
const (
	// SnapshotStateAvailable is [insert doc].
	SnapshotStateAvailable = SnapshotState("available")
	// SnapshotStateSnapshotting is [insert doc].
	SnapshotStateSnapshotting = SnapshotState("snapshotting")
	// SnapshotStateError is [insert doc].
	SnapshotStateError = SnapshotState("error")
)
View Source
const (
	// TaskStatusPending is [insert doc].
	TaskStatusPending = TaskStatus("pending")
	// TaskStatusStarted is [insert doc].
	TaskStatusStarted = TaskStatus("started")
	// TaskStatusSuccess is [insert doc].
	TaskStatusSuccess = TaskStatus("success")
	// TaskStatusFailure is [insert doc].
	TaskStatusFailure = TaskStatus("failure")
	// TaskStatusRetry is [insert doc].
	TaskStatusRetry = TaskStatus("retry")
)
View Source
const (
	// VolumeStateAvailable is [insert doc].
	VolumeStateAvailable = VolumeState("available")
	// VolumeStateSnapshotting is [insert doc].
	VolumeStateSnapshotting = VolumeState("snapshotting")
	// VolumeStateError is [insert doc].
	VolumeStateError = VolumeState("error")
)
View Source
const (
	// VolumeTypeLSSD is [insert doc].
	VolumeTypeLSSD = VolumeType("l_ssd")
	// VolumeTypeBSSD is [insert doc].
	VolumeTypeBSSD = VolumeType("b_ssd")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API instance API

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) AttachIP

func (s *API) AttachIP(req *AttachIPRequest, opts ...scw.RequestOption) (*AttachIPResponse, error)

AttachIP attaches an IP to a server.

func (*API) AttachVolume

func (s *API) AttachVolume(req *AttachVolumeRequest, opts ...scw.RequestOption) (*AttachVolumeResponse, error)

AttachVolume attaches a volume to a server

Note: Implementation is thread-safe.

func (*API) CreateIP

func (s *API) CreateIP(req *CreateIPRequest, opts ...scw.RequestOption) (*CreateIPResponse, error)

CreateIP reserve an IP

func (*API) CreateImage

func (s *API) CreateImage(req *CreateImageRequest, opts ...scw.RequestOption) (*CreateImageResponse, error)

CreateImage create image

func (*API) CreatePlacementGroup

func (s *API) CreatePlacementGroup(req *CreatePlacementGroupRequest, opts ...scw.RequestOption) (*CreatePlacementGroupResponse, error)

CreatePlacementGroup create placement group

Create a new placement group.

func (*API) CreateSecurityGroup

func (s *API) CreateSecurityGroup(req *CreateSecurityGroupRequest, opts ...scw.RequestOption) (*CreateSecurityGroupResponse, error)

CreateSecurityGroup create security group

func (*API) CreateSecurityGroupRule

func (s *API) CreateSecurityGroupRule(req *CreateSecurityGroupRuleRequest, opts ...scw.RequestOption) (*CreateSecurityGroupRuleResponse, error)

CreateSecurityGroupRule create rule

func (*API) CreateServer

func (s *API) CreateServer(req *CreateServerRequest, opts ...scw.RequestOption) (*CreateServerResponse, error)

CreateServer creates a server.

func (*API) CreateSnapshot

func (s *API) CreateSnapshot(req *CreateSnapshotRequest, opts ...scw.RequestOption) (*CreateSnapshotResponse, error)

CreateSnapshot create snapshot

func (*API) CreateVolume

func (s *API) CreateVolume(req *CreateVolumeRequest, opts ...scw.RequestOption) (*CreateVolumeResponse, error)

CreateVolume create volume

func (*API) DeleteIP

func (s *API) DeleteIP(req *DeleteIPRequest, opts ...scw.RequestOption) error

DeleteIP delete IP

Delete the IP with the given ID.

func (*API) DeleteImage

func (s *API) DeleteImage(req *DeleteImageRequest, opts ...scw.RequestOption) error

DeleteImage delete image

Delete the image with the given ID.

func (*API) DeletePlacementGroup

func (s *API) DeletePlacementGroup(req *DeletePlacementGroupRequest, opts ...scw.RequestOption) error

DeletePlacementGroup delete the given placement group

Delete the given placement group.

func (*API) DeleteSecurityGroup

func (s *API) DeleteSecurityGroup(req *DeleteSecurityGroupRequest, opts ...scw.RequestOption) error

DeleteSecurityGroup delete security group

func (*API) DeleteSecurityGroupRule

func (s *API) DeleteSecurityGroupRule(req *DeleteSecurityGroupRuleRequest, opts ...scw.RequestOption) error

DeleteSecurityGroupRule delete rule

Delete a security group rule with the given ID.

func (*API) DeleteServer

func (s *API) DeleteServer(req *DeleteServerRequest, opts ...scw.RequestOption) error

DeleteServer delete server

Delete a server with the given ID.

func (*API) DeleteServerUserData

func (s *API) DeleteServerUserData(req *DeleteServerUserDataRequest, opts ...scw.RequestOption) error

DeleteServerUserData delete user data

Delete the given key from a server user data.

func (*API) DeleteSnapshot

func (s *API) DeleteSnapshot(req *DeleteSnapshotRequest, opts ...scw.RequestOption) error

DeleteSnapshot delete snapshot

Delete the snapshot with the given ID.

func (*API) DeleteVolume

func (s *API) DeleteVolume(req *DeleteVolumeRequest, opts ...scw.RequestOption) error

DeleteVolume delete volume

Delete the volume with the given ID.

func (*API) DetachIP

func (s *API) DetachIP(req *DetachIPRequest, opts ...scw.RequestOption) (*DetachIPResponse, error)

DetachIP detaches an IP from a server.

func (*API) DetachVolume

func (s *API) DetachVolume(req *DetachVolumeRequest, opts ...scw.RequestOption) (*DetachVolumeResponse, error)

DetachVolume detaches a volume from a server

Note: Implementation is thread-safe.

func (*API) GetAllServerUserData

func (s *API) GetAllServerUserData(req *GetAllServerUserDataRequest, opts ...scw.RequestOption) (*GetAllServerUserDataResponse, error)

GetAllServerUserData gets all user data on a server.

func (*API) GetBootscript

func (s *API) GetBootscript(req *GetBootscriptRequest, opts ...scw.RequestOption) (*GetBootscriptResponse, error)

GetBootscript get bootscripts

Get details of a bootscript with the given ID.

func (*API) GetDashboard

func (s *API) GetDashboard(req *GetDashboardRequest, opts ...scw.RequestOption) (*GetDashboardResponse, error)

func (*API) GetIP

func (s *API) GetIP(req *GetIPRequest, opts ...scw.RequestOption) (*GetIPResponse, error)

GetIP get IP

Get details of an IP with the given ID or address.

func (*API) GetImage

func (s *API) GetImage(req *GetImageRequest, opts ...scw.RequestOption) (*GetImageResponse, error)

GetImage get image

Get details of an image with the given ID.

func (*API) GetPlacementGroup

func (s *API) GetPlacementGroup(req *GetPlacementGroupRequest, opts ...scw.RequestOption) (*GetPlacementGroupResponse, error)

GetPlacementGroup get placement group

Get the given placement group.

func (*API) GetPlacementGroupServers

func (s *API) GetPlacementGroupServers(req *GetPlacementGroupServersRequest, opts ...scw.RequestOption) (*GetPlacementGroupServersResponse, error)

GetPlacementGroupServers get placement group servers

Get all servers belonging to the given placement group.

func (*API) GetSecurityGroup

func (s *API) GetSecurityGroup(req *GetSecurityGroupRequest, opts ...scw.RequestOption) (*GetSecurityGroupResponse, error)

GetSecurityGroup get security group

Get the details of a Security Group with the given ID.

func (*API) GetSecurityGroupRule

func (s *API) GetSecurityGroupRule(req *GetSecurityGroupRuleRequest, opts ...scw.RequestOption) (*GetSecurityGroupRuleResponse, error)

GetSecurityGroupRule get rule

Get details of a security group rule with the given ID.

func (*API) GetServer

func (s *API) GetServer(req *GetServerRequest, opts ...scw.RequestOption) (*GetServerResponse, error)

GetServer get server

Get the details of a specified Server.

func (*API) GetServerType

func (s *API) GetServerType(req *GetServerTypeRequest) (*ServerType, error)

GetServerType get server type info by it's name.

func (*API) GetServerTypesAvailability

func (s *API) GetServerTypesAvailability(req *GetServerTypesAvailabilityRequest, opts ...scw.RequestOption) (*GetServerTypesAvailabilityResponse, error)

GetServerTypesAvailability get availability

Get availibility for all server types.

func (*API) GetServerUserData

func (s *API) GetServerUserData(req *GetServerUserDataRequest, opts ...scw.RequestOption) (io.Reader, error)

GetServerUserData gets the content of a user data on a server for the given key.

func (*API) GetSnapshot

func (s *API) GetSnapshot(req *GetSnapshotRequest, opts ...scw.RequestOption) (*GetSnapshotResponse, error)

GetSnapshot get snapshot

Get details of a snapshot with the given ID.

func (*API) GetVolume

func (s *API) GetVolume(req *GetVolumeRequest, opts ...scw.RequestOption) (*GetVolumeResponse, error)

GetVolume get volume

Get details of a volume with the given ID.

func (*API) ListBootscripts

func (s *API) ListBootscripts(req *ListBootscriptsRequest, opts ...scw.RequestOption) (*ListBootscriptsResponse, error)

ListBootscripts list bootscripts

func (*API) ListIPs

func (s *API) ListIPs(req *ListIPsRequest, opts ...scw.RequestOption) (*ListIPsResponse, error)

ListIPs list IPs

func (*API) ListImages

func (s *API) ListImages(req *ListImagesRequest, opts ...scw.RequestOption) (*ListImagesResponse, error)

ListImages list images

List all images available in an account.

func (*API) ListPlacementGroups

func (s *API) ListPlacementGroups(req *ListPlacementGroupsRequest, opts ...scw.RequestOption) (*ListPlacementGroupsResponse, error)

ListPlacementGroups list placement groups

List all placement groups.

func (*API) ListSecurityGroupRules

func (s *API) ListSecurityGroupRules(req *ListSecurityGroupRulesRequest, opts ...scw.RequestOption) (*ListSecurityGroupRulesResponse, error)

ListSecurityGroupRules list rules

func (*API) ListSecurityGroups

func (s *API) ListSecurityGroups(req *ListSecurityGroupsRequest, opts ...scw.RequestOption) (*ListSecurityGroupsResponse, error)

ListSecurityGroups list security groups

List all security groups available in an account.

func (*API) ListServerActions

func (s *API) ListServerActions(req *ListServerActionsRequest, opts ...scw.RequestOption) (*ListServerActionsResponse, error)

ListServerActions list server actions

Liste all actions that can currently be performed on a server.

func (*API) ListServerUserData

func (s *API) ListServerUserData(req *ListServerUserDataRequest, opts ...scw.RequestOption) (*ListServerUserDataResponse, error)

ListServerUserData list user data

List all user data keys register on a given server.

func (*API) ListServers

func (s *API) ListServers(req *ListServersRequest, opts ...scw.RequestOption) (*ListServersResponse, error)

ListServers list servers

func (*API) ListServersTypes

func (s *API) ListServersTypes(req *ListServersTypesRequest, opts ...scw.RequestOption) (*ListServersTypesResponse, error)

ListServersTypes list server types

Get server types technical details.

func (*API) ListSnapshots

func (s *API) ListSnapshots(req *ListSnapshotsRequest, opts ...scw.RequestOption) (*ListSnapshotsResponse, error)

ListSnapshots list snapshots

func (*API) ListVolumes

func (s *API) ListVolumes(req *ListVolumesRequest, opts ...scw.RequestOption) (*ListVolumesResponse, error)

ListVolumes list volumes

func (*API) ServerAction

func (s *API) ServerAction(req *ServerActionRequest, opts ...scw.RequestOption) (*ServerActionResponse, error)

ServerAction perform action

Perform power related actions on a server. Be wary that when terminating a server, all the attached volumes (local *and* block storage) are deleted. So, if you want to keep your local volumes, you must use the `archive` action instead of `terminate`. And if you want to keep block-storage volumes, **you must** detach it beforehand you issue the `terminate` call. For more information, read the [Volumes](#volumes-7e8a39) documentation.

func (*API) ServerActionAndWait

func (s *API) ServerActionAndWait(req *ServerActionAndWaitRequest) error

ServerActionAndWait start an action and wait for the server to be in the correct "terminal state" expected by this action.

func (*API) SetAllServerUserData

func (s *API) SetAllServerUserData(req *SetAllServerUserDataRequest, opts ...scw.RequestOption) error

SetAllServerUserData sets all user data on a server.

func (*API) SetPlacementGroup

func (s *API) SetPlacementGroup(req *SetPlacementGroupRequest, opts ...scw.RequestOption) (*SetPlacementGroupResponse, error)

SetPlacementGroup set placement group

Set all parameters of the given placement group.

func (*API) SetPlacementGroupServers

func (s *API) SetPlacementGroupServers(req *SetPlacementGroupServersRequest, opts ...scw.RequestOption) (*SetPlacementGroupServersResponse, error)

SetPlacementGroupServers set placement group servers

Set all servers belonging to the given placement group.

func (*API) SetServerUserData

func (s *API) SetServerUserData(req *SetServerUserDataRequest, opts ...scw.RequestOption) error

SetServerUserData sets the content of a user data on a server for the given key.

func (*API) UpdateIP

func (s *API) UpdateIP(req *UpdateIPRequest, opts ...scw.RequestOption) (*UpdateIPResponse, error)

UpdateIP updates an IP

func (*API) UpdatePlacementGroup

func (s *API) UpdatePlacementGroup(req *UpdatePlacementGroupRequest, opts ...scw.RequestOption) (*UpdatePlacementGroupResponse, error)

UpdatePlacementGroup update placement group

Update one or more parameter of the given placement group.

func (*API) UpdatePlacementGroupServers

func (s *API) UpdatePlacementGroupServers(req *UpdatePlacementGroupServersRequest, opts ...scw.RequestOption) (*UpdatePlacementGroupServersResponse, error)

UpdatePlacementGroupServers update placement group servers

Update all servers belonging to the given placement group.

func (*API) UpdateSecurityGroup

func (s *API) UpdateSecurityGroup(req *UpdateSecurityGroupRequest, opts ...scw.RequestOption) (*UpdateSecurityGroupResponse, error)

UpdateSecurityGroup updates a security group.

func (*API) UpdateSecurityGroupRule

func (s *API) UpdateSecurityGroupRule(req *UpdateSecurityGroupRuleRequest, opts ...scw.RequestOption) (*UpdateSecurityGroupRuleResponse, error)

UpdateSecurityGroupRule updates a security group.

func (*API) UpdateServer

func (s *API) UpdateServer(req *UpdateServerRequest, opts ...scw.RequestOption) (*UpdateServerResponse, error)

UpdateServer updates a server.

Note: Implementation is thread-safe.

func (*API) UpdateVolume

func (s *API) UpdateVolume(req *UpdateVolumeRequest, opts ...scw.RequestOption) (*UpdateVolumeResponse, error)

UpdateVolume updates the set fields on the volume.

func (*API) WaitForServer

func (s *API) WaitForServer(req *WaitForServerRequest) (*Server, error)

WaitForServer wait for the server to be in a "terminal state" before returning. This function can be used to wait for a server to be started for example.

type Arch

type Arch string

func (Arch) MarshalJSON

func (enum Arch) MarshalJSON() ([]byte, error)

func (Arch) String

func (enum Arch) String() string

func (*Arch) UnmarshalJSON

func (enum *Arch) UnmarshalJSON(data []byte) error

type AttachIPRequest

type AttachIPRequest struct {
	Zone     scw.Zone `json:"-"`
	IP       string   `json:"-"`
	ServerID string   `json:"server_id"`
}

AttachIPRequest contains the parameters to attach an IP to a server

type AttachIPResponse

type AttachIPResponse struct {
	IP *IP
}

AttachIPResponse contains the updated IP after attaching

type AttachVolumeRequest

type AttachVolumeRequest struct {
	Zone     scw.Zone `json:"-"`
	ServerID string   `json:"-"`
	VolumeID string   `json:"-"`
}

AttachVolumeRequest contains the parameters to attach a volume to a server

type AttachVolumeResponse

type AttachVolumeResponse struct {
	Server *Server `json:"-"`
}

AttachVolumeResponse contains the updated server after attaching a volume

type BootType

type BootType string

func (BootType) MarshalJSON

func (enum BootType) MarshalJSON() ([]byte, error)

func (BootType) String

func (enum BootType) String() string

func (*BootType) UnmarshalJSON

func (enum *BootType) UnmarshalJSON(data []byte) error

type Bootscript

type Bootscript struct {
	// Bootcmdargs display the bootscript parameters
	Bootcmdargs string `json:"bootcmdargs"`
	// Default dispmay if the bootscript is the default bootscript if no other boot option is configured
	Default bool `json:"default"`
	// Dtb provide information regarding a Device Tree Binary (dtb) for use with C1 servers
	Dtb string `json:"dtb"`
	// ID display the bootscripts ID
	ID string `json:"id"`
	// Initrd display the initrd (initial ramdisk) configuration
	Initrd string `json:"initrd"`
	// Kernel display the server kernel version
	Kernel string `json:"kernel"`
	// Organization display the bootscripts organization
	Organization string `json:"organization"`
	// Public provide information if the bootscript is public
	Public bool `json:"public"`
	// Title display the bootscripts title
	Title string `json:"title"`
	// Arch display the bootscripts arch
	//
	// Default value: x86_64
	Arch Arch `json:"arch"`
}

Bootscript bootscript

type CreateIPRequest

type CreateIPRequest struct {
	Zone scw.Zone `json:"-"`

	Organization string `json:"organization,omitempty"`

	Server *string `json:"server,omitempty"`
}

type CreateIPResponse

type CreateIPResponse struct {
	IP *IP `json:"ip"`

	Location string `json:"Location"`
}

type CreateImageRequest

type CreateImageRequest struct {
	Zone scw.Zone `json:"-"`

	Name string `json:"name,omitempty"`

	RootVolume string `json:"root_volume,omitempty"`
	// Arch
	//
	// Default value: x86_64
	Arch Arch `json:"arch"`

	DefaultBootscript string `json:"default_bootscript,omitempty"`

	ExtraVolumes map[string]*VolumeTemplate `json:"extra_volumes,omitempty"`

	Organization string `json:"organization,omitempty"`

	Public bool `json:"public,omitempty"`
}

type CreateImageResponse

type CreateImageResponse struct {
	Image *Image `json:"image"`

	Location string `json:"Location"`
}

type CreatePlacementGroupRequest

type CreatePlacementGroupRequest struct {
	Zone scw.Zone `json:"-"`

	Name string `json:"name,omitempty"`

	Organization string `json:"organization,omitempty"`
	// PolicyMode
	//
	// Default value: optional
	PolicyMode PlacementGroupPolicyMode `json:"policy_mode"`
	// PolicyType
	//
	// Default value: max_availability
	PolicyType PlacementGroupPolicyType `json:"policy_type"`
}

type CreatePlacementGroupResponse

type CreatePlacementGroupResponse struct {
	PlacementGroup *PlacementGroup `json:"placement_group"`
}

type CreateSecurityGroupRequest

type CreateSecurityGroupRequest struct {
	Zone scw.Zone `json:"-"`

	Name string `json:"name,omitempty"`

	Description string `json:"description,omitempty"`

	Organization string `json:"organization,omitempty"`
	// OrganizationDefault
	//
	// Default value: false
	OrganizationDefault bool `json:"organization_default,omitempty"`
	// Stateful
	//
	// Default value: false
	Stateful bool `json:"stateful,omitempty"`
	// InboundDefaultPolicy
	//
	// Default value: accept
	InboundDefaultPolicy SecurityGroupPolicy `json:"inbound_default_policy"`
	// OutboundDefaultPolicy
	//
	// Default value: accept
	OutboundDefaultPolicy SecurityGroupPolicy `json:"outbound_default_policy"`
}

type CreateSecurityGroupResponse

type CreateSecurityGroupResponse struct {
	SecurityGroup *SecurityGroup `json:"security_group"`
}

type CreateSecurityGroupRuleRequest

type CreateSecurityGroupRuleRequest struct {
	Zone scw.Zone `json:"-"`

	SecurityGroupID string `json:"-"`
	// Protocol
	//
	// Default value: TCP
	Protocol SecurityGroupRuleProtocol `json:"protocol"`
	// Direction
	//
	// Default value: inbound
	Direction SecurityGroupRuleDirection `json:"direction"`
	// Action
	//
	// Default value: accept
	Action SecurityGroupRuleAction `json:"action"`

	IPRange scw.IPNet `json:"ip_range,omitempty"`

	DestPortFrom *uint32 `json:"dest_port_from,omitempty"`

	DestPortTo *uint32 `json:"dest_port_to,omitempty"`

	Position uint32 `json:"position,omitempty"`

	Editable bool `json:"editable,omitempty"`
}

type CreateSecurityGroupRuleResponse

type CreateSecurityGroupRuleResponse struct {
	Rule *SecurityGroupRule `json:"rule"`
}

type CreateServerRequest

type CreateServerRequest struct {
	Zone scw.Zone `json:"-"`
	// Name display the server name
	Name string `json:"name,omitempty"`
	// DynamicIPRequired define if a dynamic IP is required for the instance
	DynamicIPRequired *bool `json:"dynamic_ip_required,omitempty"`
	// CommercialType define the server commercial type (i.e. GP1-S)
	CommercialType string `json:"commercial_type,omitempty"`
	// Image the server image ID or label
	Image string `json:"image,omitempty"`
	// Volumes the volumes attached to the server
	Volumes map[string]*VolumeTemplate `json:"volumes,omitempty"`
	// EnableIPv6 true if IPv6 is enabled on the server
	EnableIPv6 bool `json:"enable_ipv6,omitempty"`
	// PublicIP the ID of the reserved IP to attach to the server
	PublicIP *string `json:"public_ip,omitempty"`
	// BootType the boot type to use
	//
	// Default value: local
	BootType BootType `json:"boot_type"`
	// Bootscript the bootscript ID to use when `boot_type` is set to `bootscript`
	Bootscript *string `json:"bootscript,omitempty"`
	// Organization the server organization ID
	Organization string `json:"organization,omitempty"`
	// Tags the server tags
	Tags []string `json:"tags,omitempty"`
	// SecurityGroup the security group ID
	SecurityGroup *string `json:"security_group,omitempty"`
	// PlacementGroup placement group ID if server must be part of a placement group
	PlacementGroup *string `json:"placement_group,omitempty"`
}

type CreateServerResponse

type CreateServerResponse struct {
	Server *Server `json:"server"`
}

type CreateSnapshotRequest

type CreateSnapshotRequest struct {
	Zone scw.Zone `json:"-"`

	Name string `json:"name,omitempty"`

	VolumeID string `json:"volume_id,omitempty"`

	Organization string `json:"organization,omitempty"`
}

type CreateSnapshotResponse

type CreateSnapshotResponse struct {
	Snapshot *Snapshot `json:"snapshot"`
}

type CreateVolumeRequest

type CreateVolumeRequest struct {
	Zone scw.Zone `json:"-"`

	Name string `json:"name,omitempty"`

	Organization string `json:"organization,omitempty"`
	// VolumeType
	//
	// Default value: l_ssd
	VolumeType VolumeType `json:"volume_type"`

	// Precisely one of BaseSnapshot, BaseVolume, Size must be set.
	Size *scw.Size `json:"size,omitempty"`

	// Precisely one of BaseSnapshot, BaseVolume, Size must be set.
	BaseVolume *string `json:"base_volume,omitempty"`

	// Precisely one of BaseSnapshot, BaseVolume, Size must be set.
	BaseSnapshot *string `json:"base_snapshot,omitempty"`
}

func (*CreateVolumeRequest) GetFrom

func (m *CreateVolumeRequest) GetFrom() From

type CreateVolumeResponse

type CreateVolumeResponse struct {
	Volume *Volume `json:"volume"`

	Location string `json:"Location"`
}

type Dashboard

type Dashboard struct {
	VolumesCount uint32 `json:"volumes_count"`

	RunningServersCount uint32 `json:"running_servers_count"`

	ServersByTypes map[string]uint32 `json:"servers_by_types"`

	ImagesCount uint32 `json:"images_count"`

	SnapshotsCount uint32 `json:"snapshots_count"`

	ServersCount uint32 `json:"servers_count"`

	IPsCount uint32 `json:"ips_count"`

	SecurityGroupsCount uint32 `json:"security_groups_count"`

	IPsUnused uint32 `json:"ips_unused"`
}

type DeleteIPRequest

type DeleteIPRequest struct {
	Zone scw.Zone `json:"-"`

	IPID string `json:"-"`
}

type DeleteImageRequest

type DeleteImageRequest struct {
	Zone scw.Zone `json:"-"`

	ImageID string `json:"-"`
}

type DeletePlacementGroupRequest

type DeletePlacementGroupRequest struct {
	Zone scw.Zone `json:"-"`

	PlacementGroupID string `json:"-"`
}

type DeleteSecurityGroupRequest

type DeleteSecurityGroupRequest struct {
	Zone scw.Zone `json:"-"`

	SecurityGroupID string `json:"-"`
}

type DeleteSecurityGroupRuleRequest

type DeleteSecurityGroupRuleRequest struct {
	Zone scw.Zone `json:"-"`

	SecurityGroupID string `json:"-"`

	SecurityGroupRuleID string `json:"-"`
}

type DeleteServerRequest

type DeleteServerRequest struct {
	Zone scw.Zone `json:"-"`

	ServerID string `json:"-"`
}

type DeleteServerUserDataRequest

type DeleteServerUserDataRequest struct {
	Zone scw.Zone `json:"-"`

	ServerID string `json:"-"`

	Key string `json:"-"`
}

type DeleteSnapshotRequest

type DeleteSnapshotRequest struct {
	Zone scw.Zone `json:"-"`

	SnapshotID string `json:"-"`
}

type DeleteVolumeRequest

type DeleteVolumeRequest struct {
	Zone scw.Zone `json:"-"`

	VolumeID string `json:"-"`
}

type DetachIPRequest

type DetachIPRequest struct {
	Zone scw.Zone `json:"-"`
	IP   string   `json:"-"`
}

DetachIPRequest contains the parameters to detach an IP from a server

type DetachIPResponse

type DetachIPResponse struct {
	IP *IP
}

DetachIPResponse contains the updated IP after detaching

type DetachVolumeRequest

type DetachVolumeRequest struct {
	Zone     scw.Zone `json:"-"`
	VolumeID string   `json:"-"`
}

DetachVolumeRequest contains the parameters to detach a volume from a server

type DetachVolumeResponse

type DetachVolumeResponse struct {
	Server *Server `json:"-"`
}

DetachVolumeResponse contains the updated server after detaching a volume

type From

type From interface {
	// contains filtered or unexported methods
}

type FromBaseSnapshot

type FromBaseSnapshot struct {
	Value string
}

type FromBaseVolume

type FromBaseVolume struct {
	Value string
}

type FromSize

type FromSize struct {
	Value scw.Size
}

type GetAllServerUserDataRequest

type GetAllServerUserDataRequest struct {
	Zone     scw.Zone `json:"-"`
	ServerID string   `json:"-"`
}

GetAllServerUserDataRequest is used by GetAllServerUserData method.

type GetAllServerUserDataResponse

type GetAllServerUserDataResponse struct {
	UserData map[string]io.Reader `json:"-"`
}

GetAllServerUserDataResponse is used by GetAllServerUserData method.

type GetBootscriptRequest

type GetBootscriptRequest struct {
	Zone scw.Zone `json:"-"`

	BootscriptID string `json:"-"`
}

type GetBootscriptResponse

type GetBootscriptResponse struct {
	Bootscript *Bootscript `json:"bootscript"`
}

type GetDashboardRequest

type GetDashboardRequest struct {
	Zone scw.Zone `json:"-"`

	Organization *string `json:"-"`
}

type GetDashboardResponse

type GetDashboardResponse struct {
	Dashboard *Dashboard `json:"dashboard"`
}

type GetIPRequest

type GetIPRequest struct {
	Zone scw.Zone `json:"-"`
	// IP the IP ID or address to get
	IP string `json:"-"`
}

type GetIPResponse

type GetIPResponse struct {
	IP *IP `json:"ip"`
}

type GetImageRequest

type GetImageRequest struct {
	Zone scw.Zone `json:"-"`

	ImageID string `json:"-"`
}

type GetImageResponse

type GetImageResponse struct {
	Image *Image `json:"image"`
}

type GetPlacementGroupRequest

type GetPlacementGroupRequest struct {
	Zone scw.Zone `json:"-"`

	PlacementGroupID string `json:"-"`
}

type GetPlacementGroupResponse

type GetPlacementGroupResponse struct {
	PlacementGroup *PlacementGroup `json:"placement_group"`
}

type GetPlacementGroupServersRequest

type GetPlacementGroupServersRequest struct {
	Zone scw.Zone `json:"-"`

	PlacementGroupID string `json:"-"`
}

type GetPlacementGroupServersResponse

type GetPlacementGroupServersResponse struct {
	Servers []*PlacementGroupServer `json:"servers"`
}

type GetSecurityGroupRequest

type GetSecurityGroupRequest struct {
	Zone scw.Zone `json:"-"`

	SecurityGroupID string `json:"-"`
}

type GetSecurityGroupResponse

type GetSecurityGroupResponse struct {
	SecurityGroup *SecurityGroup `json:"security_group"`
}

type GetSecurityGroupRuleRequest

type GetSecurityGroupRuleRequest struct {
	Zone scw.Zone `json:"-"`

	SecurityGroupID string `json:"-"`

	SecurityGroupRuleID string `json:"-"`
}

type GetSecurityGroupRuleResponse

type GetSecurityGroupRuleResponse struct {
	Rule *SecurityGroupRule `json:"rule"`
}

type GetServerRequest

type GetServerRequest struct {
	Zone scw.Zone `json:"-"`

	ServerID string `json:"-"`
}

type GetServerResponse

type GetServerResponse struct {
	Server *Server `json:"server"`
}

type GetServerTypeRequest

type GetServerTypeRequest struct {
	Zone scw.Zone
	Name string
}

GetServerTypeRequest is used by GetServerType.

type GetServerTypesAvailabilityRequest

type GetServerTypesAvailabilityRequest struct {
	Zone scw.Zone `json:"-"`

	PerPage *uint32 `json:"-"`

	Page *int32 `json:"-"`
}

type GetServerTypesAvailabilityResponse

type GetServerTypesAvailabilityResponse struct {
	Servers map[string]ServerTypesAvailability `json:"servers"`
}

type GetServerUserDataRequest

type GetServerUserDataRequest struct {
	Zone     scw.Zone `json:"-"`
	ServerID string   `json:"-"`

	// Key defines the user data key to get.
	Key string `json:"-"`
}

GetServerUserDataRequest is used by GetServerUserData method.

type GetSnapshotRequest

type GetSnapshotRequest struct {
	Zone scw.Zone `json:"-"`

	SnapshotID string `json:"-"`
}

type GetSnapshotResponse

type GetSnapshotResponse struct {
	Snapshot *Snapshot `json:"snapshot"`
}

type GetVolumeRequest

type GetVolumeRequest struct {
	Zone scw.Zone `json:"-"`

	VolumeID string `json:"-"`
}

type GetVolumeResponse

type GetVolumeResponse struct {
	Volume *Volume `json:"volume"`
}

type IP

type IP struct {
	ID string `json:"id"`

	Address net.IP `json:"address"`

	Reverse *string `json:"reverse"`

	Server *ServerSummary `json:"server"`

	Organization string `json:"organization"`
}

type Image

type Image struct {
	ID string `json:"id"`

	Name string `json:"name"`
	// Arch
	//
	// Default value: x86_64
	Arch Arch `json:"arch"`

	CreationDate time.Time `json:"creation_date"`

	ModificationDate time.Time `json:"modification_date"`

	DefaultBootscript *Bootscript `json:"default_bootscript"`

	ExtraVolumes map[string]*Volume `json:"extra_volumes"`

	FromServer string `json:"from_server"`

	Organization string `json:"organization"`

	Public bool `json:"public"`

	RootVolume *VolumeSummary `json:"root_volume"`
	// State
	//
	// Default value: available
	State ImageState `json:"state"`
}

type ImageState

type ImageState string

func (ImageState) MarshalJSON

func (enum ImageState) MarshalJSON() ([]byte, error)

func (ImageState) String

func (enum ImageState) String() string

func (*ImageState) UnmarshalJSON

func (enum *ImageState) UnmarshalJSON(data []byte) error

type ListBootscriptsRequest

type ListBootscriptsRequest struct {
	Zone scw.Zone `json:"-"`

	Arch *string `json:"-"`

	Title *string `json:"-"`

	Default *bool `json:"-"`

	Public *bool `json:"-"`

	PerPage *uint32 `json:"-"`

	Page *int32 `json:"-"`
}

type ListBootscriptsResponse

type ListBootscriptsResponse struct {
	Bootscripts []*Bootscript `json:"bootscripts"`

	TotalCount uint32 `json:"total_count"`
}

func (*ListBootscriptsResponse) UnsafeAppend

func (r *ListBootscriptsResponse) UnsafeAppend(res interface{}) (uint32, scw.SdkError)

UnsafeAppend should not be used Internal usage only

func (*ListBootscriptsResponse) UnsafeGetTotalCount

func (r *ListBootscriptsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

func (*ListBootscriptsResponse) UnsafeSetTotalCount

func (r *ListBootscriptsResponse) UnsafeSetTotalCount(totalCount int)

UnsafeSetTotalCount should not be used Internal usage only

type ListIPsRequest

type ListIPsRequest struct {
	Zone scw.Zone `json:"-"`

	Organization *string `json:"-"`

	Name *string `json:"-"`

	PerPage *uint32 `json:"-"`

	Page *int32 `json:"-"`
}

type ListIPsResponse

type ListIPsResponse struct {
	IPs []*IP `json:"ips"`

	TotalCount uint32 `json:"total_count"`
}

func (*ListIPsResponse) UnsafeAppend

func (r *ListIPsResponse) UnsafeAppend(res interface{}) (uint32, scw.SdkError)

UnsafeAppend should not be used Internal usage only

func (*ListIPsResponse) UnsafeGetTotalCount

func (r *ListIPsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

func (*ListIPsResponse) UnsafeSetTotalCount

func (r *ListIPsResponse) UnsafeSetTotalCount(totalCount int)

UnsafeSetTotalCount should not be used Internal usage only

type ListImagesRequest

type ListImagesRequest struct {
	Zone scw.Zone `json:"-"`

	Organization *string `json:"-"`

	PerPage *uint32 `json:"-"`

	Page *int32 `json:"-"`

	Name *string `json:"-"`

	Public *bool `json:"-"`

	Arch *string `json:"-"`
}

type ListImagesResponse

type ListImagesResponse struct {
	Images []*Image `json:"images"`

	TotalCount uint32 `json:"total_count"`
}

func (*ListImagesResponse) UnsafeAppend

func (r *ListImagesResponse) UnsafeAppend(res interface{}) (uint32, scw.SdkError)

UnsafeAppend should not be used Internal usage only

func (*ListImagesResponse) UnsafeGetTotalCount

func (r *ListImagesResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

func (*ListImagesResponse) UnsafeSetTotalCount

func (r *ListImagesResponse) UnsafeSetTotalCount(totalCount int)

UnsafeSetTotalCount should not be used Internal usage only

type ListPlacementGroupsRequest

type ListPlacementGroupsRequest struct {
	Zone scw.Zone `json:"-"`
	// PerPage a positive integer lower or equal to 100 to select the number of items to display
	//
	// Default value: 20
	PerPage *uint32 `json:"-"`
	// Page a positive integer to choose the page to display
	Page *int32 `json:"-"`
	// Organization list only placement groups of this organization
	Organization *string `json:"-"`
	// Name filter placement groups by name (for eg. "cluster1" will return "cluster100" and "cluster1" but not "foo")
	Name *string `json:"-"`
}

type ListPlacementGroupsResponse

type ListPlacementGroupsResponse struct {
	PlacementGroups []*PlacementGroup `json:"placement_groups"`

	TotalCount uint32 `json:"total_count"`
}

func (*ListPlacementGroupsResponse) UnsafeAppend

func (r *ListPlacementGroupsResponse) UnsafeAppend(res interface{}) (uint32, scw.SdkError)

UnsafeAppend should not be used Internal usage only

func (*ListPlacementGroupsResponse) UnsafeGetTotalCount

func (r *ListPlacementGroupsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListSecurityGroupRulesRequest

type ListSecurityGroupRulesRequest struct {
	Zone scw.Zone `json:"-"`

	SecurityGroupID string `json:"-"`

	PerPage *uint32 `json:"-"`

	Page *int32 `json:"-"`
}

type ListSecurityGroupRulesResponse

type ListSecurityGroupRulesResponse struct {
	Rules []*SecurityGroupRule `json:"rules"`

	TotalCount uint32 `json:"total_count"`
}

func (*ListSecurityGroupRulesResponse) UnsafeAppend

func (r *ListSecurityGroupRulesResponse) UnsafeAppend(res interface{}) (uint32, scw.SdkError)

UnsafeAppend should not be used Internal usage only

func (*ListSecurityGroupRulesResponse) UnsafeGetTotalCount

func (r *ListSecurityGroupRulesResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

func (*ListSecurityGroupRulesResponse) UnsafeSetTotalCount

func (r *ListSecurityGroupRulesResponse) UnsafeSetTotalCount(totalCount int)

UnsafeSetTotalCount should not be used Internal usage only

type ListSecurityGroupsRequest

type ListSecurityGroupsRequest struct {
	Zone scw.Zone `json:"-"`

	Organization *string `json:"-"`

	PerPage *uint32 `json:"-"`

	Page *int32 `json:"-"`

	Name *string `json:"-"`
}

type ListSecurityGroupsResponse

type ListSecurityGroupsResponse struct {
	SecurityGroups []*SecurityGroup `json:"security_groups"`

	TotalCount uint32 `json:"total_count"`
}

func (*ListSecurityGroupsResponse) UnsafeAppend

func (r *ListSecurityGroupsResponse) UnsafeAppend(res interface{}) (uint32, scw.SdkError)

UnsafeAppend should not be used Internal usage only

func (*ListSecurityGroupsResponse) UnsafeGetTotalCount

func (r *ListSecurityGroupsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

func (*ListSecurityGroupsResponse) UnsafeSetTotalCount

func (r *ListSecurityGroupsResponse) UnsafeSetTotalCount(totalCount int)

UnsafeSetTotalCount should not be used Internal usage only

type ListServerActionsRequest

type ListServerActionsRequest struct {
	Zone scw.Zone `json:"-"`

	ServerID string `json:"-"`
}

type ListServerActionsResponse

type ListServerActionsResponse struct {
	Actions []ServerAction `json:"actions"`
}

type ListServerUserDataRequest

type ListServerUserDataRequest struct {
	Zone scw.Zone `json:"-"`

	ServerID string `json:"-"`
}

type ListServerUserDataResponse

type ListServerUserDataResponse struct {
	UserData []string `json:"user_data"`
}

type ListServersRequest

type ListServersRequest struct {
	Zone scw.Zone `json:"-"`
	// PerPage a positive integer lower or equal to 100 to select the number of items to display
	//
	// Default value: 20
	PerPage *uint32 `json:"-"`
	// Page a positive integer to choose the page to display
	Page *int32 `json:"-"`
	// Organization list only servers of this organization
	Organization *string `json:"-"`
	// Name filter servers by name (for eg. "server1" will return "server100" and "server1" but not "foo")
	Name *string `json:"-"`
	// PrivateIP list servers by private_ip
	PrivateIP *net.IP `json:"-"`
	// WithoutIP list servers that are not attached to a public IP
	WithoutIP *bool `json:"-"`
	// CommercialType list servers of this commercial type
	CommercialType *string `json:"-"`
	// State list servers in this state
	//
	// Default value: running
	State *ServerState `json:"-"`
}

type ListServersResponse

type ListServersResponse struct {
	Servers []*Server `json:"servers"`

	TotalCount uint32 `json:"total_count"`
}

func (*ListServersResponse) UnsafeAppend

func (r *ListServersResponse) UnsafeAppend(res interface{}) (uint32, scw.SdkError)

UnsafeAppend should not be used Internal usage only

func (*ListServersResponse) UnsafeGetTotalCount

func (r *ListServersResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

func (*ListServersResponse) UnsafeSetTotalCount

func (r *ListServersResponse) UnsafeSetTotalCount(totalCount int)

UnsafeSetTotalCount should not be used Internal usage only

type ListServersTypesRequest

type ListServersTypesRequest struct {
	Zone scw.Zone `json:"-"`

	PerPage *uint32 `json:"-"`

	Page *int32 `json:"-"`
}

type ListServersTypesResponse

type ListServersTypesResponse struct {
	Servers map[string]*ServerType `json:"servers"`

	TotalCount uint32 `json:"total_count"`
}

func (*ListServersTypesResponse) UnsafeAppend

func (r *ListServersTypesResponse) UnsafeAppend(res interface{}) (uint32, scw.SdkError)

UnsafeAppend should not be used Internal usage only

func (*ListServersTypesResponse) UnsafeGetTotalCount

func (r *ListServersTypesResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

func (*ListServersTypesResponse) UnsafeSetTotalCount

func (r *ListServersTypesResponse) UnsafeSetTotalCount(totalCount int)

UnsafeSetTotalCount should not be used Internal usage only

type ListSnapshotsRequest

type ListSnapshotsRequest struct {
	Zone scw.Zone `json:"-"`

	Organization *string `json:"-"`

	PerPage *uint32 `json:"-"`

	Page *int32 `json:"-"`

	Name *string `json:"-"`
}

type ListSnapshotsResponse

type ListSnapshotsResponse struct {
	Snapshots []*Snapshot `json:"snapshots"`

	TotalCount uint32 `json:"total_count"`
}

func (*ListSnapshotsResponse) UnsafeAppend

func (r *ListSnapshotsResponse) UnsafeAppend(res interface{}) (uint32, scw.SdkError)

UnsafeAppend should not be used Internal usage only

func (*ListSnapshotsResponse) UnsafeGetTotalCount

func (r *ListSnapshotsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

func (*ListSnapshotsResponse) UnsafeSetTotalCount

func (r *ListSnapshotsResponse) UnsafeSetTotalCount(totalCount int)

UnsafeSetTotalCount should not be used Internal usage only

type ListVolumesRequest

type ListVolumesRequest struct {
	Zone scw.Zone `json:"-"`
	// VolumeType filter by volume type
	//
	// Default value: l_ssd
	VolumeType VolumeType `json:"-"`
	// PerPage a positive integer lower or equal to 100 to select the number of items to display
	//
	// Default value: 20
	PerPage *uint32 `json:"-"`
	// Page a positive integer to choose the page to display
	Page *int32 `json:"-"`
	// Organization display volumes of this organization
	Organization *string `json:"-"`
	// Name filter volume by name (for eg. "vol" will return "myvolume" but not "data")
	Name *string `json:"-"`
}

type ListVolumesResponse

type ListVolumesResponse struct {
	Volumes []*Volume `json:"volumes"`

	TotalCount uint32 `json:"total_count"`
}

func (*ListVolumesResponse) UnsafeAppend

func (r *ListVolumesResponse) UnsafeAppend(res interface{}) (uint32, scw.SdkError)

UnsafeAppend should not be used Internal usage only

func (*ListVolumesResponse) UnsafeGetTotalCount

func (r *ListVolumesResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

func (*ListVolumesResponse) UnsafeSetTotalCount

func (r *ListVolumesResponse) UnsafeSetTotalCount(totalCount int)

UnsafeSetTotalCount should not be used Internal usage only

type Metadata

type Metadata struct {
	ID             string `json:"id,omitempty"`
	Name           string `json:"name,omitempty"`
	Hostname       string `json:"hostname,omitempty"`
	Organization   string `json:"organization,omitempty"`
	CommercialType string `json:"commercial_type,omitempty"`
	PublicIP       struct {
		Dynamic bool   `json:"dynamic,omitempty"`
		ID      string `json:"id,omitempty"`
		Address string `json:"address,omitempty"`
	} `json:"public_ip,omitempty"`
	PrivateIP string `json:"private_ip,omitempty"`
	IPv6      struct {
		Netmask string `json:"netmask,omitempty"`
		Gateway string `json:"gateway,omitempty"`
		Address string `json:"address,omitempty"`
	} `json:"ipv6,omitempty"`
	Location struct {
		PlatformID   string `json:"platform_id,omitempty"`
		HypervisorID string `json:"hypervisor_id,omitempty"`
		NodeID       string `json:"node_id,omitempty"`
		ClusterID    string `json:"cluster_id,omitempty"`
		ZoneID       string `json:"zone_id,omitempty"`
	} `json:"location,omitempty"`
	Tags          []string `json:"tags,omitempty"`
	StateDetail   string   `json:"state_detail,omitempty"`
	SSHPublicKeys []struct {
		Description      string `json:"description,omitempty"`
		ModificationDate string `json:"modification_date,omitempty"`
		IP               string `json:"ip,omitempty"`
		Email            string `json:"email,omitempty"`
		UserAgent        struct {
			Platform string `json:"platform,omitempty"`
			Version  string `json:"version,omitempty"`
			String   string `json:"string,omitempty"`
			Browser  string `json:"browser,omitempty"`
		} `json:"user_agent,omitempty"`
		Key          string `json:"key,omitempty"`
		Fingerprint  string `json:"fingerprint,omitempty"`
		ID           string `json:"id,omitempty"`
		CreationDate string `json:"creation_date,omitempty"`
		Port         int    `json:"port,omitempty"`
	} `json:"ssh_public_keys,omitempty"`
	Timezone   string `json:"timezone,omitempty"`
	Bootscript struct {
		Kernel       string `json:"kernel,omitempty"`
		Title        string `json:"title,omitempty"`
		Default      bool   `json:"default,omitempty"`
		Dtb          string `json:"dtb,omitempty"`
		Public       bool   `json:"publc,omitempty"`
		Initrd       string `json:"initrd,omitempty"`
		Bootcmdargs  string `json:"bootcmdargs,omitempty"`
		Architecture string `json:"architecture,omitempty"`
		Organization string `json:"organization,omitempty"`
		ID           string `json:"id,omitempty"`
	} `json:"bootscript,omitempty"`
	Volumes map[string]struct {
		Name             string `json:"name,omitempty"`
		ModificationDate string `json:"modification_date,omitempty"`
		ExportURI        string `json:"export_uri,omitempty"`
		VolumeType       string `json:"volume_type,omitempty"`
		CreationDate     string `json:"creation_date,omitempty"`
		State            string `json:"state,omitempty"`
		Organization     string `json:"organization,omitempty"`
		Server           struct {
			ID   string `json:"id,omitempty"`
			Name string `json:"name,omitempty"`
		} `json:"server,omitempty"`
		ID   string `json:"id,omitempty"`
		Size int    `json:"size,omitempty"`
	}
}

Metadata represents the struct return by the metadata API

type MetadataAPI

type MetadataAPI struct {
}

MetadataAPI metadata API

func NewMetadataAPI

func NewMetadataAPI() *MetadataAPI

NewMetadataAPI returns a MetadataAPI object from a Scaleway client.

func (*MetadataAPI) DeleteUserData

func (*MetadataAPI) DeleteUserData(key string) error

DeleteUserData deletes the userdata key and the associated value

func (*MetadataAPI) GetMetadata

func (*MetadataAPI) GetMetadata() (m *Metadata, err error)

GetMetadata returns the metadata available from the server

func (*MetadataAPI) GetUserData

func (*MetadataAPI) GetUserData(key string) ([]byte, error)

GetUserData returns the value for the given metadata key

func (*MetadataAPI) ListUserData

func (*MetadataAPI) ListUserData() (res *UserData, err error)

ListUserData returns the metadata available from the server

func (*MetadataAPI) SetUserData

func (*MetadataAPI) SetUserData(key string, value []byte) error

SetUserData sets the userdata key with the given value

type NullableStringValue

type NullableStringValue struct {
	Null bool `json:"null,omitempty"`

	Value string `json:"value,omitempty"`
}

func (*NullableStringValue) MarshalJSON

func (v *NullableStringValue) MarshalJSON() ([]byte, error)

func (*NullableStringValue) UnmarshalJSON

func (v *NullableStringValue) UnmarshalJSON(b []byte) error

type PlacementGroup

type PlacementGroup struct {
	// ID display placement group unique ID
	ID string `json:"id"`
	// Name display placement group name
	Name string `json:"name"`
	// Organization display placement group organization
	Organization string `json:"organization"`
	// PolicyMode select the failling mode when the placement cannot be  respected, either optional or enforced
	//
	// Default value: optional
	PolicyMode PlacementGroupPolicyMode `json:"policy_mode"`
	// PolicyType select the behavior of the placement group, either low_latency (group) or max_availability (spread)
	//
	// Default value: max_availability
	PolicyType PlacementGroupPolicyType `json:"policy_type"`
	// PolicyRespected returns true if the policy is respected, false otherwise
	PolicyRespected bool `json:"policy_respected"`
}

PlacementGroup placement group

type PlacementGroupPolicyMode

type PlacementGroupPolicyMode string

func (PlacementGroupPolicyMode) MarshalJSON

func (enum PlacementGroupPolicyMode) MarshalJSON() ([]byte, error)

func (PlacementGroupPolicyMode) String

func (enum PlacementGroupPolicyMode) String() string

func (*PlacementGroupPolicyMode) UnmarshalJSON

func (enum *PlacementGroupPolicyMode) UnmarshalJSON(data []byte) error

type PlacementGroupPolicyType

type PlacementGroupPolicyType string

func (PlacementGroupPolicyType) MarshalJSON

func (enum PlacementGroupPolicyType) MarshalJSON() ([]byte, error)

func (PlacementGroupPolicyType) String

func (enum PlacementGroupPolicyType) String() string

func (*PlacementGroupPolicyType) UnmarshalJSON

func (enum *PlacementGroupPolicyType) UnmarshalJSON(data []byte) error

type PlacementGroupServer

type PlacementGroupServer struct {
	ID string `json:"id"`

	Name string `json:"name"`

	PolicyRespected bool `json:"policy_respected"`
}

type SecurityGroup

type SecurityGroup struct {
	// ID display the security groups' unique ID
	ID string `json:"id"`
	// Name display the security groups name
	Name string `json:"name"`
	// Description display the security groups description
	Description string `json:"description"`
	// EnableDefaultSecurity display if the security group is set as default
	EnableDefaultSecurity bool `json:"enable_default_security"`
	// InboundDefaultPolicy display the default inbound policy
	//
	// Default value: accept
	InboundDefaultPolicy SecurityGroupPolicy `json:"inbound_default_policy"`
	// OutboundDefaultPolicy display the default outbound policy
	//
	// Default value: accept
	OutboundDefaultPolicy SecurityGroupPolicy `json:"outbound_default_policy"`
	// Organization display the security groups organization ID
	Organization string `json:"organization"`
	// OrganizationDefault display if the security group is set as organization default
	OrganizationDefault bool `json:"organization_default"`
	// CreationDate display the security group creation date
	CreationDate time.Time `json:"creation_date"`
	// ModificationDate display the security group modification date
	ModificationDate time.Time `json:"modification_date"`
	// Servers list of servers attached to this security group
	Servers []*ServerSummary `json:"servers"`
	// Stateful true if the security group is stateful
	Stateful bool `json:"stateful"`
}

SecurityGroup security group

type SecurityGroupPolicy

type SecurityGroupPolicy string

func (SecurityGroupPolicy) MarshalJSON

func (enum SecurityGroupPolicy) MarshalJSON() ([]byte, error)

func (SecurityGroupPolicy) String

func (enum SecurityGroupPolicy) String() string

func (*SecurityGroupPolicy) UnmarshalJSON

func (enum *SecurityGroupPolicy) UnmarshalJSON(data []byte) error

type SecurityGroupRule

type SecurityGroupRule struct {
	ID string `json:"id"`
	// Protocol
	//
	// Default value: TCP
	Protocol SecurityGroupRuleProtocol `json:"protocol"`
	// Direction
	//
	// Default value: inbound
	Direction SecurityGroupRuleDirection `json:"direction"`
	// Action
	//
	// Default value: accept
	Action SecurityGroupRuleAction `json:"action"`

	IPRange scw.IPNet `json:"ip_range"`

	DestPortFrom *uint32 `json:"dest_port_from"`

	DestPortTo *uint32 `json:"dest_port_to"`

	Position uint32 `json:"position"`

	Editable bool `json:"editable"`
}

type SecurityGroupRuleAction

type SecurityGroupRuleAction string

func (SecurityGroupRuleAction) MarshalJSON

func (enum SecurityGroupRuleAction) MarshalJSON() ([]byte, error)

func (SecurityGroupRuleAction) String

func (enum SecurityGroupRuleAction) String() string

func (*SecurityGroupRuleAction) UnmarshalJSON

func (enum *SecurityGroupRuleAction) UnmarshalJSON(data []byte) error

type SecurityGroupRuleDirection

type SecurityGroupRuleDirection string

func (SecurityGroupRuleDirection) MarshalJSON

func (enum SecurityGroupRuleDirection) MarshalJSON() ([]byte, error)

func (SecurityGroupRuleDirection) String

func (enum SecurityGroupRuleDirection) String() string

func (*SecurityGroupRuleDirection) UnmarshalJSON

func (enum *SecurityGroupRuleDirection) UnmarshalJSON(data []byte) error

type SecurityGroupRuleProtocol

type SecurityGroupRuleProtocol string

func (SecurityGroupRuleProtocol) MarshalJSON

func (enum SecurityGroupRuleProtocol) MarshalJSON() ([]byte, error)

func (SecurityGroupRuleProtocol) String

func (enum SecurityGroupRuleProtocol) String() string

func (*SecurityGroupRuleProtocol) UnmarshalJSON

func (enum *SecurityGroupRuleProtocol) UnmarshalJSON(data []byte) error

type SecurityGroupSummary

type SecurityGroupSummary struct {
	ID string `json:"id"`

	Name string `json:"name"`
}

type SecurityGroupTemplate

type SecurityGroupTemplate struct {
	ID string `json:"id,omitempty"`

	Name string `json:"name,omitempty"`
}

type Server

type Server struct {
	// ID display the server unique ID
	ID string `json:"id"`
	// Name display the server name
	Name string `json:"name"`
	// Organization display the server organization
	Organization string `json:"organization"`
	// AllowedActions provide as list of allowed actions on the server
	AllowedActions []ServerAction `json:"allowed_actions"`
	// Tags display the server associated tags
	Tags []string `json:"tags"`
	// CommercialType display the server commercial type (eg. GP1-M)
	CommercialType string `json:"commercial_type"`
	// CreationDate display the server creation date
	CreationDate time.Time `json:"creation_date"`
	// DynamicIPRequired display if a dynamic IP is required
	DynamicIPRequired bool `json:"dynamic_ip_required"`
	// EnableIPv6 display if IPv6 is enabled
	EnableIPv6 bool `json:"enable_ipv6"`
	// Hostname display the server host name
	Hostname string `json:"hostname"`
	// Image provide information on the server image
	Image *Image `json:"image"`
	// Protected display the server protection option is activated
	Protected bool `json:"protected"`
	// PrivateIP display the server private IP address
	PrivateIP *string `json:"private_ip"`
	// PublicIP display information about the public IP
	PublicIP *ServerIP `json:"public_ip"`
	// ModificationDate display the server modification date
	ModificationDate time.Time `json:"modification_date"`
	// State display the server state
	//
	// Default value: running
	State ServerState `json:"state"`
	// Location display the server location
	Location *ServerLocation `json:"location"`
	// IPv6 display the server IPv6 address
	IPv6 *ServerIPv6 `json:"ipv6"`
	// Bootscript display the server bootscript
	Bootscript *Bootscript `json:"bootscript"`
	// BootType display the server boot type
	//
	// Default value: local
	BootType BootType `json:"boot_type"`
	// Volumes display the server volumes
	Volumes map[string]*Volume `json:"volumes"`
	// SecurityGroup display the server security group
	SecurityGroup *SecurityGroupSummary `json:"security_group"`
	// Maintenances display the server planned maintenances
	Maintenances []*ServerMaintenance `json:"maintenances"`
	// StateDetail display the server state_detail
	StateDetail string `json:"state_detail"`
	// Arch display the server arch
	//
	// Default value: x86_64
	Arch Arch `json:"arch"`
	// PlacementGroup display the server placement group
	PlacementGroup *PlacementGroup `json:"placement_group"`
}

Server server

type ServerAction

type ServerAction string

func (ServerAction) MarshalJSON

func (enum ServerAction) MarshalJSON() ([]byte, error)

func (ServerAction) String

func (enum ServerAction) String() string

func (*ServerAction) UnmarshalJSON

func (enum *ServerAction) UnmarshalJSON(data []byte) error

type ServerActionAndWaitRequest

type ServerActionAndWaitRequest struct {
	ServerID string
	Zone     scw.Zone
	Action   ServerAction

	// Timeout: maximum time to wait before (default: 5 minutes)
	Timeout time.Duration
}

ServerActionAndWaitRequest is used by ServerActionAndWait method.

type ServerActionRequest

type ServerActionRequest struct {
	Zone scw.Zone `json:"-"`

	ServerID string `json:"-"`
	// Action
	//
	// Default value: poweron
	Action ServerAction `json:"action"`
}

type ServerActionResponse

type ServerActionResponse struct {
	Task *Task `json:"task"`
}

type ServerIP

type ServerIP struct {
	// ID display the unique ID of the IP address
	ID string `json:"id"`
	// Address display the server public IPv4 IP-Address
	Address net.IP `json:"address"`
	// Dynamic display information if the IP address will be considered as dynamic
	Dynamic bool `json:"dynamic"`
}

ServerIP server. ip

type ServerIPv6

type ServerIPv6 struct {
	// Address display the server IPv6 IP-Address
	Address net.IP `json:"address"`
	// Gateway display the IPv6 IP-addresses gateway
	Gateway net.IP `json:"gateway"`
	// Netmask display the IPv6 IP-addresses CIDR netmask
	Netmask string `json:"netmask"`
}

ServerIPv6 server. ipv6

type ServerLocation

type ServerLocation struct {
	ClusterID string `json:"cluster_id"`

	HypervisorID string `json:"hypervisor_id"`

	NodeID string `json:"node_id"`

	PlatformID string `json:"platform_id"`

	ZoneID string `json:"zone_id"`
}

type ServerMaintenance

type ServerMaintenance struct {
}

type ServerState

type ServerState string

func (ServerState) MarshalJSON

func (enum ServerState) MarshalJSON() ([]byte, error)

func (ServerState) String

func (enum ServerState) String() string

func (*ServerState) UnmarshalJSON

func (enum *ServerState) UnmarshalJSON(data []byte) error

type ServerSummary

type ServerSummary struct {
	ID string `json:"id"`

	Name string `json:"name"`
}

type ServerType

type ServerType struct {
	MonthlyPrice float32 `json:"monthly_price"`

	HourlyPrice float32 `json:"hourly_price"`

	AltNames []string `json:"alt_names"`

	PerVolumeConstraint *ServerTypeVolumeConstraintsByType `json:"per_volume_constraint"`

	VolumesConstraint *ServerTypeVolumeConstraintSizes `json:"volumes_constraint"`

	Ncpus uint32 `json:"ncpus"`

	Gpu *uint64 `json:"gpu"`

	RAM uint64 `json:"ram"`
	// Arch
	//
	// Default value: x86_64
	Arch Arch `json:"arch"`

	Baremetal bool `json:"baremetal"`

	Network *ServerTypeNetwork `json:"network"`
}

type ServerTypeNetwork

type ServerTypeNetwork struct {
	Interfaces []*ServerTypeNetworkInterface `json:"interfaces"`

	SumInternalBandwidth *uint64 `json:"sum_internal_bandwidth"`

	SumInternetBandwidth *uint64 `json:"sum_internet_bandwidth"`

	IPv6Support bool `json:"ipv6_support"`
}

type ServerTypeNetworkInterface

type ServerTypeNetworkInterface struct {
	InternalBandwidth *uint64 `json:"internal_bandwidth"`

	InternetBandwidth *uint64 `json:"internet_bandwidth"`
}

type ServerTypeVolumeConstraintSizes

type ServerTypeVolumeConstraintSizes struct {
	MinSize scw.Size `json:"min_size"`

	MaxSize scw.Size `json:"max_size"`
}

type ServerTypeVolumeConstraintsByType

type ServerTypeVolumeConstraintsByType struct {
	LSSD *ServerTypeVolumeConstraintSizes `json:"l_ssd"`
}

type ServerTypesAvailability

type ServerTypesAvailability string

func (ServerTypesAvailability) MarshalJSON

func (enum ServerTypesAvailability) MarshalJSON() ([]byte, error)

func (ServerTypesAvailability) String

func (enum ServerTypesAvailability) String() string

func (*ServerTypesAvailability) UnmarshalJSON

func (enum *ServerTypesAvailability) UnmarshalJSON(data []byte) error

type SetAllServerUserDataRequest

type SetAllServerUserDataRequest struct {
	Zone     scw.Zone `json:"-"`
	ServerID string   `json:"-"`

	// UserData defines all user data that will be set to the server.
	// This map is idempotent, it means that all the current data will be overwritten and
	// all keys not present in this map will be deleted.. All data will be removed if this map is nil.
	UserData map[string]io.Reader `json:"-"`
}

SetAllServerUserDataRequest is used by SetAllServerUserData method.

type SetIPRequest

type SetIPRequest struct {
	Zone scw.Zone `json:"-"`

	ID string `json:"-"`

	Address net.IP `json:"address"`

	Reverse *string `json:"reverse"`

	Server *ServerSummary `json:"server"`

	Organization string `json:"organization"`
}

type SetImageRequest

type SetImageRequest struct {
	Zone scw.Zone `json:"-"`

	ID string `json:"-"`

	Name string `json:"name"`
	// Arch
	//
	// Default value: x86_64
	Arch Arch `json:"arch"`

	CreationDate time.Time `json:"creation_date"`

	ModificationDate time.Time `json:"modification_date"`

	DefaultBootscript *Bootscript `json:"default_bootscript"`

	ExtraVolumes map[string]*Volume `json:"extra_volumes"`

	FromServer string `json:"from_server"`

	Organization string `json:"organization"`

	Public bool `json:"public"`

	RootVolume *VolumeSummary `json:"root_volume"`
	// State
	//
	// Default value: available
	State ImageState `json:"state"`
}

type SetPlacementGroupRequest

type SetPlacementGroupRequest struct {
	Zone scw.Zone `json:"-"`

	PlacementGroupID string `json:"-"`

	Name string `json:"name"`

	Organization string `json:"organization"`
	// PolicyMode
	//
	// Default value: optional
	PolicyMode PlacementGroupPolicyMode `json:"policy_mode"`
	// PolicyType
	//
	// Default value: max_availability
	PolicyType PlacementGroupPolicyType `json:"policy_type"`
}

type SetPlacementGroupResponse

type SetPlacementGroupResponse struct {
	PlacementGroup *PlacementGroup `json:"placement_group"`
}

type SetPlacementGroupServersRequest

type SetPlacementGroupServersRequest struct {
	Zone scw.Zone `json:"-"`

	PlacementGroupID string `json:"-"`

	Servers []string `json:"servers"`
}

type SetPlacementGroupServersResponse

type SetPlacementGroupServersResponse struct {
	Servers []*PlacementGroupServer `json:"servers"`
}

type SetServerUserDataRequest

type SetServerUserDataRequest struct {
	Zone     scw.Zone `json:"-"`
	ServerID string   `json:"-"`

	// Key defines the user data key to set.
	Key string `json:"-"`

	// Content defines the data to set.
	Content io.Reader
}

SetServerUserDataRequest is used by SetServerUserData method.

type SetSnapshotRequest

type SetSnapshotRequest struct {
	Zone scw.Zone `json:"-"`

	ID string `json:"-"`

	Name string `json:"name"`

	Organization string `json:"organization"`
	// VolumeType
	//
	// Default value: l_ssd
	VolumeType VolumeType `json:"volume_type"`

	Size scw.Size `json:"size"`
	// State
	//
	// Default value: available
	State SnapshotState `json:"state"`

	BaseVolume *SnapshotBaseVolume `json:"base_volume"`

	CreationDate time.Time `json:"creation_date"`

	ModificationDate time.Time `json:"modification_date"`
}

type Snapshot

type Snapshot struct {
	ID string `json:"id"`

	Name string `json:"name"`

	Organization string `json:"organization"`
	// VolumeType
	//
	// Default value: l_ssd
	VolumeType VolumeType `json:"volume_type"`

	Size scw.Size `json:"size"`
	// State
	//
	// Default value: available
	State SnapshotState `json:"state"`

	BaseVolume *SnapshotBaseVolume `json:"base_volume"`

	CreationDate time.Time `json:"creation_date"`

	ModificationDate time.Time `json:"modification_date"`
}

type SnapshotBaseVolume

type SnapshotBaseVolume struct {
	ID string `json:"id"`

	Name string `json:"name"`
}

type SnapshotState

type SnapshotState string

func (SnapshotState) MarshalJSON

func (enum SnapshotState) MarshalJSON() ([]byte, error)

func (SnapshotState) String

func (enum SnapshotState) String() string

func (*SnapshotState) UnmarshalJSON

func (enum *SnapshotState) UnmarshalJSON(data []byte) error

type Task

type Task struct {
	// ID the unique ID of the task
	ID string `json:"id"`
	// Description the description of the task
	Description string `json:"description"`
	// Progress show the progress of the task in percent
	Progress int32 `json:"progress"`
	// StartedAt display the task start date
	StartedAt time.Time `json:"started_at"`
	// TerminatedAt display the task end date
	TerminatedAt time.Time `json:"terminated_at"`
	// Status display the task status
	//
	// Default value: pending
	Status TaskStatus `json:"status"`

	HrefFrom string `json:"href_from"`

	HrefResult string `json:"href_result"`
}

Task task

type TaskStatus

type TaskStatus string

func (TaskStatus) MarshalJSON

func (enum TaskStatus) MarshalJSON() ([]byte, error)

func (TaskStatus) String

func (enum TaskStatus) String() string

func (*TaskStatus) UnmarshalJSON

func (enum *TaskStatus) UnmarshalJSON(data []byte) error

type UpdateIPRequest

type UpdateIPRequest struct {
	Zone    scw.Zone             `json:"-"`
	IP      string               `json:"-"`
	Reverse *NullableStringValue `json:"reverse"`
}

UpdateIPRequest contains the parameters to update an IP if Reverse is an empty string, the reverse will be removed

type UpdateIPResponse

type UpdateIPResponse struct {
	IP *IP `json:"ip"`
}

type UpdatePlacementGroupRequest

type UpdatePlacementGroupRequest struct {
	Zone scw.Zone `json:"-"`

	PlacementGroupID string `json:"-"`

	Name *string `json:"name,omitempty"`

	Organization *string `json:"organization,omitempty"`
	// PolicyMode
	//
	// Default value: optional
	PolicyMode PlacementGroupPolicyMode `json:"policy_mode"`
	// PolicyType
	//
	// Default value: max_availability
	PolicyType PlacementGroupPolicyType `json:"policy_type"`
}

type UpdatePlacementGroupResponse

type UpdatePlacementGroupResponse struct {
	PlacementGroup *PlacementGroup `json:"placement_group"`
}

type UpdatePlacementGroupServersRequest

type UpdatePlacementGroupServersRequest struct {
	Zone scw.Zone `json:"-"`

	PlacementGroupID string `json:"-"`

	Servers []string `json:"servers,omitempty"`
}

type UpdatePlacementGroupServersResponse

type UpdatePlacementGroupServersResponse struct {
	Servers []*PlacementGroupServer `json:"servers"`
}

type UpdateSecurityGroupRequest

type UpdateSecurityGroupRequest struct {
	Zone            scw.Zone `json:"-"`
	SecurityGroupID string   `json:"-"`

	Name                  *string              `json:"name,omitempty"`
	Description           *string              `json:"description,omitempty"`
	InboundDefaultPolicy  *SecurityGroupPolicy `json:"inbound_default_policy,omitempty"`
	OutboundDefaultPolicy *SecurityGroupPolicy `json:"outbound_default_policy,omitempty"`
	Stateful              *bool                `json:"stateful,omitempty"`
}

UpdateSecurityGroupRequest contains the parameters to update a security group

type UpdateSecurityGroupResponse

type UpdateSecurityGroupResponse struct {
	SecurityGroup *SecurityGroup
}

type UpdateSecurityGroupRuleRequest

type UpdateSecurityGroupRuleRequest struct {
	Zone                scw.Zone `json:"-"`
	SecurityGroupID     string   `json:"-"`
	SecurityGroupRuleID string   `json:"-"`

	Protocol  *SecurityGroupRuleProtocol  `json:"protocol"`
	Direction *SecurityGroupRuleDirection `json:"direction"`
	Action    *SecurityGroupRuleAction    `json:"action"`
	IPRange   *scw.IPNet                  `json:"ip_range"`
	Position  *uint32                     `json:"position"`

	// If set to 0, DestPortFrom will be removed.
	// See SecurityGroupRule.DestPortFrom for more information
	DestPortFrom *uint32 `json:"dest_port_from"`

	// If set to 0, DestPortTo will be removed.
	// See SecurityGroupRule.DestPortTo for more information
	DestPortTo *uint32 `json:"dest_port_to"`
}

UpdateSecurityGroupRuleRequest contains the parameters to update a security group rule

type UpdateSecurityGroupRuleResponse

type UpdateSecurityGroupRuleResponse struct {
	Rule *SecurityGroupRule `json:"security_rule"`
}

type UpdateServerRequest

type UpdateServerRequest struct {
	Zone scw.Zone `json:"-"`

	ServerID string `json:"-"`

	Name *string `json:"name,omitempty"`
	// BootType
	//
	// Default value: local
	BootType *BootType `json:"boot_type,omitempty"`

	Tags *[]string `json:"tags,omitempty"`

	Volumes *map[string]*VolumeTemplate `json:"volumes,omitempty"`

	Bootscript *string `json:"bootscript,omitempty"`

	DynamicIPRequired *bool `json:"dynamic_ip_required,omitempty"`

	EnableIPv6 *bool `json:"enable_ipv6,omitempty"`

	Protected *bool `json:"protected,omitempty"`

	SecurityGroup *SecurityGroupTemplate `json:"security_group,omitempty"`
	// PlacementGroup placement group ID if server must be part of a placement group
	PlacementGroup *NullableStringValue `json:"placement_group,omitempty"`
}

type UpdateServerResponse

type UpdateServerResponse struct {
	Server *Server `json:"server"`
}

type UpdateVolumeRequest

type UpdateVolumeRequest struct {
	Zone scw.Zone `json:"-"`
	// VolumeID is the volumes unique ID
	VolumeID string `json:"-"`
	// Name display the volumes names
	Name *string `json:"name,omitempty"`
}

UpdateVolumeRequest contains the parameters to update on a volume

type UpdateVolumeResponse

type UpdateVolumeResponse struct {
	Volume *Volume `json:"volume,omitempty"`
}

UpdateVolumeResponse contains the updated volume.

type UserData

type UserData struct {
	UserData []string `json:"user_data,omitempty"`
}

UserData represents the user data

type Volume

type Volume struct {
	// ID display the volumes unique ID
	ID string `json:"id"`
	// Name display the volumes names
	Name string `json:"name"`
	// ExportURI show the volumes NBD export URI
	ExportURI string `json:"export_uri"`
	// Size display the volumes disk size
	Size scw.Size `json:"size"`
	// VolumeType display the volumes type
	//
	// Default value: l_ssd
	VolumeType VolumeType `json:"volume_type"`
	// CreationDate display the volumes creation date
	CreationDate time.Time `json:"creation_date"`
	// ModificationDate display the volumes modification date
	ModificationDate time.Time `json:"modification_date"`
	// Organization display the volumes organization
	Organization string `json:"organization"`
	// Server display information about the server attached to the volume
	Server *ServerSummary `json:"server"`
	// State display the volumes state
	//
	// Default value: available
	State VolumeState `json:"state"`
}

Volume volume

type VolumeState

type VolumeState string

func (VolumeState) MarshalJSON

func (enum VolumeState) MarshalJSON() ([]byte, error)

func (VolumeState) String

func (enum VolumeState) String() string

func (*VolumeState) UnmarshalJSON

func (enum *VolumeState) UnmarshalJSON(data []byte) error

type VolumeSummary

type VolumeSummary struct {
	ID string `json:"id"`

	Name string `json:"name"`

	Size scw.Size `json:"size"`
	// VolumeType
	//
	// Default value: l_ssd
	VolumeType VolumeType `json:"volume_type"`
}

type VolumeTemplate

type VolumeTemplate struct {
	// ID display the volumes unique ID
	ID string `json:"id,omitempty"`
	// Name display the volumes name
	Name string `json:"name,omitempty"`
	// Size display the volumes disk size
	Size scw.Size `json:"size,omitempty"`
	// VolumeType display the volumes type
	//
	// Default value: l_ssd
	VolumeType VolumeType `json:"volume_type,omitempty"`
	// Organization the organization ID
	Organization string `json:"organization,omitempty"`
}

VolumeTemplate volume template

type VolumeType

type VolumeType string

func (VolumeType) MarshalJSON

func (enum VolumeType) MarshalJSON() ([]byte, error)

func (VolumeType) String

func (enum VolumeType) String() string

func (*VolumeType) UnmarshalJSON

func (enum *VolumeType) UnmarshalJSON(data []byte) error

type WaitForServerRequest

type WaitForServerRequest struct {
	ServerID string
	Zone     scw.Zone
	Timeout  time.Duration
}

WaitForServerRequest is used by WaitForServer method.

Jump to

Keyboard shortcuts

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