github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/rds/v3/configurations/List.go (about) 1 package configurations 2 3 import ( 4 "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" 6 ) 7 8 // List is used to obtain the parameter template list, including default 9 // parameter templates of all databases and those created by users. 10 func List(client *golangsdk.ServiceClient) ([]Configuration, error) { 11 // GET https://{Endpoint}/v3/{project_id}/configurations 12 raw, err := client.Get(client.ServiceURL("configurations"), nil, nil) 13 if err != nil { 14 return nil, err 15 } 16 17 var res []Configuration 18 err = extract.IntoSlicePtr(raw.Body, &res, "configurations") 19 return res, err 20 } 21 22 type Configuration struct { 23 // Specifies the parameter template ID. 24 ID string `json:"id"` 25 // Indicates the parameter template name. 26 Name string `json:"name"` 27 // Indicates the database version name. 28 DatastoreVersionName string `json:"datastore_version_name"` 29 // Indicates the database name. 30 DatastoreName string `json:"datastore_name"` 31 // Indicates the parameter template description. 32 Description string `json:"description"` 33 // Indicates the creation time in the following format: yyyy-MM-ddTHH:mm:ssZ. 34 // T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. 35 Created string `json:"created"` 36 // Indicates the update time in the following format: yyyy-MM-ddTHH:mm:ssZ. 37 // T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. 38 Updated string `json:"updated"` 39 // Specifies whether the parameter template is created by users. 40 // false: The parameter template is a default parameter template. 41 // true: The parameter template is a custom template. 42 UserDefined bool `json:"user_defined"` 43 // Configuration Parameters 44 Parameters []Parameter `json:"configuration_parameters"` 45 }