types

package
Version: v0.0.0-...-0d651c5 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// IdentifierUnknown is used when we don't know explicitly the type key of the object (used for nil comparison)
	IdentifierUnknown = 1 << iota
	// IdentifierServer is the type key of cached server objects
	IdentifierServer
	// IdentifierImage is the type key of cached image objects
	IdentifierImage
	// IdentifierSnapshot is the type key of cached snapshot objects
	IdentifierSnapshot
	// IdentifierBootscript is the type key of cached bootscript objects
	IdentifierBootscript
	// IdentifierVolume is the type key of cached volume objects
	IdentifierVolume
)

Variables

View Source
var FuncMap = template.FuncMap{
	"json": func(v interface{}) string {
		a, _ := json.Marshal(v)
		return string(a)
	},
}

FuncMap used for json inspection

Functions

func ParseNeedle

func ParseNeedle(input string) (identifierType int, needle string)

ParseNeedle parses a user needle and try to extract a forced object type i.e:

  • server:blah-blah -> kind=server, needle=blah-blah
  • blah-blah -> kind="", needle=blah-blah
  • not-existing-type:blah-blah

Types

type MarketImage

type MarketImage struct {
	Categories           []string `json:"categories"`
	CreationDate         string   `json:"creation_date"`
	CurrentPublicVersion string   `json:"current_public_version"`
	Description          string   `json:"description"`
	ID                   string   `json:"id"`
	ModificationDate     string   `json:"modification_date"`
	Name                 string   `json:"name"`
	Organization         struct {
		ID   string `json:"id"`
		Name string `json:"name"`
	} `json:"organization"`
	Public bool `json:"-"`
	MarketVersions
}

MarketImage represents MarketPlace image

type MarketImages

type MarketImages struct {
	Images []MarketImage `json:"images"`
}

MarketImages represents MarketPlace images

type MarketLocalImage

type MarketLocalImage struct {
	LocalImages MarketLocalImageDefinition `json:"local_image"`
}

MarketLocalImage represents local image

type MarketLocalImageDefinition

type MarketLocalImageDefinition struct {
	Arch string `json:"arch"`
	ID   string `json:"id"`
	Zone string `json:"zone"`
}

MarketLocalImageDefinition represents localImage of marketplace version

type MarketLocalImages

type MarketLocalImages struct {
	LocalImages []MarketLocalImageDefinition `json:"local_images"`
}

MarketLocalImages represents an array of local images

type MarketVersion

type MarketVersion struct {
	Version MarketVersionDefinition `json:"version"`
}

MarketVersion represents version of marketplace image

type MarketVersionDefinition

type MarketVersionDefinition struct {
	CreationDate string `json:"creation_date"`
	ID           string `json:"id"`
	Image        struct {
		ID   string `json:"id"`
		Name string `json:"name"`
	} `json:"image"`
	ModificationDate string `json:"modification_date"`
	Name             string `json:"name"`
	MarketLocalImages
}

MarketVersionDefinition represents version of marketplace image

type MarketVersions

type MarketVersions struct {
	Versions []MarketVersionDefinition `json:"versions"`
}

MarketVersions represents an array of marketplace image versions

type ProductNetwork

type ProductNetwork struct {
	Interfaces             []ProductNetworkInterface `json:"interfaces,omitempty"`
	TotalInternalBandwidth uint64                    `json:"sum_internal_bandwidth,omitempty"`
	TotalInternetBandwidth uint64                    `json:"sum_internet_bandwidth,omitempty"`
	IPv6_Support           bool                      `json:"ipv6_support,omitempty"`
}

ProductNetwork lists all the network interfaces

type ProductNetworkInterface

type ProductNetworkInterface struct {
	InternalBandwidth uint64 `json:"internal_bandwidth,omitempty"`
	InternetBandwidth uint64 `json:"internet_bandwidth,omitempty"`
}

ProductNetworkInterface gives interval and external allowed bandwidth

type ProductServer

type ProductServer struct {
	Arch              string                  `json:"arch,omitempty"`
	Ncpus             uint64                  `json:"ncpus,omitempty"`
	Ram               uint64                  `json:"ram,omitempty"`
	Baremetal         bool                    `json:"baremetal,omitempty"`
	VolumesConstraint ProductVolumeConstraint `json:"volumes_constraint,omitempty"`
	AltNames          []string                `json:"alt_names,omitempty"`
	Network           ProductNetwork          `json:"network,omitempty"`
}

ProductServerOffer represents a specific offer

type ProductVolumeConstraint

type ProductVolumeConstraint struct {
	MinSize uint64 `json:"min_size,omitempty"`
	MaxSize uint64 `json:"max_size,omitempty"`
}

ProductVolumeConstraint contains any volume constraint that the offer has

type ScalewayAPIError

type ScalewayAPIError struct {
	// Message is a human-friendly error message
	APIMessage string `json:"message,omitempty"`

	// Type is a string code that defines the kind of error
	Type string `json:"type,omitempty"`

	// Fields contains detail about validation error
	Fields map[string][]string `json:"fields,omitempty"`

	// StatusCode is the HTTP status code received
	StatusCode int `json:"-"`

	// Message
	Message string `json:"-"`
}

ScalewayAPIError represents a Scaleway API Error

func (ScalewayAPIError) Error

func (e ScalewayAPIError) Error() string

Error returns a string representing the error

type ScalewayBootscript

type ScalewayBootscript struct {
	Bootcmdargs string `json:"bootcmdargs,omitempty"`
	Dtb         string `json:"dtb,omitempty"`
	Initrd      string `json:"initrd,omitempty"`
	Kernel      string `json:"kernel,omitempty"`

	// Arch is the architecture target of the bootscript
	Arch string `json:"architecture,omitempty"`

	// Identifier is a unique identifier for the bootscript
	Identifier string `json:"id,omitempty"`

	// Organization is the owner of the bootscript
	Organization string `json:"organization,omitempty"`

	// Name is a user-defined name for the bootscript
	Title string `json:"title,omitempty"`

	// Public is true for public bootscripts and false for user bootscripts
	Public bool `json:"public,omitempty"`

	Default bool `json:"default,omitempty"`
}

ScalewayBootscript represents a Scaleway Bootscript

type ScalewayBootscripts

type ScalewayBootscripts struct {
	// Bootscripts holds Scaleway bootscripts of the response
	Bootscripts []ScalewayBootscript `json:"bootscripts,omitempty"`
}

ScalewayBootscripts represents a group of Scaleway bootscripts

type ScalewayConnect

type ScalewayConnect struct {
	Email       string `json:"email"`
	Password    string `json:"password"`
	Description string `json:"description"`
	Expires     bool   `json:"expires"`
}

ScalewayConnect represents the data to connect

func (*ScalewayConnect) GetPassword

func (s *ScalewayConnect) GetPassword() string

type ScalewayConnectByBackupCode

type ScalewayConnectByBackupCode struct {
	ScalewayConnect
	TwoFABackupCode string `json:"2FA_backup_code"`
}

type ScalewayConnectByOTP

type ScalewayConnectByOTP struct {
	ScalewayConnect
	TwoFAToken string `json:"2FA_token"`
}

type ScalewayConnectInterface

type ScalewayConnectInterface interface {
	GetPassword() string
}

ScalewayConnectInterface is the interface implemented by ScalewayConnect, ScalewayConnectByOTP and ScalewayConnectByBackupCode

type ScalewayConnectResponse

type ScalewayConnectResponse struct {
	Token ScalewayTokenDefinition `json:"token"`
}

ScalewayConnectResponse represents the answer from POST /tokens

type ScalewayContainer

type ScalewayContainer struct {
	ScalewayOrganizationDefinition `json:"organization"`
	Name                           string `json:"name"`
	Size                           string `json:"size"`
}

ScalewayContainer represents a Scaleway container (S3)

type ScalewayContainerData

type ScalewayContainerData struct {
	LastModified string `json:"last_modified"`
	Name         string `json:"name"`
	Size         string `json:"size"`
}

ScalewayContainerData represents a Scaleway container data (S3)

type ScalewayDashboard

type ScalewayDashboard struct {
	VolumesCount        int `json:"volumes_count"`
	RunningServersCount int `json:"running_servers_count"`
	ImagesCount         int `json:"images_count"`
	SnapshotsCount      int `json:"snapshots_count"`
	ServersCount        int `json:"servers_count"`
	IPsCount            int `json:"ips_count"`
}

ScalewayDashboard represents a dashboard

type ScalewayDashboardResp

type ScalewayDashboardResp struct {
	Dashboard ScalewayDashboard
}

ScalewayDashboardResp represents a dashboard received from the API

type ScalewayGetContainerDatas

type ScalewayGetContainerDatas struct {
	Container []ScalewayContainerData `json:"container"`
}

ScalewayGetContainerDatas represents a list of Scaleway containers data (S3)

type ScalewayGetContainers

type ScalewayGetContainers struct {
	Containers []ScalewayContainer `json:"containers"`
}

ScalewayGetContainers represents a list of Scaleway containers (S3)

type ScalewayGetIP

type ScalewayGetIP struct {
	IP ScalewayIPDefinition `json:"ip"`
}

ScalewayGetIP represents the response of a GET /ips/{id_ip}

type ScalewayGetIPS

type ScalewayGetIPS struct {
	IPS []ScalewayIPDefinition `json:"ips"`
}

ScalewayGetIPS represents the response of a GET /ips/

type ScalewayGetQuotas

type ScalewayGetQuotas struct {
	Quotas ScalewayQuota `json:"quotas"`
}

ScalewayGetQuotas represents the response of GET /organizations/{orga_id}/quotas

type ScalewayGetSecurityGroup

type ScalewayGetSecurityGroup struct {
	SecurityGroups ScalewaySecurityGroups `json:"security_group"`
}

ScalewayGetSecurityGroup represents the response of a GET /security_groups/{groupID}

type ScalewayGetSecurityGroupRule

type ScalewayGetSecurityGroupRule struct {
	Rules ScalewaySecurityGroupRule `json:"rule"`
}

ScalewayGetSecurityGroupRule represents the response of a GET /security_group/{groupID}/rules/{ruleID}

type ScalewayGetSecurityGroupRules

type ScalewayGetSecurityGroupRules struct {
	Rules []ScalewaySecurityGroupRule `json:"rules"`
}

ScalewayGetSecurityGroupRules represents the response of a GET /security_group/{groupID}/rules

type ScalewayGetSecurityGroups

type ScalewayGetSecurityGroups struct {
	SecurityGroups []ScalewaySecurityGroups `json:"security_groups"`
}

ScalewayGetSecurityGroups represents the response of a GET /security_groups/

type ScalewayGetTokens

type ScalewayGetTokens struct {
	Tokens []ScalewayTokenDefinition `json:"tokens"`
}

ScalewayGetTokens represents a list of Scaleway Tokens

type ScalewayIPAddress

type ScalewayIPAddress struct {
	// Identifier is a unique identifier for the IP address
	Identifier string `json:"id,omitempty"`

	// IP is an IPv4 address
	IP string `json:"address,omitempty"`

	// Dynamic is a flag that defines an IP that change on each reboot
	Dynamic *bool `json:"dynamic,omitempty"`
}

ScalewayIPAddress represents a Scaleway IP address

type ScalewayIPDefinition

type ScalewayIPDefinition struct {
	Organization string  `json:"organization"`
	Reverse      *string `json:"reverse"`
	ID           string  `json:"id"`
	Server       *struct {
		Identifier string `json:"id,omitempty"`
		Name       string `json:"name,omitempty"`
	} `json:"server"`
	Address string `json:"address"`
}

ScalewayIPDefinition represents the IP's fields

type ScalewayIPV6Definition

type ScalewayIPV6Definition struct {
	Netmask string `json:"netmask"`
	Gateway string `json:"gateway"`
	Address string `json:"address"`
}

ScalewayIPV6Definition represents a Scaleway ipv6

type ScalewayImage

type ScalewayImage struct {
	// Identifier is a unique identifier for the image
	Identifier string `json:"id,omitempty"`

	// Name is a user-defined name for the image
	Name string `json:"name,omitempty"`

	// CreationDate is the creation date of the image
	CreationDate string `json:"creation_date,omitempty"`

	// ModificationDate is the date of the last modification of the image
	ModificationDate string `json:"modification_date,omitempty"`

	// RootVolume is the root volume bound to the image
	RootVolume ScalewayVolume `json:"root_volume,omitempty"`

	// Public is true for public images and false for user images
	Public bool `json:"public,omitempty"`

	// Bootscript is the bootscript bound to the image
	DefaultBootscript *ScalewayBootscript `json:"default_bootscript,omitempty"`

	// Organization is the owner of the image
	Organization string `json:"organization,omitempty"`

	// Arch is the architecture target of the image
	Arch string `json:"arch,omitempty"`
}

ScalewayImage represents a Scaleway Image

type ScalewayImageDefinition

type ScalewayImageDefinition struct {
	SnapshotIDentifier string  `json:"root_volume"`
	Name               string  `json:"name,omitempty"`
	Organization       string  `json:"organization"`
	Arch               string  `json:"arch"`
	DefaultBootscript  *string `json:"default_bootscript,omitempty"`
}

ScalewayImageDefinition represents a Scaleway image definition

type ScalewayImageIdentifier

type ScalewayImageIdentifier struct {
	Identifier string
	Arch       string
	Region     string
	Owner      string
}

ScalewayImageIdentifier represents a Scaleway Image Identifier

type ScalewayImages

type ScalewayImages struct {
	// Images holds scaleway images of the response
	Images []ScalewayImage `json:"images,omitempty"`
}

ScalewayImages represents a group of Scaleway images

type ScalewayKeyDefinition

type ScalewayKeyDefinition struct {
	Key         string `json:"key"`
	Fingerprint string `json:"fingerprint,omitempty"`
}

ScalewayKeyDefinition represents a key

type ScalewayNewSecurityGroup

type ScalewayNewSecurityGroup struct {
	Organization string `json:"organization"`
	Name         string `json:"name"`
	Description  string `json:"description"`
}

ScalewayNewSecurityGroup definition POST request /security_groups

type ScalewayNewSecurityGroupRule

type ScalewayNewSecurityGroupRule struct {
	Action       string `json:"action"`
	Direction    string `json:"direction"`
	IPRange      string `json:"ip_range"`
	Protocol     string `json:"protocol"`
	DestPortFrom int    `json:"dest_port_from,omitempty"`
}

ScalewayNewSecurityGroupRule definition POST/PUT request /security_group/{groupID}

type ScalewayOneBootscript

type ScalewayOneBootscript struct {
	Bootscript ScalewayBootscript `json:"bootscript,omitempty"`
}

ScalewayOneBootscript represents the response of a GET /bootscripts/UUID API call

type ScalewayOneImage

type ScalewayOneImage struct {
	Image ScalewayImage `json:"image,omitempty"`
}

ScalewayOneImage represents the response of a GET /images/UUID API call

type ScalewayOneServer

type ScalewayOneServer struct {
	Server ScalewayServer `json:"server,omitempty"`
}

ScalewayOneServer represents the response of a GET /servers/UUID API call

type ScalewayOneSnapshot

type ScalewayOneSnapshot struct {
	Snapshot ScalewaySnapshot `json:"snapshot,omitempty"`
}

ScalewayOneSnapshot represents the response of a GET /snapshots/UUID API call

type ScalewayOneTask

type ScalewayOneTask struct {
	Task ScalewayTask `json:"task,omitempty"`
}

ScalewayOneTask represents the response of a GET /tasks/UUID API call

type ScalewayOneVolume

type ScalewayOneVolume struct {
	Volume ScalewayVolume `json:"volume,omitempty"`
}

ScalewayOneVolume represents the response of a GET /volumes/UUID API call

type ScalewayOrganizationDefinition

type ScalewayOrganizationDefinition struct {
	ID    string                   `json:"id"`
	Name  string                   `json:"name"`
	Users []ScalewayUserDefinition `json:"users"`
}

ScalewayOrganizationDefinition represents a Scaleway Organization

type ScalewayOrganizationsDefinition

type ScalewayOrganizationsDefinition struct {
	Organizations []ScalewayOrganizationDefinition `json:"organizations"`
}

ScalewayOrganizationsDefinition represents a Scaleway Organizations

type ScalewayPermCategory

type ScalewayPermCategory map[string][]string

ScalewayPermCategory represents ScalewayPermissions's fields

type ScalewayPermissionDefinition

type ScalewayPermissionDefinition struct {
	Permissions ScalewayPermissions `json:"permissions"`
}

ScalewayPermissionDefinition represents the permissions

type ScalewayPermissions

type ScalewayPermissions map[string]ScalewayPermCategory

ScalewayPermissions represents the response of GET /permissions

type ScalewayProductsServers

type ScalewayProductsServers struct {
	Servers map[string]ProductServer `json:"servers"`
}

Products holds a map of all Scaleway servers

type ScalewayQuota

type ScalewayQuota map[string]int

ScalewayQuota represents a map of quota (name, value)

type ScalewayResolverResult

type ScalewayResolverResult struct {
	Identifier string
	Type       int
	Name       string
	Arch       string
	Needle     string
	RankMatch  int
	Region     string
}

ScalewayResolverResult is a structure containing human-readable information about resolver results. This structure is used to display the user choices.

func NewScalewayResolverResult

func NewScalewayResolverResult(Identifier, Name, Arch, Region string, Type int) (ScalewayResolverResult, error)

NewScalewayResolverResult returns a new ScalewayResolverResult

func (*ScalewayResolverResult) CodeName

func (s *ScalewayResolverResult) CodeName() string

CodeName returns a full resource name with typed prefix

func (*ScalewayResolverResult) TruncIdentifier

func (s *ScalewayResolverResult) TruncIdentifier() string

TruncIdentifier returns first 8 characters of an Identifier (UUID)

type ScalewayResolverResults

type ScalewayResolverResults []ScalewayResolverResult

ScalewayResolverResults is a list of `ScalewayResolverResult`

func (*ScalewayResolverResults) FilterByArch

func (s *ScalewayResolverResults) FilterByArch(arch string)

FilterByArch deletes the elements which not match with arch

func (ScalewayResolverResults) Len

func (s ScalewayResolverResults) Len() int

func (ScalewayResolverResults) Less

func (s ScalewayResolverResults) Less(i, j int) bool

func (ScalewayResolverResults) Swap

func (s ScalewayResolverResults) Swap(i, j int)

type ScalewayRoleDefinition

type ScalewayRoleDefinition struct {
	Organization ScalewayOrganizationDefinition `json:"organization,omitempty"`
	Role         string                         `json:"role,omitempty"`
}

ScalewayRoleDefinition represents a Scaleway Token UserId Role

type ScalewaySecurityGroup

type ScalewaySecurityGroup struct {
	// Identifier is a unique identifier for the security group
	Identifier string `json:"id,omitempty"`

	// Name is the user-defined name of the security group
	Name string `json:"name,omitempty"`
}

ScalewaySecurityGroup represents a Scaleway security group

type ScalewaySecurityGroupRule

type ScalewaySecurityGroupRule struct {
	Direction    string `json:"direction"`
	Protocol     string `json:"protocol"`
	IPRange      string `json:"ip_range"`
	DestPortFrom int    `json:"dest_port_from,omitempty"`
	Action       string `json:"action"`
	Position     int    `json:"position"`
	DestPortTo   string `json:"dest_port_to"`
	Editable     bool   `json:"editable"`
	ID           string `json:"id"`
}

ScalewaySecurityGroupRule definition

type ScalewaySecurityGroups

type ScalewaySecurityGroups struct {
	Description           string                  `json:"description"`
	ID                    string                  `json:"id"`
	Organization          string                  `json:"organization"`
	Name                  string                  `json:"name"`
	Servers               []ScalewaySecurityGroup `json:"servers"`
	EnableDefaultSecurity bool                    `json:"enable_default_security"`
	OrganizationDefault   bool                    `json:"organization_default"`
}

ScalewaySecurityGroups definition

type ScalewayServer

type ScalewayServer struct {
	// Arch is the architecture target of the server
	Arch string `json:"arch,omitempty"`

	// Identifier is a unique identifier for the server
	Identifier string `json:"id,omitempty"`

	// Name is the user-defined name of the server
	Name string `json:"name,omitempty"`

	// CreationDate is the creation date of the server
	CreationDate string `json:"creation_date,omitempty"`

	// ModificationDate is the date of the last modification of the server
	ModificationDate string `json:"modification_date,omitempty"`

	// Image is the image used by the server
	Image ScalewayImage `json:"image,omitempty"`

	// DynamicIPRequired is a flag that defines a server with a dynamic ip address attached
	DynamicIPRequired *bool `json:"dynamic_ip_required,omitempty"`

	// PublicIP is the public IP address bound to the server
	PublicAddress ScalewayIPAddress `json:"public_ip,omitempty"`

	// State is the current status of the server
	State string `json:"state,omitempty"`

	// StateDetail is the detailed status of the server
	StateDetail string `json:"state_detail,omitempty"`

	// PrivateIP represents the private IPV4 attached to the server (changes on each boot)
	PrivateIP string `json:"private_ip,omitempty"`

	// Bootscript is the unique identifier of the selected bootscript
	Bootscript *ScalewayBootscript `json:"bootscript,omitempty"`

	// Hostname represents the ServerName in a format compatible with unix's hostname
	Hostname string `json:"hostname,omitempty"`

	// Tags represents user-defined tags
	Tags []string `json:"tags,omitempty"`

	// Volumes are the attached volumes
	Volumes map[string]ScalewayVolume `json:"volumes,omitempty"`

	// SecurityGroup is the selected security group object
	SecurityGroup ScalewaySecurityGroup `json:"security_group,omitempty"`

	// Organization is the owner of the server
	Organization string `json:"organization,omitempty"`

	// CommercialType is the commercial type of the server (i.e: C1, C2[SML], VC1S)
	CommercialType string `json:"commercial_type,omitempty"`

	// Location of the server
	Location struct {
		Platform   string `json:"platform_id,omitempty"`
		Chassis    string `json:"chassis_id,omitempty"`
		Cluster    string `json:"cluster_id,omitempty"`
		Hypervisor string `json:"hypervisor_id,omitempty"`
		Blade      string `json:"blade_id,omitempty"`
		Node       string `json:"node_id,omitempty"`
		ZoneID     string `json:"zone_id,omitempty"`
	} `json:"location,omitempty"`

	IPV6 *ScalewayIPV6Definition `json:"ipv6,omitempty"`

	EnableIPV6 bool `json:"enable_ipv6,omitempty"`

	// This fields are not returned by the API, we generate it
	DNSPublic  string `json:"dns_public,omitempty"`
	DNSPrivate string `json:"dns_private,omitempty"`
}

ScalewayServer represents a Scaleway server

type ScalewayServerAction

type ScalewayServerAction struct {
	// Action is the name of the action to trigger
	Action string `json:"action,omitempty"`
}

ScalewayServerAction represents an action to perform on a Scaleway server

type ScalewayServerDefinition

type ScalewayServerDefinition struct {
	// Name is the user-defined name of the server
	Name string `json:"name"`

	// Image is the image used by the server
	Image *string `json:"image,omitempty"`

	// Volumes are the attached volumes
	Volumes map[string]string `json:"volumes,omitempty"`

	// DynamicIPRequired is a flag that defines a server with a dynamic ip address attached
	DynamicIPRequired *bool `json:"dynamic_ip_required,omitempty"`

	// BootType defines the type of boot
	BootType string `json:"boot_type,omitempty"`

	// Bootscript is the bootscript used by the server
	Bootscript *string `json:"bootscript"`

	// Tags are the metadata tags attached to the server
	Tags []string `json:"tags,omitempty"`

	// Organization is the owner of the server
	Organization string `json:"organization"`

	// CommercialType is the commercial type of the server (i.e: C1, C2[SML], VC1S)
	CommercialType string `json:"commercial_type"`

	PublicIP string `json:"public_ip,omitempty"`

	EnableIPV6 bool `json:"enable_ipv6,omitempty"`

	SecurityGroup string `json:"security_group,omitempty"`
}

ScalewayServerDefinition represents a Scaleway server with image definition

type ScalewayServerPatchDefinition

type ScalewayServerPatchDefinition struct {
	Arch              *string                    `json:"arch,omitempty"`
	Name              *string                    `json:"name,omitempty"`
	CreationDate      *string                    `json:"creation_date,omitempty"`
	ModificationDate  *string                    `json:"modification_date,omitempty"`
	Image             *ScalewayImage             `json:"image,omitempty"`
	DynamicIPRequired *bool                      `json:"dynamic_ip_required,omitempty"`
	PublicAddress     *ScalewayIPAddress         `json:"public_ip,omitempty"`
	State             *string                    `json:"state,omitempty"`
	StateDetail       *string                    `json:"state_detail,omitempty"`
	PrivateIP         *string                    `json:"private_ip,omitempty"`
	Bootscript        *string                    `json:"bootscript,omitempty"`
	Hostname          *string                    `json:"hostname,omitempty"`
	Volumes           *map[string]ScalewayVolume `json:"volumes,omitempty"`
	SecurityGroup     *ScalewaySecurityGroup     `json:"security_group,omitempty"`
	Organization      *string                    `json:"organization,omitempty"`
	Tags              *[]string                  `json:"tags,omitempty"`
	IPV6              *ScalewayIPV6Definition    `json:"ipv6,omitempty"`
	EnableIPV6        *bool                      `json:"enable_ipv6,omitempty"`
}

ScalewayServerPatchDefinition represents a Scaleway server with nullable fields (for PATCH)

type ScalewayServers

type ScalewayServers struct {
	// Servers holds scaleway servers of the response
	Servers []ScalewayServer `json:"servers,omitempty"`
}

ScalewayServers represents a group of Scaleway servers

type ScalewaySnapshot

type ScalewaySnapshot struct {
	// Identifier is a unique identifier for the snapshot
	Identifier string `json:"id,omitempty"`

	// Name is a user-defined name for the snapshot
	Name string `json:"name,omitempty"`

	// CreationDate is the creation date of the snapshot
	CreationDate string `json:"creation_date,omitempty"`

	// ModificationDate is the date of the last modification of the snapshot
	ModificationDate string `json:"modification_date,omitempty"`

	// Size is the allocated size of the volume
	Size uint64 `json:"size,omitempty"`

	// Organization is the owner of the snapshot
	Organization string `json:"organization"`

	// State is the current state of the snapshot
	State string `json:"state"`

	// VolumeType is the kind of volume behind the snapshot
	VolumeType string `json:"volume_type"`

	// BaseVolume is the volume from which the snapshot inherits
	BaseVolume ScalewayVolume `json:"base_volume,omitempty"`
}

ScalewaySnapshot represents a Scaleway Snapshot

type ScalewaySnapshotDefinition

type ScalewaySnapshotDefinition struct {
	VolumeIDentifier string `json:"volume_id"`
	Name             string `json:"name,omitempty"`
	Organization     string `json:"organization"`
}

ScalewaySnapshotDefinition represents a Scaleway snapshot definition

type ScalewaySnapshots

type ScalewaySnapshots struct {
	// Snapshots holds scaleway snapshots of the response
	Snapshots []ScalewaySnapshot `json:"snapshots,omitempty"`
}

ScalewaySnapshots represents a group of Scaleway snapshots

type ScalewaySortServers

type ScalewaySortServers []ScalewayServer

ScalewaySortServers represents a wrapper to sort by CreationDate the servers

func (ScalewaySortServers) Len

func (s ScalewaySortServers) Len() int

func (ScalewaySortServers) Less

func (s ScalewaySortServers) Less(i, j int) bool

func (ScalewaySortServers) Swap

func (s ScalewaySortServers) Swap(i, j int)

type ScalewayTask

type ScalewayTask struct {
	// Identifier is a unique identifier for the task
	Identifier string `json:"id,omitempty"`

	// StartDate is the start date of the task
	StartDate string `json:"started_at,omitempty"`

	// TerminationDate is the termination date of the task
	TerminationDate string `json:"terminated_at,omitempty"`

	HrefFrom string `json:"href_from,omitempty"`

	Description string `json:"description,omitempty"`

	Status string `json:"status,omitempty"`

	Progress int `json:"progress,omitempty"`
}

ScalewayTask represents a Scaleway Task

type ScalewayTasks

type ScalewayTasks struct {
	// Tasks holds scaleway tasks of the response
	Tasks []ScalewayTask `json:"tasks,omitempty"`
}

ScalewayTasks represents a group of Scaleway tasks

type ScalewayTokenDefinition

type ScalewayTokenDefinition struct {
	UserID             string                 `json:"user_id"`
	Description        string                 `json:"description,omitempty"`
	Roles              ScalewayRoleDefinition `json:"roles"`
	Expires            string                 `json:"expires"`
	InheritsUsersPerms bool                   `json:"inherits_user_perms"`
	ID                 string                 `json:"id"`
}

ScalewayTokenDefinition represents a Scaleway Token

type ScalewayTokensDefinition

type ScalewayTokensDefinition struct {
	Token ScalewayTokenDefinition `json:"token"`
}

ScalewayTokensDefinition represents a Scaleway Tokens

type ScalewayUpdateSecurityGroup

type ScalewayUpdateSecurityGroup struct {
	Organization        string `json:"organization"`
	Name                string `json:"name"`
	Description         string `json:"description"`
	OrganizationDefault bool   `json:"organization_default"`
}

ScalewayUpdateSecurityGroup definition PUT request /security_groups

type ScalewayUserDefinition

type ScalewayUserDefinition struct {
	Email         string                           `json:"email"`
	Firstname     string                           `json:"firstname"`
	Fullname      string                           `json:"fullname"`
	ID            string                           `json:"id"`
	Lastname      string                           `json:"lastname"`
	Organizations []ScalewayOrganizationDefinition `json:"organizations"`
	Roles         []ScalewayRoleDefinition         `json:"roles"`
	SSHPublicKeys []ScalewayKeyDefinition          `json:"ssh_public_keys"`
}

ScalewayUserDefinition represents a Scaleway User

type ScalewayUserPatchSSHKeyDefinition

type ScalewayUserPatchSSHKeyDefinition struct {
	SSHPublicKeys []ScalewayKeyDefinition `json:"ssh_public_keys"`
}

ScalewayUserPatchSSHKeyDefinition represents a User Patch

type ScalewayUserdata

type ScalewayUserdata []byte

ScalewayUserdata represents []byte

func (*ScalewayUserdata) String

func (s *ScalewayUserdata) String() string

type ScalewayUserdatas

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

ScalewayUserdatas represents the response of a GET /user_data

type ScalewayUsersDefinition

type ScalewayUsersDefinition struct {
	User ScalewayUserDefinition `json:"user"`
}

ScalewayUsersDefinition represents the response of a GET /user

type ScalewayVolume

type ScalewayVolume struct {
	// Identifier is a unique identifier for the volume
	Identifier string `json:"id,omitempty"`

	// Size is the allocated size of the volume
	Size uint64 `json:"size,omitempty"`

	// CreationDate is the creation date of the volume
	CreationDate string `json:"creation_date,omitempty"`

	// ModificationDate is the date of the last modification of the volume
	ModificationDate string `json:"modification_date,omitempty"`

	// Organization is the organization owning the volume
	Organization string `json:"organization,omitempty"`

	// Name is the name of the volume
	Name string `json:"name,omitempty"`

	// Server is the server using this image
	Server *struct {
		Identifier string `json:"id,omitempty"`
		Name       string `json:"name,omitempty"`
	} `json:"server,omitempty"`

	// VolumeType is a Scaleway identifier for the kind of volume (default: l_ssd)
	VolumeType string `json:"volume_type,omitempty"`

	// ExportURI represents the url used by initrd/scripts to attach the volume
	ExportURI string `json:"export_uri,omitempty"`
}

ScalewayVolume represents a Scaleway Volume

type ScalewayVolumeDefinition

type ScalewayVolumeDefinition struct {
	// Name is the user-defined name of the volume
	Name string `json:"name"`

	// Image is the image used by the volume
	Size uint64 `json:"size"`

	// Bootscript is the bootscript used by the volume
	Type string `json:"volume_type"`

	// Organization is the owner of the volume
	Organization string `json:"organization"`
}

ScalewayVolumeDefinition represents a Scaleway volume definition

type ScalewayVolumePutDefinition

type ScalewayVolumePutDefinition struct {
	Identifier       *string `json:"id,omitempty"`
	Size             *uint64 `json:"size,omitempty"`
	CreationDate     *string `json:"creation_date,omitempty"`
	ModificationDate *string `json:"modification_date,omitempty"`
	Organization     *string `json:"organization,omitempty"`
	Name             *string `json:"name,omitempty"`
	Server           struct {
		Identifier *string `json:"id,omitempty"`
		Name       *string `json:"name,omitempty"`
	} `json:"server,omitempty"`
	VolumeType *string `json:"volume_type,omitempty"`
	ExportURI  *string `json:"export_uri,omitempty"`
}

ScalewayVolumePutDefinition represents a Scaleway volume with nullable fields (for PUT)

type ScalewayVolumes

type ScalewayVolumes struct {
	// Volumes holds scaleway volumes of the response
	Volumes []ScalewayVolume `json:"volumes,omitempty"`
}

ScalewayVolumes represents a group of Scaleway volumes

Jump to

Keyboard shortcuts

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