sacloud / libsacloud

[Deprecated] Library for SAKURA Cloud API with Go
Apache License 2.0
18 stars 13 forks source link

GPUプラン対応 #814

Closed yamamoto-febc closed 2 years ago

yamamoto-febc commented 2 years ago

GPUプランに対応する。 https://manual.sakura.ad.jp/cloud/server/gpu-plan.html

yamamoto-febc commented 2 years ago

helper/queryパッケージでのサーバプラン検索APIをどうするか?

// as-is

// FindServerPlan サーバプラン検索
func FindServerPlan(ctx context.Context, finder ServerPlanFinder, zone string, param *FindServerPlanRequest)

// FindServerPlanRequest サーバプラン検索パラメータ
type FindServerPlanRequest struct {
    CPU        int
    MemoryGB   int
    Commitment types.ECommitment
    Generation types.EPlanGeneration
}
yamamoto-febc commented 2 years ago

現状はGPUプランが少ない(1プランのみ)なためGPUの有無のみで検索すれば良さそうに見えるが、API的には.GPUは数値になっていることも合わせるとCPUMemoryGBパラメータと同じようにGPUもintで受け取り一致するプランを返すようにした方が良いと思われる。