Documentation ¶
Index ¶
- Constants
- Variables
- func CanEditDisk(ctx context.Context, zone string, reader *ArchiveSourceReader, id types.ID) (bool, error)
- func FindArchiveByOSType(ctx context.Context, api ArchiveFinder, zone string, os ostype.ArchiveOSType) (*iaas.Archive, error)
- func FindNFSPlanID(ctx context.Context, finder NoteFinder, diskPlanID types.ID, ...) (types.ID, error)
- func FindSIMByID(ctx context.Context, client iaas.SIMAPI, id types.ID) (*iaas.SIM, error)
- func FindServerPlan(ctx context.Context, finder ServerPlanFinder, zone string, ...) (*iaas.ServerPlan, error)
- func GetProxyDatabasePlan(ctx context.Context, finder NoteFinder, cpu int, memoryGB int, diskSizeGB int) (types.ID, string, error)
- func GetPublicArchiveIDFromAncestors(ctx context.Context, zone string, reader *ArchiveSourceReader, id types.ID) (types.ID, error)
- func IsBridgeReferenced(ctx context.Context, caller iaas.APICaller, zones []string, bridgeID types.ID) (bool, error)
- func IsCDROMReferenced(ctx context.Context, caller iaas.APICaller, zone string, cdromID types.ID) (bool, error)
- func IsDiskReferenced(ctx context.Context, caller iaas.APICaller, zone string, diskID types.ID) (bool, error)
- func IsPacketFilterReferenced(ctx context.Context, caller iaas.APICaller, zone string, ...) (bool, error)
- func IsPrivateHostReferenced(ctx context.Context, caller iaas.APICaller, zone string, ...) (bool, error)
- func IsSIMReferenced(ctx context.Context, caller iaas.APICaller, zones []string, simID types.ID) (bool, error)
- func IsSwitchReferenced(ctx context.Context, caller iaas.APICaller, zone string, switchID types.ID) (bool, error)
- func ReadProxyLB(ctx context.Context, caller iaas.APICaller, id types.ID) (*iaas.ProxyLB, error)
- func ReadRouter(ctx context.Context, caller iaas.APICaller, zone string, id types.ID) (*iaas.Internet, error)
- func ReadServer(ctx context.Context, caller iaas.APICaller, zone string, id types.ID) (*iaas.Server, error)
- func ServerDefaultUserName(ctx context.Context, zone string, reader *ServerSourceReader, ...) (string, error)
- func WaitWhileBridgeIsReferenced(ctx context.Context, caller iaas.APICaller, zones []string, bridgeID types.ID, ...) error
- func WaitWhileCDROMIsReferenced(ctx context.Context, caller iaas.APICaller, zone string, cdromID types.ID, ...) error
- func WaitWhileDiskIsReferenced(ctx context.Context, caller iaas.APICaller, zone string, diskID types.ID, ...) error
- func WaitWhilePacketFilterIsReferenced(ctx context.Context, caller iaas.APICaller, zone string, ...) error
- func WaitWhilePrivateHostIsReferenced(ctx context.Context, caller iaas.APICaller, zone string, ...) error
- func WaitWhileSIMIsReferenced(ctx context.Context, caller iaas.APICaller, zones []string, simID types.ID, ...) error
- func WaitWhileSwitchIsReferenced(ctx context.Context, caller iaas.APICaller, zone string, switchID types.ID, ...) error
- func ZoneIDFromName(ctx context.Context, zoneAPI iaas.ZoneAPI, name string) (types.ID, error)
- type ArchiveFinder
- type ArchiveReader
- type ArchiveSourceReader
- type CheckReferencedOption
- type DatabaseDiskPlan
- type DatabasePlan
- type DiskReader
- type FindServerPlanRequest
- type NFSPlanInfo
- type NoteFinder
- type ServerPlanFinder
- type ServerReader
- type ServerSourceReader
Constants ¶
const ( // DefaultTimeoutDuration 被参照がなくなるまでのデフォルトタイムアウト DefaultTimeoutDuration = time.Hour // DefaultTick 被参照確認のデフォルト間隔 DefaultTick = 5 * time.Second )
Variables ¶
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 ¶
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 ¶
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 指定のディスクが利用されている間待ち合わせる
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 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 ¶
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 デフォルトのリーダーを返す