github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/dcs/v1/products/results.go (about)

     1  package products
     2  
     3  import (
     4  	"github.com/chnsz/golangsdk"
     5  )
     6  
     7  // GetResponse response
     8  type GetResponse struct {
     9  	Products []Product `json:"products"`
    10  }
    11  
    12  // Product for dcs
    13  type Product struct {
    14  	ProductID        string  `json:"product_id"`
    15  	SpecCode         string  `json:"spec_code"`
    16  	CacheMode        string  `json:"cache_mode"`
    17  	Engine           string  `json:"engine"`
    18  	EngineVersion    string  `json:"engine_versions"`
    19  	SpecDetails      string  `json:"spec_details"`
    20  	SpecDetails2     string  `json:"spec_details2"`
    21  	Currency         string  `json:"currency"`
    22  	ChargingType     string  `json:"charging_type"`
    23  	ProductType      string  `json:"product_type"`
    24  	ProdType         string  `json:"prod_type"`
    25  	CPUType          string  `json:"cpu_type"`
    26  	StorageType      string  `json:"storage_type"`
    27  	ServiceTypeCode  string  `json:"cloud_service_type_code"`
    28  	ResourceTypeCode string  `json:"cloud_resource_type_code"`
    29  	ReplicaCount     int     `json:"replica_count"`
    30  	Details          Details `json:"details"`
    31  }
    32  
    33  type Details struct {
    34  	Capacity       float64 `json:"capacity"`
    35  	MaxConnections int     `json:"max_connections"`
    36  	MaxClients     int     `json:"max_clients"`
    37  	MaxBandwidth   int     `json:"max_bandwidth"`
    38  	MaxInBandwidth int     `json:"max_in_bandwidth"`
    39  	IPCount        int     `json:"tenant_ip_count"`
    40  	ShardingNum    int     `json:"sharding_num"`
    41  	ProxyNum       int     `json:"proxy_num"`
    42  	DBNumber       int     `json:"db_number"`
    43  }
    44  
    45  // GetResult contains the body of getting detailed
    46  type GetResult struct {
    47  	golangsdk.Result
    48  }
    49  
    50  // Extract from GetResult
    51  func (r GetResult) Extract() (*GetResponse, error) {
    52  	var s GetResponse
    53  	err := r.Result.ExtractInto(&s)
    54  	return &s, err
    55  }