baremetal

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IPReverseStatusUnknown is [insert doc].
	IPReverseStatusUnknown = IPReverseStatus("unknown")
	// IPReverseStatusPending is [insert doc].
	IPReverseStatusPending = IPReverseStatus("pending")
	// IPReverseStatusActive is [insert doc].
	IPReverseStatusActive = IPReverseStatus("active")
	// IPReverseStatusError is [insert doc].
	IPReverseStatusError = IPReverseStatus("error")
)
View Source
const (
	// IPVersionIPv4 is [insert doc].
	IPVersionIPv4 = IPVersion("Ipv4")
	// IPVersionIPv6 is [insert doc].
	IPVersionIPv6 = IPVersion("Ipv6")
)
View Source
const (
	// ListServerEventsRequestOrderByCreatedAtAsc is [insert doc].
	ListServerEventsRequestOrderByCreatedAtAsc = ListServerEventsRequestOrderBy("created_at_asc")
	// ListServerEventsRequestOrderByCreatedAtDesc is [insert doc].
	ListServerEventsRequestOrderByCreatedAtDesc = ListServerEventsRequestOrderBy("created_at_desc")
)
View Source
const (
	// ListServersRequestOrderByCreatedAtAsc is [insert doc].
	ListServersRequestOrderByCreatedAtAsc = ListServersRequestOrderBy("created_at_asc")
	// ListServersRequestOrderByCreatedAtDesc is [insert doc].
	ListServersRequestOrderByCreatedAtDesc = ListServersRequestOrderBy("created_at_desc")
)
View Source
const (
	// RebootServerRequestBootTypeNormal is [insert doc].
	RebootServerRequestBootTypeNormal = RebootServerRequestBootType("normal")
	// RebootServerRequestBootTypeRescue is [insert doc].
	RebootServerRequestBootTypeRescue = RebootServerRequestBootType("rescue")
)
View Source
const (
	// ServerBootTypeNormal is [insert doc].
	ServerBootTypeNormal = ServerBootType("normal")
	// ServerBootTypeRescue is [insert doc].
	ServerBootTypeRescue = ServerBootType("rescue")
)
View Source
const (
	// ServerInstallStatusUnknown is [insert doc].
	ServerInstallStatusUnknown = ServerInstallStatus("unknown")
	// ServerInstallStatusCompleted is [insert doc].
	ServerInstallStatusCompleted = ServerInstallStatus("completed")
	// ServerInstallStatusInstalling is [insert doc].
	ServerInstallStatusInstalling = ServerInstallStatus("installing")
	// ServerInstallStatusToInstall is [insert doc].
	ServerInstallStatusToInstall = ServerInstallStatus("to_install")
	// ServerInstallStatusError is [insert doc].
	ServerInstallStatusError = ServerInstallStatus("error")
)
View Source
const (
	// ServerStatusUnknown is [insert doc].
	ServerStatusUnknown = ServerStatus("unknown")
	// ServerStatusUndelivered is [insert doc].
	ServerStatusUndelivered = ServerStatus("undelivered")
	// ServerStatusReady is [insert doc].
	ServerStatusReady = ServerStatus("ready")
	// ServerStatusStopping is [insert doc].
	ServerStatusStopping = ServerStatus("stopping")
	// ServerStatusStopped is [insert doc].
	ServerStatusStopped = ServerStatus("stopped")
	// ServerStatusStarting is [insert doc].
	ServerStatusStarting = ServerStatus("starting")
	// ServerStatusError is [insert doc].
	ServerStatusError = ServerStatus("error")
	// ServerStatusDeleting is [insert doc].
	ServerStatusDeleting = ServerStatus("deleting")
	// ServerStatusLocked is [insert doc].
	ServerStatusLocked = ServerStatus("locked")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API this API allows to manage your Bare metal server.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) CreateRemoteServerAccess

func (s *API) CreateRemoteServerAccess(req *CreateRemoteServerAccessRequest, opts ...scw.RequestOption) (*RemoteServerAccess, error)

CreateRemoteServerAccess create remote server access

Create remote server access associated with the given ID. The remote access is available one hour after the installation of the server.

func (*API) CreateServer

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

CreateServer create server

Create a new server. Once the server is created, you probably want to install an OS.

func (*API) DeleteRemoteServerAccess

func (s *API) DeleteRemoteServerAccess(req *DeleteRemoteServerAccessRequest, opts ...scw.RequestOption) error

DeleteRemoteServerAccess delete remote server access

Delete remote server access associated with the given ID.

func (*API) DeleteServer

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

DeleteServer delete server

Delete the server associated with the given ID.

func (*API) GetRemoteServerAccess

func (s *API) GetRemoteServerAccess(req *GetRemoteServerAccessRequest, opts ...scw.RequestOption) (*RemoteServerAccess, error)

GetRemoteServerAccess get remote server access

Get the remote server access associated with the given ID.

func (*API) GetServer

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

GetServer get server

Get the server associated with the given ID.

func (*API) InstallServer

func (s *API) InstallServer(req *InstallServerRequest, opts ...scw.RequestOption) (*Server, error)

InstallServer install server

Install an OS on the server associated with the given ID.

func (*API) ListServerEvents

func (s *API) ListServerEvents(req *ListServerEventsRequest, opts ...scw.RequestOption) (*ListServerEventsResponse, error)

ListServerEvents list server events

List events associated to the given server ID.

func (*API) ListServers

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

ListServers list servers

List all created servers.

func (*API) RebootServer

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

RebootServer reboot server

Reboot the server associated with the given ID, use boot param to reboot in rescue.

func (*API) StartServer

func (s *API) StartServer(req *StartServerRequest, opts ...scw.RequestOption) (*Server, error)

StartServer start server

Start the server associated with the given ID.

func (*API) StopServer

func (s *API) StopServer(req *StopServerRequest, opts ...scw.RequestOption) (*Server, error)

StopServer stop server

Stop the server associated with the given ID.

func (*API) UpdateIP

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

UpdateIP update IP

Configure ip associated with the given server ID and ipID. You can use this method to set a reverse dns for an IP.

func (*API) UpdateServer

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

UpdateServer update server

Update the server associated with the given ID.

func (*API) WaitForServer

func (s *API) WaitForServer(req *WaitForServerRequest) (*Server, scw.SdkError)

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 installed for example.

type CreateRemoteServerAccessRequest

type CreateRemoteServerAccessRequest struct {
	Zone scw.Zone `json:"-"`
	// ServerID iD of the server
	ServerID string `json:"-"`
	// IP the IP authorized to connect to the given server
	IP string `json:"ip"`
}

type CreateServerRequest

type CreateServerRequest struct {
	Zone scw.Zone `json:"-"`
	// OfferID offer ID of the new server
	OfferID string `json:"offer_id"`
	// OrganizationID organization ID with which the server will be created
	OrganizationID string `json:"organization_id"`
	// Name name of the server (≠hostname)
	Name string `json:"name"`
	// Description description associated to the server, max 255 characters
	Description string `json:"description"`
	// Tags tags to associate to the server
	Tags []string `json:"tags"`
}

type DeleteRemoteServerAccessRequest

type DeleteRemoteServerAccessRequest struct {
	Zone scw.Zone `json:"-"`
	// ServerID iD of the server
	ServerID string `json:"-"`
}

type DeleteServerRequest

type DeleteServerRequest struct {
	Zone scw.Zone `json:"-"`
	// ServerID iD of the server to delete
	ServerID string `json:"-"`
}

type GetRemoteServerAccessRequest

type GetRemoteServerAccessRequest struct {
	Zone scw.Zone `json:"-"`
	// ServerID iD of the server
	ServerID string `json:"-"`
}

type GetServerRequest

type GetServerRequest struct {
	Zone scw.Zone `json:"-"`
	// ServerID iD of the server
	ServerID string `json:"-"`
}

type IP

type IP struct {
	// ID iD of the IP
	ID string `json:"id"`
	// Address address of the IP
	Address net.IP `json:"address"`
	// Reverse reverse IP value
	Reverse string `json:"reverse"`
	// Version version of IP (v4 or v6)
	//
	// Default value: Ipv4
	Version IPVersion `json:"version"`
	// ReverseStatus status of the reverse
	//
	// Default value: unknown
	ReverseStatus IPReverseStatus `json:"reverse_status"`
	// ReverseStatusMessage a message related to the reverse status, in case of an error for example
	ReverseStatusMessage *string `json:"reverse_status_message"`
}

IP ip

type IPReverseStatus

type IPReverseStatus string

func (IPReverseStatus) MarshalJSON

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

func (IPReverseStatus) String

func (enum IPReverseStatus) String() string

func (*IPReverseStatus) UnmarshalJSON

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

type IPVersion

type IPVersion string

func (IPVersion) MarshalJSON

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

func (IPVersion) String

func (enum IPVersion) String() string

func (*IPVersion) UnmarshalJSON

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

type InstallServerRequest

type InstallServerRequest struct {
	Zone scw.Zone `json:"-"`
	// ServerID server ID to install
	ServerID string `json:"-"`
	// OsID iD of the OS to install on the server
	OsID string `json:"os_id"`
	// Hostname hostname of the server
	Hostname string `json:"hostname"`
	// SSHKeyIDs sSH key IDs authorized on the server
	SSHKeyIDs []string `json:"ssh_key_ids"`
}

type ListServerEventsRequest

type ListServerEventsRequest struct {
	Zone scw.Zone `json:"-"`
	// ServerID iD of the server events searched
	ServerID string `json:"-"`
	// Page page number
	Page *int32 `json:"-"`
	// PageSize number of server events per page
	PageSize *uint32 `json:"-"`
	// OrderBy order of the server events
	//
	// Default value: created_at_asc
	OrderBy ListServerEventsRequestOrderBy `json:"-"`
}

type ListServerEventsRequestOrderBy

type ListServerEventsRequestOrderBy string

func (ListServerEventsRequestOrderBy) MarshalJSON

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

func (ListServerEventsRequestOrderBy) String

func (enum ListServerEventsRequestOrderBy) String() string

func (*ListServerEventsRequestOrderBy) UnmarshalJSON

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

type ListServerEventsResponse

type ListServerEventsResponse struct {
	// TotalCount total count of matching events
	TotalCount uint32 `json:"total_count"`
	// Event server events that match filters
	Event []*ServerEvent `json:"event"`
}

ListServerEventsResponse list server events response

func (*ListServerEventsResponse) UnsafeAppend

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

UnsafeAppend should not be used Internal usage only

func (*ListServerEventsResponse) UnsafeGetTotalCount

func (r *ListServerEventsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListServersRequest

type ListServersRequest struct {
	Zone scw.Zone `json:"-"`
	// Page page number
	Page *int32 `json:"-"`
	// PageSize number of server per page
	PageSize *uint32 `json:"-"`
	// OrderBy order of the servers
	//
	// Default value: created_at_asc
	OrderBy ListServersRequestOrderBy `json:"-"`
	// Tags filter servers by tags
	Tags []string `json:"-"`
	// Status filter servers by status
	Status []string `json:"-"`
	// Name filter servers by name
	Name *string `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 count of matching servers
	TotalCount uint32 `json:"total_count"`
	// Servers servers that match filters
	Servers []*Server `json:"servers"`
}

ListServersResponse list servers response

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

type RebootServerRequest

type RebootServerRequest struct {
	Zone scw.Zone `json:"-"`
	// ServerID iD of the server to reboot
	ServerID string `json:"-"`
	// BootType the type of boot
	//
	// Default value: normal
	BootType RebootServerRequestBootType `json:"boot_type"`
}

type RebootServerRequestBootType

type RebootServerRequestBootType string

func (RebootServerRequestBootType) MarshalJSON

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

func (RebootServerRequestBootType) String

func (enum RebootServerRequestBootType) String() string

func (*RebootServerRequestBootType) UnmarshalJSON

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

type RemoteServerAccess

type RemoteServerAccess struct {
	// URL uRL to access to the server console
	URL string `json:"url"`
	// Login the login to use for the remote access authentification
	Login string `json:"login"`
	// Password the password to use for the remote access authentification
	Password string `json:"password"`
	// ExpiresAt the date after which the remote access will be closed
	ExpiresAt time.Time `json:"expires_at"`
}

RemoteServerAccess remote server access

type Server

type Server struct {
	// ID iD of the server
	ID string `json:"id"`
	// OrganizationID organization ID the server is attached to
	OrganizationID string `json:"organization_id"`
	// Name name of the server
	Name string `json:"name"`
	// Description description of the server
	Description string `json:"description"`
	// UpdatedAt date of last modification of the server
	UpdatedAt time.Time `json:"updated_at"`
	// CreatedAt date of creation of the server
	CreatedAt time.Time `json:"created_at"`
	// Status status of the server
	//
	// Default value: unknown
	Status ServerStatus `json:"status"`
	// OfferID offer ID of the server
	OfferID string `json:"offer_id"`
	// Install information about the last installation of the server
	Install *ServerInstall `json:"install"`
	// Tags array of customs tags attached to the server
	Tags []string `json:"tags"`
	// IPs array of IPs attached to the server
	IPs []*IP `json:"ips"`
	// Domain domain of the server
	Domain string `json:"domain"`
	// BootType boot type of the server
	//
	// Default value: normal
	BootType ServerBootType `json:"boot_type"`
}

Server server

type ServerBootType

type ServerBootType string

func (ServerBootType) MarshalJSON

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

func (ServerBootType) String

func (enum ServerBootType) String() string

func (*ServerBootType) UnmarshalJSON

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

type ServerEvent

type ServerEvent struct {
	// ID iD of the server for whom the action will be applied
	ID string `json:"id"`
	// Action the action that will be applied to the server
	Action string `json:"action"`
	// UpdatedAt date of last modification of the action
	UpdatedAt time.Time `json:"updated_at"`
	// CreatedAt date of creation of the action
	CreatedAt time.Time `json:"created_at"`
}

ServerEvent server event

type ServerInstall

type ServerInstall struct {
	// OsID iD of the OS
	OsID string `json:"os_id"`
	// Hostname host defined in the server install
	Hostname string `json:"hostname"`
	// SSHKeyIDs sSH public key IDs defined in the server install
	SSHKeyIDs []string `json:"ssh_key_ids"`
	// Status status of the server install
	//
	// Default value: unknown
	Status ServerInstallStatus `json:"status"`
}

ServerInstall server install

type ServerInstallStatus

type ServerInstallStatus string

func (ServerInstallStatus) MarshalJSON

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

func (ServerInstallStatus) String

func (enum ServerInstallStatus) String() string

func (*ServerInstallStatus) UnmarshalJSON

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

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 StartServerRequest

type StartServerRequest struct {
	Zone scw.Zone `json:"-"`
	// ServerID iD of the server to start
	ServerID string `json:"-"`
}

type StopServerRequest

type StopServerRequest struct {
	Zone scw.Zone `json:"-"`
	// ServerID iD of the server to stop
	ServerID string `json:"-"`
}

type UpdateIPRequest

type UpdateIPRequest struct {
	Zone scw.Zone `json:"-"`
	// ServerID iD of the server
	ServerID string `json:"-"`
	// IPID iD of the IP to update
	IPID string `json:"-"`
	// Reverse new reverse IP to update, not updated if null
	Reverse *string `json:"reverse"`
}

type UpdateServerRequest

type UpdateServerRequest struct {
	Zone scw.Zone `json:"-"`
	// ServerID iD of the server to update
	ServerID string `json:"-"`
	// Name name of the server (≠hostname), not updated if null
	Name *string `json:"name"`
	// Description description associated to the server, max 255 characters, not updated if null
	Description *string `json:"description"`
	// Tags tags associated to the server, not updated if null
	Tags *[]string `json:"tags"`
}

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