applesilicon

package
v1.0.0-beta.19 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Overview

Package applesilicon provides methods and message types of the applesilicon v1alpha1 API.

Index

Constants

View Source
const (
	ListServersRequestOrderByCreatedAtAsc  = ListServersRequestOrderBy("created_at_asc")
	ListServersRequestOrderByCreatedAtDesc = ListServersRequestOrderBy("created_at_desc")
)
View Source
const (
	ServerStatusUnknownStatus = ServerStatus("unknown_status")
	ServerStatusStarting      = ServerStatus("starting")
	ServerStatusReady         = ServerStatus("ready")
	ServerStatusError         = ServerStatus("error")
	ServerStatusRebooting     = ServerStatus("rebooting")
	ServerStatusUpdating      = ServerStatus("updating")
	ServerStatusLocking       = ServerStatus("locking")
	ServerStatusLocked        = ServerStatus("locked")
	ServerStatusUnlocking     = ServerStatus("unlocking")
	ServerStatusReinstalling  = ServerStatus("reinstalling")
)
View Source
const (
	ServerTypeStockUnknownStock = ServerTypeStock("unknown_stock")
	ServerTypeStockNoStock      = ServerTypeStock("no_stock")
	ServerTypeStockLowStock     = ServerTypeStock("low_stock")
	ServerTypeStockHighStock    = ServerTypeStock("high_stock")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API: apple silicon API.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) CreateServer

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

CreateServer: create a server. Create a new server in the targeted zone, specifying its configuration including name and type.

func (*API) DeleteServer

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

DeleteServer: delete a server. Delete an existing Apple silicon server, specified by its server ID. Deleting a server is permanent, and cannot be undone. Note that the minimum allocation period for Apple silicon-as-a-service is 24 hours, meaning you cannot delete your server prior to that.

func (*API) GetOS

func (s *API) GetOS(req *GetOSRequest, opts ...scw.RequestOption) (*OS, error)

GetOS: get an Operating System (OS). Get an Operating System (OS). The response will include the OS's unique ID as well as its name and label.

func (*API) GetServer

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

GetServer: get a server. Retrieve information about an existing Apple silicon server, specified by its server ID. Its full details, including name, status and IP address, are returned in the response object.

func (*API) GetServerType

func (s *API) GetServerType(req *GetServerTypeRequest, opts ...scw.RequestOption) (*ServerType, error)

GetServerType: get a server type. Get technical details (CPU, disk size etc.) of a server type.

func (*API) ListOS

func (s *API) ListOS(req *ListOSRequest, opts ...scw.RequestOption) (*ListOSResponse, error)

ListOS: list all Operating Systems (OS). List all Operating Systems (OS). The response will include the total number of OS as well as their associated IDs, names and labels.

func (*API) ListServerTypes

func (s *API) ListServerTypes(req *ListServerTypesRequest, opts ...scw.RequestOption) (*ListServerTypesResponse, error)

ListServerTypes: list server types. List all technical details about Apple silicon server types available in the specified zone. Since there is only one Availability Zone for Apple silicon servers, the targeted value is `fr-par-3`.

func (*API) ListServers

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

ListServers: list all servers. List all servers in the specified zone. By default, returned servers in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.

func (*API) RebootServer

func (s *API) RebootServer(req *RebootServerRequest, opts ...scw.RequestOption) (*Server, error)

RebootServer: reboot a server. Reboot an existing Apple silicon server, specified by its server ID.

func (*API) ReinstallServer

func (s *API) ReinstallServer(req *ReinstallServerRequest, opts ...scw.RequestOption) (*Server, error)

ReinstallServer: reinstall a server. Reinstall an existing Apple silicon server (specified by its server ID) from a new image (OS). All the data on the disk is deleted and all configuration is reset to the defailt configuration values of the image (OS).

func (*API) UpdateServer

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

UpdateServer: update a server. Update the parameters of an existing Apple silicon server, specified by its server ID.

func (*API) WaitForServer

func (s *API) WaitForServer(req *WaitForServerRequest, opts ...scw.RequestOption) (*Server, error)

WaitForServer waits for the instance to be in a "terminal state" before returning. This function can be used to wait for an instance to be ready for example.

func (*API) Zones

func (s *API) Zones() []scw.Zone

Zones list localities the api is available in

type CreateServerRequest

type CreateServerRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`
	// Name: create a server with this given name.
	Name string `json:"name"`
	// ProjectID: create a server in the given project ID.
	ProjectID string `json:"project_id"`
	// Type: create a server of the given type.
	Type string `json:"type"`
}

type DeleteServerRequest

type DeleteServerRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`
	// ServerID: UUID of the server you want to delete.
	ServerID string `json:"-"`
}

type GetOSRequest

type GetOSRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`
	// OsID: UUID of the OS you want to get.
	OsID string `json:"-"`
}

type GetServerRequest

type GetServerRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`
	// ServerID: UUID of the server you want to get.
	ServerID string `json:"-"`
}

type GetServerTypeRequest

type GetServerTypeRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`
	// ServerType: server type identifier.
	ServerType string `json:"-"`
}

type ListOSRequest

type ListOSRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`
	// Page: positive integer to choose the page to return.
	Page *int32 `json:"-"`
	// PageSize: positive integer lower or equal to 100 to select the number of items to return.
	// Default value: 50
	PageSize *uint32 `json:"-"`
	// ServerType: list of compatible server types.
	ServerType *string `json:"-"`
	// Name: filter OS by name (note that "11.1" will return "11.1.2" and "11.1" but not "12")).
	Name *string `json:"-"`
}

type ListOSResponse

type ListOSResponse struct {
	// TotalCount: total number of OS.
	TotalCount uint32 `json:"total_count"`
	// Os: list of OS.
	Os []*OS `json:"os"`
}

ListOSResponse: list os response.

func (*ListOSResponse) UnsafeAppend

func (r *ListOSResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListOSResponse) UnsafeGetTotalCount

func (r *ListOSResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListServerTypesRequest

type ListServerTypesRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`
}

type ListServerTypesResponse

type ListServerTypesResponse struct {
	// ServerTypes: available server types.
	ServerTypes []*ServerType `json:"server_types"`
}

ListServerTypesResponse: list server types response.

type ListServersRequest

type ListServersRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`
	// OrderBy: sort order of the returned servers.
	// Default value: created_at_asc
	OrderBy ListServersRequestOrderBy `json:"-"`
	// ProjectID: only list servers of this project ID.
	ProjectID *string `json:"-"`
	// OrganizationID: only list servers of this Organization ID.
	OrganizationID *string `json:"-"`
	// Page: positive integer to choose the page to return.
	Page *int32 `json:"-"`
	// PageSize: positive integer lower or equal to 100 to select the number of items to return.
	// Default value: 50
	PageSize *uint32 `json:"-"`
}

type ListServersRequestOrderBy

type ListServersRequestOrderBy string

func (ListServersRequestOrderBy) MarshalJSON

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

func (ListServersRequestOrderBy) String

func (enum ListServersRequestOrderBy) String() string

func (*ListServersRequestOrderBy) UnmarshalJSON

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

type ListServersResponse

type ListServersResponse struct {
	// TotalCount: total number of servers.
	TotalCount uint32 `json:"total_count"`
	// Servers: paginated returned servers.
	Servers []*Server `json:"servers"`
}

ListServersResponse: list servers response.

func (*ListServersResponse) UnsafeAppend

func (r *ListServersResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListServersResponse) UnsafeGetTotalCount

func (r *ListServersResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type OS

type OS struct {
	// ID: unique ID of the OS.
	ID string `json:"id"`
	// Name: oS name.
	Name string `json:"name"`
	// Label: oS name as it should be displayed.
	Label string `json:"label"`
	// ImageURL: URL of the image.
	ImageURL string `json:"image_url"`
	// CompatibleServerTypes: list of compatible server types.
	CompatibleServerTypes []string `json:"compatible_server_types"`
}

OS: os.

type RebootServerRequest

type RebootServerRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`
	// ServerID: UUID of the server you want to reboot.
	ServerID string `json:"-"`
}

type ReinstallServerRequest

type ReinstallServerRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`
	// ServerID: UUID of the server you want to reinstall.
	ServerID string `json:"-"`
}

type Server

type Server struct {
	// ID: UUID of the server.
	ID string `json:"id"`
	// Type: type of the server.
	Type string `json:"type"`
	// Name: name of the server.
	Name string `json:"name"`
	// ProjectID: project this server is associated with.
	ProjectID string `json:"project_id"`
	// OrganizationID: organization this server is associated with.
	OrganizationID string `json:"organization_id"`
	// IP: iPv4 address of the server.
	IP net.IP `json:"ip"`
	// VncURL: URL of the VNC.
	VncURL string `json:"vnc_url"`
	// Status: current status of the server.
	// Default value: unknown_status
	Status ServerStatus `json:"status"`
	// CreatedAt: date on which the server was created.
	CreatedAt *time.Time `json:"created_at"`
	// UpdatedAt: date on which the server was last updated.
	UpdatedAt *time.Time `json:"updated_at"`
	// DeletableAt: date on which the server was last deleted.
	DeletableAt *time.Time `json:"deletable_at"`
	// Zone: zone of the server.
	Zone scw.Zone `json:"zone"`
}

Server: server.

type ServerStatus

type ServerStatus string

func (ServerStatus) MarshalJSON

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

func (ServerStatus) String

func (enum ServerStatus) String() string

func (*ServerStatus) UnmarshalJSON

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

type ServerType

type ServerType struct {
	// CPU: CPU description.
	CPU *ServerTypeCPU `json:"cpu"`
	// Disk: size of the local disk of the server.
	Disk *ServerTypeDisk `json:"disk"`
	// Name: name of the type.
	Name string `json:"name"`
	// Memory: size of memory available.
	Memory *ServerTypeMemory `json:"memory"`
	// Stock: current stock.
	// Default value: unknown_stock
	Stock ServerTypeStock `json:"stock"`
	// MinimumLeaseDuration: minimum duration of the lease in seconds.
	// Minimum duration of the lease in seconds (example. 3.4s).
	MinimumLeaseDuration *scw.Duration `json:"minimum_lease_duration"`
}

ServerType: server type.

type ServerTypeCPU

type ServerTypeCPU struct {
	Name string `json:"name"`

	CoreCount uint32 `json:"core_count"`
}

type ServerTypeDisk

type ServerTypeDisk struct {
	Capacity scw.Size `json:"capacity"`

	Type string `json:"type"`
}

type ServerTypeMemory

type ServerTypeMemory struct {
	Capacity scw.Size `json:"capacity"`

	Type string `json:"type"`
}

type ServerTypeStock

type ServerTypeStock string

func (ServerTypeStock) MarshalJSON

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

func (ServerTypeStock) String

func (enum ServerTypeStock) String() string

func (*ServerTypeStock) UnmarshalJSON

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

type UpdateServerRequest

type UpdateServerRequest struct {
	// Zone: zone to target. If none is passed will use default zone from the config.
	Zone scw.Zone `json:"-"`
	// ServerID: UUID of the server you want to update.
	ServerID string `json:"-"`
	// Name: updated name for your server.
	Name *string `json:"name"`
}

type WaitForServerRequest

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

WaitForInstanceRequest is used by WaitForServer method.

Jump to

Keyboard shortcuts

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