github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/dms/v1/products/results.go (about)

     1  package products
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  // GetResponse response
     8  type GetResponse struct {
     9  	Hourly  []Parameter `json:"Hourly"`
    10  	Monthly []Parameter `json:"Monthly"`
    11  }
    12  
    13  // Parameter for dms
    14  type Parameter struct {
    15  	Name    string  `json:"name"`
    16  	Version string  `json:"version"`
    17  	Values  []Value `json:"values"`
    18  }
    19  
    20  // Value for dms
    21  type Value struct {
    22  	Details []Detail `json:"detail"`
    23  	Name    string   `json:"name"`
    24  }
    25  
    26  // Detail for dms
    27  type Detail struct {
    28  	Storage         string        `json:"storage"`
    29  	ProductID       string        `json:"product_id"`
    30  	SpecCode        string        `json:"spec_code"`
    31  	VMSpecification string        `json:"vm_specification"`
    32  	ProductInfos    []ProductInfo `json:"product_info"`
    33  	PartitionNum    string        `json:"partition_num"`
    34  	Bandwidth       string        `json:"bandwidth"`
    35  	IOs             []IO          `json:"io"`
    36  }
    37  
    38  // ProductInfo for dms
    39  type ProductInfo struct {
    40  	Storage   string `json:"storage"`
    41  	NodeNum   string `json:"node_num"`
    42  	ProductID string `json:"product_id"`
    43  	SpecCode  string `json:"spec_code"`
    44  	IOs       []IO   `json:"io"`
    45  }
    46  
    47  type IO struct {
    48  	IOType          string `json:"io_type"`
    49  	StorageSpecCode string `json:"storage_spec_code"`
    50  }
    51  
    52  // GetResult contains the body of getting detailed
    53  type GetResult struct {
    54  	golangsdk.Result
    55  }
    56  
    57  // Extract from GetResult
    58  func (r GetResult) Extract() (*GetResponse, error) {
    59  	var s GetResponse
    60  	err := r.Result.ExtractInto(&s)
    61  	return &s, err
    62  }