github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/rds/v3/configurations/results.go (about)

     1  package configurations
     2  
     3  import (
     4  	"github.com/chnsz/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  	//Create time
    34  	Created string `json:"created"`
    35  	//Last update time
    36  	Updated string `json:"updated"`
    37  }
    38  
    39  type Parameter struct {
    40  	//Parameter Name
    41  	Name string `json:"name"`
    42  	//Parameter value
    43  	Value string `json:"value"`
    44  	//Whether a restart is required
    45  	RestartRequired bool `json:"restart_required"`
    46  	//Whether the parameter is read-only
    47  	ReadOnly bool `json:"readonly"`
    48  	//Parameter value range
    49  	ValueRange string `json:"value_range"`
    50  	//Parameter type
    51  	Type string `json:"type"`
    52  	//Parameter description
    53  	Description string `json:"description"`
    54  }
    55  
    56  // Extract is a function that accepts a result and extracts a configuration.
    57  func (r CreateResult) Extract() (*ConfigurationCreate, error) {
    58  	var response ConfigurationCreate
    59  	err := r.ExtractInto(&response)
    60  	return &response, err
    61  }
    62  
    63  func (r CreateResult) ExtractInto(v interface{}) error {
    64  	return r.Result.ExtractIntoStructPtr(v, "configuration")
    65  }
    66  
    67  // CreateResult represents the result of a create operation. Call its Extract
    68  // method to interpret it as a Configuration.
    69  type CreateResult struct {
    70  	golangsdk.Result
    71  }
    72  
    73  // UpdateResult represents the result of a update operation.
    74  type UpdateResult struct {
    75  	golangsdk.ErrResult
    76  }
    77  
    78  // Extract is a function that accepts a result and extracts a configuration.
    79  func (r GetResult) Extract() (*Configuration, error) {
    80  	var response Configuration
    81  	err := r.ExtractInto(&response)
    82  	return &response, err
    83  }
    84  
    85  // GetResult represents the result of a get operation. Call its Extract
    86  // method to interpret it as a Configuration.
    87  type GetResult struct {
    88  	golangsdk.Result
    89  }
    90  
    91  // DeleteResult represents the result of a delete operation. Call its ExtractErr
    92  // method to determine if the request succeeded or failed.
    93  type DeleteResult struct {
    94  	golangsdk.ErrResult
    95  }