github.com/IBM-Cloud/bluemix-go@v0.0.0-20240423071914-9e96525baef4/api/container/containerv2/dedicated_host_flavors.go (about)

     1  package containerv2
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/IBM-Cloud/bluemix-go/client"
     7  )
     8  
     9  // GetDedicatedHostFlavor is a response to a dedicated host pool get request.
    10  // swagger:model
    11  type GetDedicatedHostFlavor struct {
    12  	ID              string            `json:"id"`
    13  	FlavorClass     string            `json:"flavorClass"`
    14  	Region          string            `json:"region"`
    15  	Zone            string            `json:"zone"`
    16  	Deprecated      bool              `json:"deprecated"`
    17  	MaxVCPUs        int               `json:"maxVCPUs"`
    18  	MaxMemory       int               `json:"maxMemory"`
    19  	InstanceStorage []InstanceStorage `json:"instanceStorage"`
    20  }
    21  
    22  // GetDedicatedHostFlavors is a response to a dedicated host pool list request.
    23  // swagger:model
    24  type GetDedicatedHostFlavors []GetDedicatedHostFlavor
    25  
    26  // InstanceStorage type for describing an instance disk configuration
    27  // swagger:model
    28  type InstanceStorage struct {
    29  	Count int `json:"count"`
    30  	// the size of each individual device in GB
    31  	Size int `json:"size"`
    32  }
    33  
    34  //DedicatedHostFlavor ...
    35  type DedicatedHostFlavor interface {
    36  	ListDedicatedHostFlavors(zone string, target ClusterTargetHeader) (GetDedicatedHostFlavors, error)
    37  }
    38  
    39  type dedicatedhostflavor struct {
    40  	client *client.Client
    41  }
    42  
    43  func newDedicatedHostFlavorAPI(c *client.Client) DedicatedHostFlavor {
    44  	return &dedicatedhostflavor{
    45  		client: c,
    46  	}
    47  }
    48  
    49  // GetDedicatedHostFlavor calls the API to list dedicated host s
    50  func (w *dedicatedhostflavor) ListDedicatedHostFlavors(zone string, target ClusterTargetHeader) (GetDedicatedHostFlavors, error) {
    51  	successV := GetDedicatedHostFlavors{}
    52  	_, err := w.client.Get(fmt.Sprintf("/v2/getDedicatedHostFlavors?provider=vpc-gen2&zone=%s", zone), &successV, target.ToMap())
    53  	return successV, err
    54  }