baremetal

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 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.

func (*API) CreateServer

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

CreateServer create server.

Create server associated with the offer.

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 an existing 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 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 details.

Get the server associated with the given ID.

func (*API) InstallServer

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

InstallServer install your server.

Install the server associated with the given ID.

func (*API) ListServerEvents

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

ListServerEvents list all events server.

List all events server associated with the given ID.

func (*API) ListServers

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

ListServers list all your servers.

func (*API) RebootServer

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

RebootServer reboot an existing 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 an existing 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 an existing 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 your IP.

Configure your ip associated with the given serverID and ipID, set your custom reverse.

func (*API) UpdateServer

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

UpdateServer update an existing 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 which be authorized to connect on the server
	IP string `json:"ip"`
}

type CreateServerRequest

type CreateServerRequest struct {
	Zone scw.Zone `json:"-"`
	// OfferID iD of the server offer to order
	OfferID string `json:"offer_id"`
	// OrganizationID iD of organization to associate to the server
	OrganizationID string `json:"organization_id"`
	// Name name of the server (≠hostname)
	Name string `json:"name"`
	// Description some description to associate to the server, max 255 characters
	Description string `json:"description"`
	// Tags array of 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 searched 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 message is an error occured with reverse
	ReverseStatusMessage *string `json:"reverse_status_message"`
}

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 iD of the server to install
	ServerID string `json:"-"`
	// OsID iD of OS to the install on server
	OsID string `json:"os_id"`
	// Hostname hostname of the server
	Hostname string `json:"hostname"`
	// SSHKeyIDs array of ssh key IDs authorized
	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 set the maximum list size
	PageSize *int32 `json:"-"`
	// OrderBy order the response
	//
	// 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 (total_count≠page_size, it is the global count)
	TotalCount uint32 `json:"total_count"`
	// Event array of events, which match with the parameters
	Event []*ServerEvent `json:"event"`
}

func (*ListServerEventsResponse) UnsafeAppend

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

UnsafeAppend should not be used Internal usage only

func (*ListServerEventsResponse) UnsafeGetTotalCount

func (r *ListServerEventsResponse) UnsafeGetTotalCount() int

UnsafeGetTotalCount should not be used Internal usage only

type ListServersRequest

type ListServersRequest struct {
	Zone scw.Zone `json:"-"`
	// Page page number
	Page *int32 `json:"-"`
	// PageSize set the maximum list size
	PageSize *int32 `json:"-"`
	// OrderBy order the response
	//
	// Default value: created_at_asc
	OrderBy ListServersRequestOrderBy `json:"-"`
	// Tags filter by tags
	Tags []string `json:"-"`
	// Status filter by status
	Status []string `json:"-"`
	// Name filter 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 items (total_count≠page_size, it is the global count)
	TotalCount uint32 `json:"total_count"`
	// Servers listing of servers
	Servers []*Server `json:"servers"`
}

func (*ListServersResponse) UnsafeAppend

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

UnsafeAppend should not be used Internal usage only

func (*ListServersResponse) UnsafeGetTotalCount

func (r *ListServersResponse) UnsafeGetTotalCount() int

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 on the server
	URL string `json:"url"`
	// Login login for the authentification
	Login string `json:"login"`
	// Password password for the authentification
	Password string `json:"password"`
	// ExpiresAt after this date, the remote access will be closed
	ExpiresAt time.Time `json:"expires_at"`
}

type Server

type Server struct {
	// ID iD of the server
	ID string `json:"id"`
	// OrganizationID organization ID linked with the server
	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 update of the server
	UpdatedAt time.Time `json:"updated_at"`
	// CreatedAt creation date of the server
	CreatedAt time.Time `json:"created_at"`
	// Status status of the server
	//
	// Default value: unknown
	Status ServerStatus `json:"status"`
	// OfferID offer reference of the server
	OfferID string `json:"offer_id"`
	// Install object to describe the specifications of installation
	Install *ServerInstall `json:"install"`
	// Tags array of customs tags
	Tags []string `json:"tags"`
	// IPs array of IPs
	IPs []*IP `json:"ips"`
	// Domain the server domain
	Domain string `json:"domain"`
	// BootType boot type
	//
	// Default value: normal
	BootType ServerBootType `json:"boot_type"`
}

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 string `json:"id"`

	Action string `json:"action"`

	UpdatedAt time.Time `json:"updated_at"`

	CreatedAt time.Time `json:"created_at"`
}

type ServerInstall

type ServerInstall struct {
	OsID string `json:"os_id"`

	Hostname string `json:"hostname"`

	SSHKeyIDs []string `json:"ssh_key_ids"`
	// Status
	//
	// Default value: unknown
	Status ServerInstallStatus `json:"status"`
}

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 IP to update
	IPID string `json:"-"`
	// Reverse new reverse to update
	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 some description to associate to the server, max 255 characters, not updated if null
	Description *string `json:"description"`
	// Tags array of tags to associate 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