1
0
Fork 0
traefik/vendor/github.com/sacloud/libsacloud/sacloud/prop_server_plan.go
Ludovic Fernandez 139f280f35 ACME TLS ALPN
2018-07-03 12:44:04 +02:00

51 lines
1.1 KiB
Go

package sacloud
// propServerPlan サーバープラン内包型
type propServerPlan struct {
ServerPlan *ProductServer `json:",omitempty"` // サーバープラン
}
// GetServerPlan サーバープラン取得
func (p *propServerPlan) GetServerPlan() *ProductServer {
return p.ServerPlan
}
// SetServerPlan サーバープラン設定
func (p *propServerPlan) SetServerPlan(plan *ProductServer) {
p.ServerPlan = plan
}
// SetServerPlanByID サーバープラン設定
func (p *propServerPlan) SetServerPlanByID(planID string) {
if p.ServerPlan == nil {
p.ServerPlan = &ProductServer{}
}
p.ServerPlan.Resource = NewResourceByStringID(planID)
}
// GetCPU CPUコア数 取得
func (p *propServerPlan) GetCPU() int {
if p.ServerPlan == nil {
return -1
}
return p.ServerPlan.GetCPU()
}
// GetMemoryMB メモリ(MB) 取得
func (p *propServerPlan) GetMemoryMB() int {
if p.ServerPlan == nil {
return -1
}
return p.ServerPlan.GetMemoryMB()
}
// GetMemoryGB メモリ(GB) 取得
func (p *propServerPlan) GetMemoryGB() int {
if p.ServerPlan == nil {
return -1
}
return p.ServerPlan.GetMemoryGB()
}