query

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 14 Imported by: 18

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) (*iaas.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 iaas.SIMAPI, id types.ID) (*iaas.SIM, error)

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

func FindServerPlan

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

FindServerPlan サーバプラン検索

func GetProxyDatabasePlan added in v1.2.0

func GetProxyDatabasePlan(ctx context.Context, finder NoteFinder, cpu int, memoryGB int, diskSizeGB int) (types.ID, string, error)

GetProxyDatabasePlan 冗長化プランの指定のモデル/CPU/メモリ(GB)/ディスクサイズ(GB)からプランID/サービスクラスを返す

cpu/memoryGB/diskSizeGBに対応するプランが存在しない場合はゼロ値を返す(errorは返さない)

diskSizeGBはDatabaseDiskPlanのDisplaySizeと比較される

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 iaas.APICaller, zones []string, bridgeID types.ID) (bool, error)

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

func IsCDROMReferenced

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

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

func IsDiskReferenced

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

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

func IsPacketFilterReferenced

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

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

func IsPrivateHostReferenced

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

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

func IsSIMReferenced

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

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

func IsSwitchReferenced

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

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

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

func ReadProxyLB

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

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

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

func ReadRouter

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

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

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

func ReadServer

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

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

対象が見つからなかった場合はiaas.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 iaas.APICaller, zones []string, bridgeID types.ID, option CheckReferencedOption) error

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

func WaitWhileCDROMIsReferenced

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

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

func WaitWhileDiskIsReferenced

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

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

func WaitWhilePacketFilterIsReferenced

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

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

func WaitWhilePrivateHostIsReferenced

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

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

func WaitWhileSIMIsReferenced

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

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

func WaitWhileSwitchIsReferenced

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

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

func ZoneIDFromName

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

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

Types

type ArchiveFinder

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

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

type ArchiveReader

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

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

type ArchiveSourceReader

type ArchiveSourceReader struct {
	ArchiveReader ArchiveReader
	DiskReader    DiskReader
}

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

func NewArchiveSourceReader

func NewArchiveSourceReader(caller iaas.APICaller) *ArchiveSourceReader

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

type CheckReferencedOption

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

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

type DatabaseDiskPlan added in v1.2.0

type DatabaseDiskPlan struct {
	SizeMB       int // 実際のディスクのサイズ? DisplaySizeとは必ずしも一致しない(例: SizeMB:102400, DisplaySize: 90)
	DisplaySize  int // GB単位、コンパネに表示されるのはこの値
	PlanID       types.ID
	ServiceClass string
}

type DatabasePlan added in v1.2.0

type DatabasePlan struct {
	Class     string
	Model     string
	CPU       int
	MemoryMB  int
	DiskSizes []*DatabaseDiskPlan
}

func ListDatabasePlan added in v1.2.0

func ListDatabasePlan(ctx context.Context, finder NoteFinder, model string) ([]*DatabasePlan, error)

ListDatabasePlan データベースアプライアンスのプラン情報一覧を取得

modelには以下を指定

  • Standard : 標準プラン(非冗長化)
  • Proxy : 冗長化プラン

type DiskReader

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

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

type FindServerPlanRequest

type FindServerPlanRequest struct {
	CPU        int
	MemoryGB   int
	GPU        int
	CPUModel   string
	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 *iaas.FindCondition) (*iaas.NoteFindResult, error)
}

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

type ServerPlanFinder

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

ServerPlanFinder .

type ServerReader

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

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

type ServerSourceReader

type ServerSourceReader struct {
	ServerReader  ServerReader
	ArchiveReader ArchiveReader
	DiskReader    DiskReader
}

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

func NewServerSourceReader

func NewServerSourceReader(caller iaas.APICaller) *ServerSourceReader

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

Jump to

Keyboard shortcuts

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