power

package
v2.32.3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

Package power サーバやアプライアンスの電源操作ユーティリティ

BootやShutdownを同期的に処理します。 一定の時間内に起動/シャットダウンが行われない(API呼び出しが無視された)場合にはリトライを行います。

ポーリング間隔やタイムアウトはデフォルトのsacloud.StateWaiterの値が利用されます。

Index

Constants

This section is empty.

Variables

View Source
var (
	// BootRetrySpan 起動APIをコールしてからリトライするまでの待機時間
	BootRetrySpan time.Duration
	// ShutdownRetrySpan シャットダウンAPIをコールしてからリトライするまでの待機時間
	ShutdownRetrySpan time.Duration
	// InitialRequestTimeout 初回のBoot/Shutdownリクエストが受け入れられるまでのタイムアウト時間
	InitialRequestTimeout time.Duration
	// InitialRequestRetrySpan 初回のBoot/Shutdownリクエストをリトライする場合のリトライ間隔
	InitialRequestRetrySpan time.Duration
)

Functions

func BootDatabase

func BootDatabase(ctx context.Context, client DatabaseAPI, zone string, id types.ID) error

BootDatabase 起動

func BootLoadBalancer

func BootLoadBalancer(ctx context.Context, client LoadBalancerAPI, zone string, id types.ID) error

BootLoadBalancer 起動

func BootMobileGateway

func BootMobileGateway(ctx context.Context, client MobileGatewayAPI, zone string, id types.ID) error

BootMobileGateway 起動

func BootNFS

func BootNFS(ctx context.Context, client NFSAPI, zone string, id types.ID) error

BootNFS 起動

func BootServer

func BootServer(ctx context.Context, client ServerAPI, zone string, id types.ID, variables ...string) error

BootServer 起動

variablesが指定された場合、PUT /server/:id/powerのCloudInit用のパラメータとして渡される variablesが複数指定された場合は改行で結合される

func BootVPCRouter

func BootVPCRouter(ctx context.Context, client VPCRouterAPI, zone string, id types.ID) error

BootVPCRouter 起動

func ShutdownDatabase

func ShutdownDatabase(ctx context.Context, client DatabaseAPI, zone string, id types.ID, force bool) error

ShutdownDatabase シャットダウン

func ShutdownLoadBalancer

func ShutdownLoadBalancer(ctx context.Context, client LoadBalancerAPI, zone string, id types.ID, force bool) error

ShutdownLoadBalancer シャットダウン

func ShutdownMobileGateway

func ShutdownMobileGateway(ctx context.Context, client MobileGatewayAPI, zone string, id types.ID, force bool) error

ShutdownMobileGateway シャットダウン

func ShutdownNFS

func ShutdownNFS(ctx context.Context, client NFSAPI, zone string, id types.ID, force bool) error

ShutdownNFS シャットダウン

func ShutdownServer

func ShutdownServer(ctx context.Context, client ServerAPI, zone string, id types.ID, force bool) error

ShutdownServer シャットダウン

func ShutdownVPCRouter

func ShutdownVPCRouter(ctx context.Context, client VPCRouterAPI, zone string, id types.ID, force bool) error

ShutdownVPCRouter シャットダウン

Types

type DatabaseAPI

type DatabaseAPI interface {
	Read(ctx context.Context, zone string, id types.ID) (*sacloud.Database, error)
	Boot(ctx context.Context, zone string, id types.ID) error
	Shutdown(ctx context.Context, zone string, id types.ID, shutdownOption *sacloud.ShutdownOption) error
}

DatabaseAPI APIクライアント

type LoadBalancerAPI

type LoadBalancerAPI interface {
	Read(ctx context.Context, zone string, id types.ID) (*sacloud.LoadBalancer, error)
	Boot(ctx context.Context, zone string, id types.ID) error
	Shutdown(ctx context.Context, zone string, id types.ID, shutdownOption *sacloud.ShutdownOption) error
}

LoadBalancerAPI APIクライアント

type MobileGatewayAPI

type MobileGatewayAPI interface {
	Read(ctx context.Context, zone string, id types.ID) (*sacloud.MobileGateway, error)
	Boot(ctx context.Context, zone string, id types.ID) error
	Shutdown(ctx context.Context, zone string, id types.ID, shutdownOption *sacloud.ShutdownOption) error
}

MobileGatewayAPI APIクライアント

type NFSAPI

type NFSAPI interface {
	Read(ctx context.Context, zone string, id types.ID) (*sacloud.NFS, error)
	Boot(ctx context.Context, zone string, id types.ID) error
	Shutdown(ctx context.Context, zone string, id types.ID, shutdownOption *sacloud.ShutdownOption) error
}

NFSAPI APIクライアント

type ServerAPI

type ServerAPI interface {
	Read(ctx context.Context, zone string, id types.ID) (*sacloud.Server, error)
	Boot(ctx context.Context, zone string, id types.ID) error
	BootWithVariables(ctx context.Context, zone string, id types.ID, param *sacloud.ServerBootVariables) error
	Shutdown(ctx context.Context, zone string, id types.ID, shutdownOption *sacloud.ShutdownOption) error
}

ServerAPI APIクライアント

type VPCRouterAPI

type VPCRouterAPI interface {
	Read(ctx context.Context, zone string, id types.ID) (*sacloud.VPCRouter, error)
	Boot(ctx context.Context, zone string, id types.ID) error
	Shutdown(ctx context.Context, zone string, id types.ID, shutdownOption *sacloud.ShutdownOption) error
}

VPCRouterAPI APIクライアント

Jump to

Keyboard shortcuts

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