query

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: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultTimeoutDuration 被参照がなくなるまでのデフォルトタイムアウト
	DefaultTimeoutDuration = time.Hour
	// DefaultTick 被参照確認のデフォルト間隔
	DefaultTick = 5 * time.Second
)

Variables

View Source
var DefaultCheckReferencedOption = CheckReferencedOption{
	Timeout: DefaultTimeoutDuration,
	Tick:    DefaultTick,
}

DefaultCheckReferencedOption 被参照確認動作のデフォルトオプション

Functions

func CanEditDisk

func CanEditDisk(ctx context.Context, zone string, reader *ArchiveSourceReader, id types.ID) (bool, error)

CanEditDisk ディスクの修正が可能か判定

func FindArchiveByOSType

func FindArchiveByOSType(ctx context.Context, api ArchiveFinder, zone string, os ostype.ArchiveOSType) (*sacloud.Archive, error)

FindArchiveByOSType OS種別ごとの最新安定板のアーカイブを取得

func FindNFSPlanID

func FindNFSPlanID(ctx context.Context, finder NoteFinder, diskPlanID types.ID, size types.ENFSSize) (types.ID, error)

FindNFSPlanID ディスクプランとサイズからNFSのプランIDを取得

func FindSIMByID

func FindSIMByID(ctx context.Context, client sacloud.SIMAPI, id types.ID) (*sacloud.SIM, error)

FindSIMByID SIM+詳細情報をIDから検索

func FindServerPlan

func FindServerPlan(ctx context.Context, finder ServerPlanFinder, zone string, param *FindServerPlanRequest) (*sacloud.ServerPlan, error)

FindServerPlan サーバプラン検索

func GetPublicArchiveIDFromAncestors

func GetPublicArchiveIDFromAncestors(ctx context.Context, zone string, reader *ArchiveSourceReader, id types.ID) (types.ID, error)

GetPublicArchiveIDFromAncestors ソースアーカイブ/ディスクを辿りパブリックアーカイブのIDを検索

func IsBridgeReferenced

func IsBridgeReferenced(ctx context.Context, caller sacloud.APICaller, zones []string, bridgeID types.ID) (bool, error)

IsBridgeReferenced 指定のブリッジが利用されている場合trueを返す

func IsCDROMReferenced

func IsCDROMReferenced(ctx context.Context, caller sacloud.APICaller, zone string, cdromID types.ID) (bool, error)

IsCDROMReferenced 指定のCD-ROM(ISOイメージ)が利用されている場合trueを返す

func IsDiskReferenced

func IsDiskReferenced(ctx context.Context, caller sacloud.APICaller, zone string, diskID types.ID) (bool, error)

IsDiskReferenced 指定のディスクが利用されている場合trueを返す

func IsPacketFilterReferenced

func IsPacketFilterReferenced(ctx context.Context, caller sacloud.APICaller, zone string, packetFilterID types.ID) (bool, error)

IsPacketFilterReferenced 指定のパケットフィルタが利用されている場合trueを返す

func IsPrivateHostReferenced

func IsPrivateHostReferenced(ctx context.Context, caller sacloud.APICaller, zone string, privateHostID types.ID) (bool, error)

IsPrivateHostReferenced 指定の専有ホストが利用されている場合trueを返す

func IsSIMReferenced

func IsSIMReferenced(ctx context.Context, caller sacloud.APICaller, zones []string, simID types.ID) (bool, error)

IsSIMReferenced 指定のSIMが利用されている場合trueを返す

func IsSwitchReferenced

func IsSwitchReferenced(ctx context.Context, caller sacloud.APICaller, zone string, switchID types.ID) (bool, error)

IsSwitchReferenced 指定のスイッチが利用されている場合trueを返す

ハイブリッド接続情報が残っている場合にも参照されているものとみなしtrueを返す

func ReadProxyLB added in v2.22.0

func ReadProxyLB(ctx context.Context, caller sacloud.APICaller, id types.ID) (*sacloud.ProxyLB, error)

ReadProxyLB 指定のIDでELBを検索、IDで見つからなかった場合は@previous-idタグで検索し見つかったリソースを返す

対象が見つからなかった場合はsacloud.NoResultsErrorを返す

func ReadRouter added in v2.22.0

func ReadRouter(ctx context.Context, caller sacloud.APICaller, zone string, id types.ID) (*sacloud.Internet, error)

ReadRouter 指定のIDでルータを検索、IDで見つからなかった場合は@previous-idタグで検索し見つかったリソースを返す

対象が見つからなかった場合はsacloud.NoResultsErrorを返す

func ReadServer added in v2.22.0

func ReadServer(ctx context.Context, caller sacloud.APICaller, zone string, id types.ID) (*sacloud.Server, error)

ReadServer 指定のIDでサーバを検索、IDで見つからなかった場合は@previous-idタグで検索し見つかったサーバリソースを返す

対象が見つからなかった場合はsacloud.NoResultsErrorを返す

func ServerDefaultUserName

func ServerDefaultUserName(ctx context.Context, zone string, reader *ServerSourceReader, serverID types.ID) (string, error)

ServerDefaultUserName returns default admin user name from source archives/disks

func WaitWhileBridgeIsReferenced

func WaitWhileBridgeIsReferenced(ctx context.Context, caller sacloud.APICaller, zones []string, bridgeID types.ID, option CheckReferencedOption) error

WaitWhileBridgeIsReferenced 指定のSIMが利用されている間待ち合わせる

func WaitWhileCDROMIsReferenced

func WaitWhileCDROMIsReferenced(ctx context.Context, caller sacloud.APICaller, zone string, cdromID types.ID, option CheckReferencedOption) error

WaitWhileCDROMIsReferenced 指定のCD-ROM(ISOイメージ)が利用されている間待ち合わせる

func WaitWhileDiskIsReferenced

func WaitWhileDiskIsReferenced(ctx context.Context, caller sacloud.APICaller, zone string, diskID types.ID, option CheckReferencedOption) error

WaitWhileDiskIsReferenced 指定のディスクが利用されている間待ち合わせる

func WaitWhilePacketFilterIsReferenced

func WaitWhilePacketFilterIsReferenced(ctx context.Context, caller sacloud.APICaller, zone string, packetFilterID types.ID, option CheckReferencedOption) error

WaitWhilePacketFilterIsReferenced 指定のパケットフィルタが利用されている間待ち合わせる

func WaitWhilePrivateHostIsReferenced

func WaitWhilePrivateHostIsReferenced(ctx context.Context, caller sacloud.APICaller, zone string, privateHostID types.ID, option CheckReferencedOption) error

WaitWhilePrivateHostIsReferenced 指定の専有ホストが利用されている間待ち合わせる

func WaitWhileSIMIsReferenced

func WaitWhileSIMIsReferenced(ctx context.Context, caller sacloud.APICaller, zones []string, simID types.ID, option CheckReferencedOption) error

WaitWhileSIMIsReferenced 指定のSIMが利用されている間待ち合わせる

func WaitWhileSwitchIsReferenced

func WaitWhileSwitchIsReferenced(ctx context.Context, caller sacloud.APICaller, zone string, switchID types.ID, option CheckReferencedOption) error

WaitWhileSwitchIsReferenced 指定のディスクが利用されている間待ち合わせる

func ZoneIDFromName

func ZoneIDFromName(ctx context.Context, zoneAPI sacloud.ZoneAPI, name string) (types.ID, error)

ZoneIDFromName ゾーン名からゾーンIDを取得

Types

type ArchiveFinder

type ArchiveFinder interface {
	Find(ctx context.Context, zone string, conditions *sacloud.FindCondition) (*sacloud.ArchiveFindResult, error)
}

ArchiveFinder アーカイブ検索インターフェース

type ArchiveReader

type ArchiveReader interface {
	Read(ctx context.Context, zone string, id types.ID) (*sacloud.Archive, error)
}

ArchiveReader アーカイブ参照インターフェース

type ArchiveSourceReader

type ArchiveSourceReader struct {
	ArchiveReader ArchiveReader
	DiskReader    DiskReader
}

ArchiveSourceReader アーカイブソースを取得するためのインターフェース

func NewArchiveSourceReader

func NewArchiveSourceReader(caller sacloud.APICaller) *ArchiveSourceReader

NewArchiveSourceReader デフォルトのリーダーを返す

type CheckReferencedOption

type CheckReferencedOption struct {
	// Timeout 被参照がなくなるまでのタイムアウト
	Timeout time.Duration
	// Tick 被参照確認の間隔
	Tick time.Duration
}

CheckReferencedOption 被参照確認動作のオプション

type DiskReader

type DiskReader interface {
	Read(ctx context.Context, zone string, id types.ID) (*sacloud.Disk, error)
}

DiskReader ディスク参照インターフェース

type FindServerPlanRequest

type FindServerPlanRequest struct {
	CPU        int
	MemoryGB   int
	GPU        int
	Commitment types.ECommitment
	Generation types.EPlanGeneration
}

FindServerPlanRequest サーバプラン検索パラメータ

type NFSPlanInfo

type NFSPlanInfo struct {
	NFSPlanID  types.ID
	Size       types.ENFSSize
	DiskPlanID types.ID
}

NFSPlanInfo NFSプランIDに対応するプラン情報

func GetNFSPlanInfo

func GetNFSPlanInfo(ctx context.Context, finder NoteFinder, nfsPlanID types.ID) (*NFSPlanInfo, error)

GetNFSPlanInfo NFSプランIDから対応するプラン情報を取得

type NoteFinder

type NoteFinder interface {
	Find(ctx context.Context, conditions *sacloud.FindCondition) (*sacloud.NoteFindResult, error)
}

NoteFinder スタートアップスクリプト(Note)検索インターフェース

type ServerPlanFinder

type ServerPlanFinder interface {
	Find(ctx context.Context, zone string, conditions *sacloud.FindCondition) (*sacloud.ServerPlanFindResult, error)
}

ServerPlanFinder .

type ServerReader

type ServerReader interface {
	Read(ctx context.Context, zone string, id types.ID) (*sacloud.Server, error)
}

ServerReader サーバ参照インターフェース

type ServerSourceReader

type ServerSourceReader struct {
	ServerReader  ServerReader
	ArchiveReader ArchiveReader
	DiskReader    DiskReader
}

ServerSourceReader サーバのコピー元情報を参照するためのリーダー

func NewServerSourceReader

func NewServerSourceReader(caller sacloud.APICaller) *ServerSourceReader

NewServerSourceReader デフォルトのリーダーを返す

Jump to

Keyboard shortcuts

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