github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/dcs/v1/configs/List.go (about)

     1  package configs
     2  
     3  import (
     4  	"github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
     6  )
     7  
     8  func List(client *golangsdk.ServiceClient, instanceID string) (*ConfigParam, error) {
     9  	raw, err := client.Get(client.ServiceURL("instances", instanceID, "configs"), nil, nil)
    10  	if err != nil {
    11  		return nil, err
    12  	}
    13  
    14  	var res ConfigParam
    15  	err = extract.Into(raw.Body, &res)
    16  	return &res, err
    17  }
    18  
    19  type ConfigParam struct {
    20  	// Current status of a DCS instance.
    21  	Status string `json:"status"`
    22  	// DCS instance ID.
    23  	InstanceID string `json:"instance_id"`
    24  	// Array of configuration items of the DCS instance.
    25  	RedisConfigs []RedisConfigResult `json:"redis_config"`
    26  	// DCS instance status that is being modified or has been modified. Options:
    27  	// UPDATING
    28  	// FAILURE
    29  	// SUCCESS
    30  	ConfigStatus string `json:"config_status"`
    31  	// Time at which the DCS instance is operated on. For example, 2017-03-31T12:24:46.297Z.
    32  	ConfigTime string `json:"config_time"`
    33  	// Instance type. If true is returned, the instance is a Proxy Cluster DCS Redis 3.0 instance.
    34  	// If false is returned, the instance is not a Proxy Cluster DCS Redis 3.0 instance.
    35  	ClusterV1 bool `json:"cluster_v1"`
    36  }
    37  
    38  type RedisConfigResult struct {
    39  	// Configuration item description.
    40  	Description string `json:"description"`
    41  	// Configuration parameter ID. For the possible values
    42  	ParamID string `json:"param_id"`
    43  	// Configuration parameter name. For the possible values
    44  	ParamName string `json:"param_name"`
    45  	// Configuration parameter value.
    46  	ParamValue string `json:"param_value"`
    47  	// Default value of the configuration parameter. For the possible values
    48  	DefaultValue string `json:"default_value"`
    49  	// Type of the configuration parameter value. For the possible values
    50  	ValueType string `json:"value_type"`
    51  	// Range of the configuration parameter value. For the possible values
    52  	ValueRange string `json:"value_range"`
    53  	// If null or empty is returned, the node is a default node, that is, the Redis Server node.
    54  	// If proxy is returned, the node is a proxy node.
    55  	NodeRole string `json:"node_role"`
    56  }