github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/rds/v3/configurations/GetForInstance.go (about)

     1  package configurations
     2  
     3  import (
     4  	"github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
     6  	"github.com/opentelekomcloud/gophertelekomcloud/openstack"
     7  )
     8  
     9  // GetForInstance retrieves Configuration applied to particular RDS instance
    10  // configuration ID and Name will be empty
    11  func GetForInstance(c *golangsdk.ServiceClient, instanceID string) (*Configuration, error) {
    12  	// GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/configurations
    13  	raw, err := c.Get(c.ServiceURL("instances", instanceID, "configurations"), nil, openstack.StdRequestOpts())
    14  	if err != nil {
    15  		return nil, err
    16  	}
    17  
    18  	var res Configuration
    19  	err = extract.Into(raw.Body, &res)
    20  	return &res, err
    21  }
    22  
    23  type Parameter struct {
    24  	// Indicates the parameter name.
    25  	Name string `json:"name"`
    26  	// Indicates the parameter value.
    27  	Value string `json:"value"`
    28  	// Indicates whether a reboot is required.
    29  	RestartRequired bool `json:"restart_required"`
    30  	// Indicates whether the parameter is read-only.
    31  	ReadOnly bool `json:"readonly"`
    32  	// Indicates the parameter value range. If the type is Integer, the value is 0 or 1. If the type is Boolean, the value is true or false.
    33  	ValueRange string `json:"value_range"`
    34  	// Indicates the parameter type, which can be integer, string, boolean, list, or float.
    35  	Type string `json:"type"`
    36  	// Indicates the parameter description.
    37  	Description string `json:"description"`
    38  }