github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/rds/v3/configurations/results.go (about)

     1  package configurations
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  type ConfigurationCreate struct {
     8  	//Configuration ID
     9  	Id string `json:"id"`
    10  	//Configuration Name
    11  	Name string `json:"name"`
    12  	//Database version Name
    13  	DatastoreVersionName string `json:"datastore_version_name"`
    14  	//Database Name
    15  	DatastoreName string `json:"datastore_name"`
    16  	//Configuration Description
    17  	Description string `json:"description"`
    18  }
    19  
    20  type Configuration struct {
    21  	//Configuration ID
    22  	Id string `json:"id"`
    23  	//Configuration Name
    24  	Name string `json:"name"`
    25  	//Database version Name
    26  	DatastoreVersionName string `json:"datastore_version_name"`
    27  	//Database Name
    28  	DatastoreName string `json:"datastore_name"`
    29  	//Configuration Description
    30  	Description string `json:"description"`
    31  	//Configuration Parameters
    32  	Parameters []Parameter `json:"configuration_parameters"`
    33  }
    34  
    35  type Parameter struct {
    36  	//Parameter Name
    37  	Name string `json:"name"`
    38  	//Parameter value
    39  	Value string `json:"value"`
    40  	//Whether a restart is required
    41  	RestartRequired bool `json:"restart_required"`
    42  	//Whether the parameter is read-only
    43  	ReadOnly bool `json:"readonly"`
    44  	//Parameter value range
    45  	ValueRange string `json:"value_range"`
    46  	//Parameter type
    47  	Type string `json:"type"`
    48  	//Parameter description
    49  	Description string `json:"description"`
    50  }
    51  
    52  // Extract is a function that accepts a result and extracts a configuration.
    53  func (r CreateResult) Extract() (*ConfigurationCreate, error) {
    54  	var response ConfigurationCreate
    55  	err := r.ExtractInto(&response)
    56  	return &response, err
    57  }
    58  
    59  func (r CreateResult) ExtractInto(v interface{}) error {
    60  	return r.Result.ExtractIntoStructPtr(v, "configuration")
    61  }
    62  
    63  // CreateResult represents the result of a create operation. Call its Extract
    64  // method to interpret it as a Configuration.
    65  type CreateResult struct {
    66  	golangsdk.Result
    67  }
    68  
    69  // UpdateResult represents the result of a update operation.
    70  type UpdateResult struct {
    71  	golangsdk.ErrResult
    72  }
    73  
    74  // Extract is a function that accepts a result and extracts a configuration.
    75  func (r GetResult) Extract() (*Configuration, error) {
    76  	var response Configuration
    77  	err := r.ExtractInto(&response)
    78  	return &response, err
    79  }
    80  
    81  // GetResult represents the result of a get operation. Call its Extract
    82  // method to interpret it as a Configuration.
    83  type GetResult struct {
    84  	golangsdk.Result
    85  }
    86  
    87  // DeleteResult represents the result of a delete operation. Call its ExtractErr
    88  // method to determine if the request succeeded or failed.
    89  type DeleteResult struct {
    90  	golangsdk.ErrResult
    91  }