sakuracloud

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	AccessToken       string
	AccessTokenSecret string
	Zone              string
	Region            string // 後方互換
	Password          string // config storeへ残しておくため
	// contains filtered or unexported fields
}

APIClient client for SakuraCloud API

func NewAPIClient

func NewAPIClient(token, secret, zone, password string) *APIClient

NewAPIClient returns new APIClient

func (*APIClient) Delete

func (c *APIClient) Delete(strID string, strDisks []string) error

Delete delete server

func (*APIClient) DiskBuilderClient added in v1.5.0

func (c *APIClient) DiskBuilderClient() *disk.APIClient

DiskBuilderClient returns a api client for DiskBuilder

func (*APIClient) GetIP

func (c *APIClient) GetIP(strID string) (string, error)

GetIP get public ip address

func (*APIClient) Init

func (c *APIClient) Init()

Init initialize APIClient

func (*APIClient) IsExistsPacketFilter

func (c *APIClient) IsExistsPacketFilter(id types.ID) (bool, error)

IsExistsPacketFilter returns true is PakcetFilter is exists

func (*APIClient) IsValidPlan

func (c *APIClient) IsValidPlan(core, memory, gpu int) (bool, error)

IsValidPlan validates plan

func (*APIClient) PowerOff

func (c *APIClient) PowerOff(strID string) error

PowerOff power off

func (*APIClient) PowerOn

func (c *APIClient) PowerOn(strID string) error

PowerOn power on

func (*APIClient) ReadServer added in v1.4.1

func (c *APIClient) ReadServer(ctx context.Context, id types.ID) (*sacloud.Server, error)

ReadServer returns server info

func (*APIClient) ServerBuilderClient added in v1.4.1

func (c *APIClient) ServerBuilderClient() *server.APIClient

ServerBuilderClient returns a api client for ServerBuilder

func (*APIClient) State

func (c *APIClient) State(strID string) (string, error)

State reads server state

func (*APIClient) ValidateClientConfig

func (c *APIClient) ValidateClientConfig() error

ValidateClientConfig validates client config

Jump to

Keyboard shortcuts

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