From 2b9f754cde1438056178efd924bbca57cc8a578b Mon Sep 17 00:00:00 2001 From: Alexandru-Claudius Virtopeanu Date: Fri, 6 Dec 2024 13:02:21 +0200 Subject: [PATCH] fix: mariadb "CREATING" invalid state (#469) * bump: sdk mariadb * update vendor --- go.mod | 4 +- go.sum | 8 +- .../sdk-go-dbaas-mariadb/README.md | 195 ++++----- .../sdk-go-dbaas-mariadb/api_backups.go | 8 +- .../sdk-go-dbaas-mariadb/api_clusters.go | 231 +++++++++++ .../sdk-go-dbaas-mariadb/api_restore.go | 252 ++++++++++++ .../sdk-go-dbaas-mariadb/client.go | 5 +- .../sdk-go-dbaas-mariadb/configuration.go | 43 +- .../model_create_cluster_properties.go | 43 ++ .../model_patch_cluster_properties.go | 384 ++++++++++++++++++ .../model_patch_cluster_request.go | 164 ++++++++ .../model_restore_request.go | 176 ++++++++ .../sdk-go-dbaas-mariadb/model_state.go | 5 +- vendor/golang.org/x/oauth2/LICENSE | 4 +- vendor/golang.org/x/oauth2/README.md | 15 +- vendor/golang.org/x/oauth2/token.go | 7 + vendor/modules.txt | 4 +- 17 files changed, 1416 insertions(+), 132 deletions(-) create mode 100644 vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_restore.go create mode 100644 vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_properties.go create mode 100644 vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_request.go create mode 100644 vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_restore_request.go diff --git a/go.mod b/go.mod index c9555dcf4..3f44a40db 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( require ( github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4 github.com/ionos-cloud/sdk-go-cdn v1.1.0 - github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.0.0 + github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.1.1 ) require ( @@ -76,7 +76,7 @@ require ( github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect - golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/oauth2 v0.24.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index eeb357ab5..d85840587 100644 --- a/go.sum +++ b/go.sum @@ -254,8 +254,8 @@ github.com/ionos-cloud/sdk-go-container-registry v1.1.0 h1:H92gzx9oj0vvbozbXwn2R github.com/ionos-cloud/sdk-go-container-registry v1.1.0/go.mod h1:woBP1+A4N0KXiRj9jG4y/hEXgrVjJv0CUlAvc24mCeo= github.com/ionos-cloud/sdk-go-dataplatform v1.0.2 h1:/KEm54/8WC8bXKAqUKLgoTvk1g9x/EOUYOUnRkf4un0= github.com/ionos-cloud/sdk-go-dataplatform v1.0.2/go.mod h1:LXJGnUwLLiJhKgApv7TIPGy7WOuGbYIzBPFxGpNfqN0= -github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.0.0 h1:zTfeV4lwp7c8xkjoJH50oz96cuaUVgbypbG7U3dVi5c= -github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.0.0/go.mod h1:627dsH56YGQD7x0g2FGdVsxNtBySvQ3QU0uG+d6/Evk= +github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.1.1 h1:dZLxaH2n0nxCOKMkt49TibOiY1hkaHThpXEgJL0oZng= +github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.1.1/go.mod h1:NuUqBA9DyP4PB3MtKy/R9XRHY1RZcwVP6E3tP4FwI7I= github.com/ionos-cloud/sdk-go-dbaas-mongo v1.3.1 h1:+tDoZ8IEPxYwJd6fDIpWksNJs9Zzw7Pu5A39jTew058= github.com/ionos-cloud/sdk-go-dbaas-mongo v1.3.1/go.mod h1:rxOAeyAU6BTfghJibSRDdRNrKm2cIXMpSMe7JIWewJ8= github.com/ionos-cloud/sdk-go-dbaas-postgres v1.1.2 h1:AaKbci+kVS6/k43VwJwmXxCJ7pzj9jwuOPqO8Wd5560= @@ -580,8 +580,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= -golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= +golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/README.md b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/README.md index 8e48c0c9c..e3b0342ce 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/README.md +++ b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/README.md @@ -1,3 +1,5 @@ +[![Gitter](https://img.shields.io/gitter/room/ionos-cloud/sdk-general)](https://gitter.im/ionos-cloud/sdk-general) + # Go API client for ionoscloud An enterprise-grade Database is provided as a Service (DBaaS) solution that @@ -14,7 +16,7 @@ their concepts and lend well to making the experience smooth and intuitive. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - API version: 0.1.0 -- Package version: 1.0.0 +- Package version: 1.1.1 - Build package: org.openapitools.codegen.languages.GoClientCodegen ## Installation @@ -23,138 +25,121 @@ Install the following dependencies: ```shell go get github.com/stretchr/testify/assert +go get golang.org/x/oauth2 go get golang.org/x/net/context +go get github.com/antihax/optional ``` Put the package under your project folder and add the following in import: ```golang -import ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mariadb" +import "./ionoscloud" ``` -To use a proxy, set the environment variable `HTTP_PROXY`: +## Authentication -```golang -os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") -``` +All available server URLs are: -## Configuration of Server URL +- *https://mariadb.de-txl.ionos.com* - Berlin, Germany +- *https://mariadb.de-fra.ionos.com* - Frankfurt, Germany +- *https://mariadb.es-vit.ionos.com* - Logroño, Spain +- *https://mariadb.fr-par.ionos.com* - Paris, France +- *https://mariadb.gb-lhr.ionos.com* - London, Great Britain +- *https://mariadb.us-ewr.ionos.com* - Newark, USA +- *https://mariadb.us-las.ionos.com* - Las Vegas, USA +- *https://mariadb.us-mci.ionos.com* - Lenexa, USA -Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. +By default, *https://mariadb.de-txl.ionos.com* is used, however this can be overriden at authentication, either +by setting the `IONOS_API_URL` environment variable or by specifying the `hostUrl` parameter when +initializing the sdk client. -### Select Server Configuration - -For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. +The username and password or the authentication token can be manually specified when initializing +the sdk client: ```golang -ctx := context.WithValue(context.Background(), ionoscloud.ContextServerIndex, 1) -``` -### Templated Server URL +client := ionoscloud.NewAPIClient(ionoscloud.NewConfiguration(username, password, token, hostUrl)) -Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. - -```golang -ctx := context.WithValue(context.Background(), ionoscloud.ContextServerVariables, map[string]string{ - "basePath": "v2", -}) ``` -Note, enum values are always validated and all unused variables are silently ignored. +Environment variables can also be used. The sdk uses the following variables: +- IONOS_TOKEN - login via token. This is the recommended way to authenticate. +- IONOS_USERNAME - to specify the username used to login +- IONOS_PASSWORD - to specify the password +- IONOS_API_URL - to specify the API server URL -## Documentation for API Endpoints - -All URIs are relative to *https://mariadb.de-txl.ionos.com* +In this case, the client configuration needs to be initialized using `NewConfigurationFromEnv()`. -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*BackupsApi* | [**BackupsFindById**](docs/api/BackupsApi.md#backupsfindbyid) | **Get** /backups/{backupId} | Fetch a cluster's backups -*BackupsApi* | [**BackupsGet**](docs/api/BackupsApi.md#backupsget) | **Get** /backups | List of cluster's backups. -*BackupsApi* | [**ClusterBackupsGet**](docs/api/BackupsApi.md#clusterbackupsget) | **Get** /clusters/{clusterId}/backups | List backups of cluster -*ClustersApi* | [**ClustersDelete**](docs/api/ClustersApi.md#clustersdelete) | **Delete** /clusters/{clusterId} | Delete a cluster -*ClustersApi* | [**ClustersFindById**](docs/api/ClustersApi.md#clustersfindbyid) | **Get** /clusters/{clusterId} | Fetch a cluster -*ClustersApi* | [**ClustersGet**](docs/api/ClustersApi.md#clustersget) | **Get** /clusters | List clusters -*ClustersApi* | [**ClustersPost**](docs/api/ClustersApi.md#clusterspost) | **Post** /clusters | Create a cluster - - -## Documentation For Models +```golang - - [Backup](docs/models/Backup.md) - - [BackupList](docs/models/BackupList.md) - - [BackupListAllOf](docs/models/BackupListAllOf.md) - - [BackupResponse](docs/models/BackupResponse.md) - - [BaseBackup](docs/models/BaseBackup.md) - - [ClusterList](docs/models/ClusterList.md) - - [ClusterListAllOf](docs/models/ClusterListAllOf.md) - - [ClusterMetadata](docs/models/ClusterMetadata.md) - - [ClusterProperties](docs/models/ClusterProperties.md) - - [ClusterResponse](docs/models/ClusterResponse.md) - - [ClustersGet400Response](docs/models/ClustersGet400Response.md) - - [ClustersGet401Response](docs/models/ClustersGet401Response.md) - - [ClustersGet403Response](docs/models/ClustersGet403Response.md) - - [ClustersGet404Response](docs/models/ClustersGet404Response.md) - - [ClustersGet405Response](docs/models/ClustersGet405Response.md) - - [ClustersGet415Response](docs/models/ClustersGet415Response.md) - - [ClustersGet422Response](docs/models/ClustersGet422Response.md) - - [ClustersGet429Response](docs/models/ClustersGet429Response.md) - - [ClustersGet500Response](docs/models/ClustersGet500Response.md) - - [ClustersGet503Response](docs/models/ClustersGet503Response.md) - - [Connection](docs/models/Connection.md) - - [CreateClusterProperties](docs/models/CreateClusterProperties.md) - - [CreateClusterRequest](docs/models/CreateClusterRequest.md) - - [DBUser](docs/models/DBUser.md) - - [DayOfTheWeek](docs/models/DayOfTheWeek.md) - - [ErrorMessage](docs/models/ErrorMessage.md) - - [MaintenanceWindow](docs/models/MaintenanceWindow.md) - - [MariadbVersion](docs/models/MariadbVersion.md) - - [Pagination](docs/models/Pagination.md) - - [PaginationLinks](docs/models/PaginationLinks.md) - - [State](docs/models/State.md) - - -## Documentation For Authorization - - -Authentication schemes defined for the API: -### tokenAuth - -- **Type**: API key -- **API key parameter name**: Authorization -- **Location**: HTTP header - -Note, each API key must be added to a map of `map[string]APIKey` where the key is: Authorization and passed in as the auth context for each request. - -Example +client := ionoscloud.NewAPIClient(ionoscloud.NewConfigurationFromEnv()) -```golang -auth := context.WithValue( - context.Background(), - sw.ContextAPIKeys, - map[string]sw.APIKey{ - "Authorization": {Key: "API_KEY_STRING"}, - }, - ) -r, err := client.Service.Operation(auth, args) ``` -## Documentation for Utility Methods +## Documentation for API Endpoints -Due to the fact that model structure members are all pointers, this package contains -a number of utility functions to easily obtain pointers to values of basic types. -Each of these functions takes a value of the given basic type and returns a pointer to it: +All URIs are relative to *https://mariadb.de-txl.ionos.com* +
+ API Endpoints table -* `PtrBool` -* `PtrInt` -* `PtrInt32` -* `PtrInt64` -* `PtrFloat` -* `PtrFloat32` -* `PtrFloat64` -* `PtrString` -* `PtrTime` -## Author +| Class | Method | HTTP request | Description | +| ------------- | ------------- | ------------- | ------------- | +| BackupsApi | [**BackupsFindById**](docs/api/BackupsApi.md#BackupsFindById) | **Get** /backups/{backupId} | Fetch backups | +| BackupsApi | [**BackupsGet**](docs/api/BackupsApi.md#BackupsGet) | **Get** /backups | List of backups. | +| BackupsApi | [**ClusterBackupsGet**](docs/api/BackupsApi.md#ClusterBackupsGet) | **Get** /clusters/{clusterId}/backups | List backups of cluster | +| ClustersApi | [**ClustersDelete**](docs/api/ClustersApi.md#ClustersDelete) | **Delete** /clusters/{clusterId} | Delete a cluster | +| ClustersApi | [**ClustersFindById**](docs/api/ClustersApi.md#ClustersFindById) | **Get** /clusters/{clusterId} | Fetch a cluster | +| ClustersApi | [**ClustersGet**](docs/api/ClustersApi.md#ClustersGet) | **Get** /clusters | List clusters | +| ClustersApi | [**ClustersPatch**](docs/api/ClustersApi.md#ClustersPatch) | **Patch** /clusters/{clusterId} | Update a cluster | +| ClustersApi | [**ClustersPost**](docs/api/ClustersApi.md#ClustersPost) | **Post** /clusters | Create a cluster | +| RestoreApi | [**ClustersRestore**](docs/api/RestoreApi.md#ClustersRestore) | **Post** /clusters/{clusterId}/restore | In-place restore of a cluster. | +
+## Documentation For Models +All URIs are relative to *https://mariadb.de-txl.ionos.com* +
+API models list + + - [Backup](docs/models/Backup) + - [BackupList](docs/models/BackupList) + - [BackupListAllOf](docs/models/BackupListAllOf) + - [BackupResponse](docs/models/BackupResponse) + - [BaseBackup](docs/models/BaseBackup) + - [ClusterList](docs/models/ClusterList) + - [ClusterListAllOf](docs/models/ClusterListAllOf) + - [ClusterMetadata](docs/models/ClusterMetadata) + - [ClusterProperties](docs/models/ClusterProperties) + - [ClusterResponse](docs/models/ClusterResponse) + - [ClustersGet400Response](docs/models/ClustersGet400Response) + - [ClustersGet401Response](docs/models/ClustersGet401Response) + - [ClustersGet403Response](docs/models/ClustersGet403Response) + - [ClustersGet404Response](docs/models/ClustersGet404Response) + - [ClustersGet405Response](docs/models/ClustersGet405Response) + - [ClustersGet415Response](docs/models/ClustersGet415Response) + - [ClustersGet422Response](docs/models/ClustersGet422Response) + - [ClustersGet429Response](docs/models/ClustersGet429Response) + - [ClustersGet500Response](docs/models/ClustersGet500Response) + - [ClustersGet503Response](docs/models/ClustersGet503Response) + - [Connection](docs/models/Connection) + - [CreateClusterProperties](docs/models/CreateClusterProperties) + - [CreateClusterRequest](docs/models/CreateClusterRequest) + - [DBUser](docs/models/DBUser) + - [DayOfTheWeek](docs/models/DayOfTheWeek) + - [ErrorMessage](docs/models/ErrorMessage) + - [MaintenanceWindow](docs/models/MaintenanceWindow) + - [MariadbVersion](docs/models/MariadbVersion) + - [Pagination](docs/models/Pagination) + - [PaginationLinks](docs/models/PaginationLinks) + - [PatchClusterProperties](docs/models/PatchClusterProperties) + - [PatchClusterRequest](docs/models/PatchClusterRequest) + - [RestoreRequest](docs/models/RestoreRequest) + - [State](docs/models/State) + + +[[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models) + +
diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_backups.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_backups.go index baf542af7..c930a0ca0 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_backups.go +++ b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_backups.go @@ -38,10 +38,10 @@ func (r ApiBackupsFindByIdRequest) Execute() (BackupResponse, *APIResponse, erro } /* - - BackupsFindById Fetch a cluster's backups - - Retrieve a MariaDB cluster's backups by using its ID. This value can be + - BackupsFindById Fetch backups + - Retrieve a MariaDB backup by ID. This value can be -found when you GET the list of MariaDB cluster backups. +found when you GET the list of MariaDB backups. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param backupId The unique ID of the backup. @@ -271,7 +271,7 @@ func (r ApiBackupsGetRequest) Execute() (BackupList, *APIResponse, error) { } /* -* BackupsGet List of cluster's backups. +* BackupsGet List of backups. * Retrieves all lists of backups for all MariaDB clusters in this contract. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_clusters.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_clusters.go index bb1edb057..a1a9f4080 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_clusters.go +++ b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_clusters.go @@ -712,6 +712,237 @@ func (a *ClustersApiService) ClustersGetExecute(r ApiClustersGetRequest) (Cluste return localVarReturnValue, localVarAPIResponse, nil } +type ApiClustersPatchRequest struct { + ctx _context.Context + ApiService *ClustersApiService + clusterId string + patchClusterRequest *PatchClusterRequest +} + +func (r ApiClustersPatchRequest) PatchClusterRequest(patchClusterRequest PatchClusterRequest) ApiClustersPatchRequest { + r.patchClusterRequest = &patchClusterRequest + return r +} + +func (r ApiClustersPatchRequest) Execute() (ClusterResponse, *APIResponse, error) { + return r.ApiService.ClustersPatchExecute(r) +} + +/* + * ClustersPatch Update a cluster + * Updates mutable attributes on a MariaDB cluster. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param clusterId The unique ID of the cluster. + * @return ApiClustersPatchRequest + */ +func (a *ClustersApiService) ClustersPatch(ctx _context.Context, clusterId string) ApiClustersPatchRequest { + return ApiClustersPatchRequest{ + ApiService: a, + ctx: ctx, + clusterId: clusterId, + } +} + +/* + * Execute executes the request + * @return ClusterResponse + */ +func (a *ClustersApiService) ClustersPatchExecute(r ApiClustersPatchRequest) (ClusterResponse, *APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ClusterResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClustersApiService.ClustersPatch") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{clusterId}" + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.patchClusterRequest == nil { + return localVarReturnValue, nil, reportError("patchClusterRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchClusterRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestTime: httpRequestTime, + RequestURL: localVarPath, + Operation: "ClustersPatch", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarAPIResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarReturnValue, localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + if localVarHTTPResponse.StatusCode == 400 { + var v ClustersGet400Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 401 { + var v ClustersGet401Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 403 { + var v ClustersGet403Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 404 { + var v ClustersGet404Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 405 { + var v ClustersGet405Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 415 { + var v ClustersGet415Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 422 { + var v ClustersGet422Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 429 { + var v ClustersGet429Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 500 { + var v ClustersGet500Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 503 { + var v ClustersGet503Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarAPIResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarAPIResponse, newErr + } + + return localVarReturnValue, localVarAPIResponse, nil +} + type ApiClustersPostRequest struct { ctx _context.Context ApiService *ClustersApiService diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_restore.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_restore.go new file mode 100644 index 000000000..62b8f1816 --- /dev/null +++ b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/api_restore.go @@ -0,0 +1,252 @@ +/* + * IONOS DBaaS MariaDB REST API + * + * An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional MariaDB database clusters or modify existing ones. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + _context "context" + "fmt" + "io" + _nethttp "net/http" + _neturl "net/url" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// RestoreApiService RestoreApi service +type RestoreApiService service + +type ApiClustersRestoreRequest struct { + ctx _context.Context + ApiService *RestoreApiService + clusterId string + restoreRequest *RestoreRequest +} + +func (r ApiClustersRestoreRequest) RestoreRequest(restoreRequest RestoreRequest) ApiClustersRestoreRequest { + r.restoreRequest = &restoreRequest + return r +} + +func (r ApiClustersRestoreRequest) Execute() (*APIResponse, error) { + return r.ApiService.ClustersRestoreExecute(r) +} + +/* + - ClustersRestore In-place restore of a cluster. + - Restore a MariaDB cluster from a backup. + +Conditions: + - The backup must belong to the MariaDB cluster to + be restored. + - The cluster must be in the state "AVAILABLE". + - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + - @param clusterId The unique ID of the cluster. + - @return ApiClustersRestoreRequest +*/ +func (a *RestoreApiService) ClustersRestore(ctx _context.Context, clusterId string) ApiClustersRestoreRequest { + return ApiClustersRestoreRequest{ + ApiService: a, + ctx: ctx, + clusterId: clusterId, + } +} + +/* + * Execute executes the request + */ +func (a *RestoreApiService) ClustersRestoreExecute(r ApiClustersRestoreRequest) (*APIResponse, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RestoreApiService.ClustersRestore") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clusters/{clusterId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"clusterId"+"}", _neturl.PathEscape(parameterToString(r.clusterId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if r.restoreRequest == nil { + return nil, reportError("restoreRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.restoreRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["tokenAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, httpRequestTime, err := a.client.callAPI(req) + + localVarAPIResponse := &APIResponse{ + Response: localVarHTTPResponse, + Method: localVarHTTPMethod, + RequestTime: httpRequestTime, + RequestURL: localVarPath, + Operation: "ClustersRestore", + } + + if err != nil || localVarHTTPResponse == nil { + return localVarAPIResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarAPIResponse.Payload = localVarBody + if err != nil { + return localVarAPIResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + statusCode: localVarHTTPResponse.StatusCode, + body: localVarBody, + error: fmt.Sprintf("%s: %s", localVarHTTPResponse.Status, string(localVarBody)), + } + if localVarHTTPResponse.StatusCode == 400 { + var v ClustersGet400Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 401 { + var v ClustersGet401Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 403 { + var v ClustersGet403Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 404 { + var v ClustersGet404Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 405 { + var v ClustersGet405Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 415 { + var v ClustersGet415Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 422 { + var v ClustersGet422Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 429 { + var v ClustersGet429Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 500 { + var v ClustersGet500Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarAPIResponse, newErr + } + newErr.model = v + } + if localVarHTTPResponse.StatusCode == 503 { + var v ClustersGet503Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarAPIResponse, newErr + } + newErr.model = v + } + return localVarAPIResponse, newErr + } + + return localVarAPIResponse, nil +} diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/client.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/client.go index 6c2323c52..e5d662fa0 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/client.go +++ b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/client.go @@ -50,7 +50,7 @@ const ( RequestStatusFailed = "FAILED" RequestStatusDone = "DONE" - Version = "1.0.0" + Version = "1.1.1" ) // APIClient manages communication with the IONOS DBaaS MariaDB REST API API v0.1.0 @@ -64,6 +64,8 @@ type APIClient struct { BackupsApi *BackupsApiService ClustersApi *ClustersApiService + + RestoreApi *RestoreApiService } type service struct { @@ -91,6 +93,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { // API Services c.BackupsApi = (*BackupsApiService)(&c.common) c.ClustersApi = (*ClustersApiService)(&c.common) + c.RestoreApi = (*RestoreApiService)(&c.common) return c } diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/configuration.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/configuration.go index ccdeed794..6f3be7ffc 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/configuration.go +++ b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/configuration.go @@ -34,6 +34,19 @@ const ( defaultMaxWaitTime = time.Duration(2000) * time.Millisecond ) +var ( + IonosServerUrls = []string{ + "https://mariadb.de-txl.ionos.com", + "https://mariadb.de-fra.ionos.com", + "https://mariadb.es-vit.ionos.com", + "https://mariadb.fr-par.ionos.com", + "https://mariadb.gb-lhr.ionos.com", + "https://mariadb.us-ewr.ionos.com", + "https://mariadb.us-las.ionos.com", + "https://mariadb.us-mci.ionos.com", + } +) + // contextKeys are used to identify the type of value in the context. // Since these are string, it is possible to get a short description of the // context key for logging and debugging using key.String(). @@ -128,7 +141,7 @@ func NewConfiguration(username, password, token, hostUrl string) *Configuration cfg := &Configuration{ DefaultHeader: make(map[string]string), DefaultQueryParams: url.Values{}, - UserAgent: "ionos-cloud-sdk-go-dbaas-mariadb/v1.0.0", + UserAgent: "ionos-cloud-sdk-go-dbaas-mariadb/v1.1.1", Debug: false, Username: username, Password: password, @@ -143,6 +156,34 @@ func NewConfiguration(username, password, token, hostUrl string) *Configuration URL: getServerUrl(hostUrl), Description: "Berlin, Germany", }, + { + URL: getServerUrl(hostUrl), + Description: "Frankfurt, Germany", + }, + { + URL: getServerUrl(hostUrl), + Description: "Logroño, Spain", + }, + { + URL: getServerUrl(hostUrl), + Description: "Paris, France", + }, + { + URL: getServerUrl(hostUrl), + Description: "London, Great Britain", + }, + { + URL: getServerUrl(hostUrl), + Description: "Newark, USA", + }, + { + URL: getServerUrl(hostUrl), + Description: "Las Vegas, USA", + }, + { + URL: getServerUrl(hostUrl), + Description: "Lenexa, USA", + }, }, OperationServers: map[string]ServerConfigurations{}, } diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_create_cluster_properties.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_create_cluster_properties.go index 0428937c6..64f4c72c4 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_create_cluster_properties.go +++ b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_create_cluster_properties.go @@ -31,6 +31,7 @@ type CreateClusterProperties struct { DisplayName *string `json:"displayName"` MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` Credentials *DBUser `json:"credentials"` + FromBackup *RestoreRequest `json:"fromBackup,omitempty"` } // NewCreateClusterProperties instantiates a new CreateClusterProperties object @@ -402,6 +403,44 @@ func (o *CreateClusterProperties) HasCredentials() bool { return false } +// GetFromBackup returns the FromBackup field value +// If the value is explicit nil, the zero value for RestoreRequest will be returned +func (o *CreateClusterProperties) GetFromBackup() *RestoreRequest { + if o == nil { + return nil + } + + return o.FromBackup + +} + +// GetFromBackupOk returns a tuple with the FromBackup field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateClusterProperties) GetFromBackupOk() (*RestoreRequest, bool) { + if o == nil { + return nil, false + } + + return o.FromBackup, true +} + +// SetFromBackup sets field value +func (o *CreateClusterProperties) SetFromBackup(v RestoreRequest) { + + o.FromBackup = &v + +} + +// HasFromBackup returns a boolean if a field has been set. +func (o *CreateClusterProperties) HasFromBackup() bool { + if o != nil && o.FromBackup != nil { + return true + } + + return false +} + func (o CreateClusterProperties) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.MariadbVersion != nil { @@ -440,6 +479,10 @@ func (o CreateClusterProperties) MarshalJSON() ([]byte, error) { toSerialize["credentials"] = o.Credentials } + if o.FromBackup != nil { + toSerialize["fromBackup"] = o.FromBackup + } + return json.Marshal(toSerialize) } diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_properties.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_properties.go new file mode 100644 index 000000000..96e5071da --- /dev/null +++ b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_properties.go @@ -0,0 +1,384 @@ +/* + * IONOS DBaaS MariaDB REST API + * + * An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional MariaDB database clusters or modify existing ones. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// PatchClusterProperties Properties of the payload to change a cluster: - instances can only be increased (3, 5, 7), - mariadbVersion can only be increased (no downgrade) - storageSize can only be increased, - ram and cores can be both increased and decreased. +type PatchClusterProperties struct { + MariadbVersion *MariadbVersion `json:"mariadbVersion,omitempty"` + // The total number of instances in the cluster (one primary and n-1 secondary). + Instances *int32 `json:"instances,omitempty"` + // The number of CPU cores per instance. + Cores *int32 `json:"cores,omitempty"` + // The amount of memory per instance in gigabytes (GB). + Ram *int32 `json:"ram,omitempty"` + // The amount of storage per instance in gigabytes (GB). + StorageSize *int32 `json:"storageSize,omitempty"` + // The friendly name of your cluster. + DisplayName *string `json:"displayName,omitempty"` + MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` +} + +// NewPatchClusterProperties instantiates a new PatchClusterProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchClusterProperties() *PatchClusterProperties { + this := PatchClusterProperties{} + + return &this +} + +// NewPatchClusterPropertiesWithDefaults instantiates a new PatchClusterProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchClusterPropertiesWithDefaults() *PatchClusterProperties { + this := PatchClusterProperties{} + return &this +} + +// GetMariadbVersion returns the MariadbVersion field value +// If the value is explicit nil, the zero value for MariadbVersion will be returned +func (o *PatchClusterProperties) GetMariadbVersion() *MariadbVersion { + if o == nil { + return nil + } + + return o.MariadbVersion + +} + +// GetMariadbVersionOk returns a tuple with the MariadbVersion field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchClusterProperties) GetMariadbVersionOk() (*MariadbVersion, bool) { + if o == nil { + return nil, false + } + + return o.MariadbVersion, true +} + +// SetMariadbVersion sets field value +func (o *PatchClusterProperties) SetMariadbVersion(v MariadbVersion) { + + o.MariadbVersion = &v + +} + +// HasMariadbVersion returns a boolean if a field has been set. +func (o *PatchClusterProperties) HasMariadbVersion() bool { + if o != nil && o.MariadbVersion != nil { + return true + } + + return false +} + +// GetInstances returns the Instances field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *PatchClusterProperties) GetInstances() *int32 { + if o == nil { + return nil + } + + return o.Instances + +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchClusterProperties) GetInstancesOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Instances, true +} + +// SetInstances sets field value +func (o *PatchClusterProperties) SetInstances(v int32) { + + o.Instances = &v + +} + +// HasInstances returns a boolean if a field has been set. +func (o *PatchClusterProperties) HasInstances() bool { + if o != nil && o.Instances != nil { + return true + } + + return false +} + +// GetCores returns the Cores field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *PatchClusterProperties) GetCores() *int32 { + if o == nil { + return nil + } + + return o.Cores + +} + +// GetCoresOk returns a tuple with the Cores field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchClusterProperties) GetCoresOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Cores, true +} + +// SetCores sets field value +func (o *PatchClusterProperties) SetCores(v int32) { + + o.Cores = &v + +} + +// HasCores returns a boolean if a field has been set. +func (o *PatchClusterProperties) HasCores() bool { + if o != nil && o.Cores != nil { + return true + } + + return false +} + +// GetRam returns the Ram field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *PatchClusterProperties) GetRam() *int32 { + if o == nil { + return nil + } + + return o.Ram + +} + +// GetRamOk returns a tuple with the Ram field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchClusterProperties) GetRamOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.Ram, true +} + +// SetRam sets field value +func (o *PatchClusterProperties) SetRam(v int32) { + + o.Ram = &v + +} + +// HasRam returns a boolean if a field has been set. +func (o *PatchClusterProperties) HasRam() bool { + if o != nil && o.Ram != nil { + return true + } + + return false +} + +// GetStorageSize returns the StorageSize field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *PatchClusterProperties) GetStorageSize() *int32 { + if o == nil { + return nil + } + + return o.StorageSize + +} + +// GetStorageSizeOk returns a tuple with the StorageSize field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchClusterProperties) GetStorageSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + + return o.StorageSize, true +} + +// SetStorageSize sets field value +func (o *PatchClusterProperties) SetStorageSize(v int32) { + + o.StorageSize = &v + +} + +// HasStorageSize returns a boolean if a field has been set. +func (o *PatchClusterProperties) HasStorageSize() bool { + if o != nil && o.StorageSize != nil { + return true + } + + return false +} + +// GetDisplayName returns the DisplayName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *PatchClusterProperties) GetDisplayName() *string { + if o == nil { + return nil + } + + return o.DisplayName + +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchClusterProperties) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *PatchClusterProperties) SetDisplayName(v string) { + + o.DisplayName = &v + +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *PatchClusterProperties) HasDisplayName() bool { + if o != nil && o.DisplayName != nil { + return true + } + + return false +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value +// If the value is explicit nil, the zero value for MaintenanceWindow will be returned +func (o *PatchClusterProperties) GetMaintenanceWindow() *MaintenanceWindow { + if o == nil { + return nil + } + + return o.MaintenanceWindow + +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchClusterProperties) GetMaintenanceWindowOk() (*MaintenanceWindow, bool) { + if o == nil { + return nil, false + } + + return o.MaintenanceWindow, true +} + +// SetMaintenanceWindow sets field value +func (o *PatchClusterProperties) SetMaintenanceWindow(v MaintenanceWindow) { + + o.MaintenanceWindow = &v + +} + +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *PatchClusterProperties) HasMaintenanceWindow() bool { + if o != nil && o.MaintenanceWindow != nil { + return true + } + + return false +} + +func (o PatchClusterProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MariadbVersion != nil { + toSerialize["mariadbVersion"] = o.MariadbVersion + } + + if o.Instances != nil { + toSerialize["instances"] = o.Instances + } + + if o.Cores != nil { + toSerialize["cores"] = o.Cores + } + + if o.Ram != nil { + toSerialize["ram"] = o.Ram + } + + if o.StorageSize != nil { + toSerialize["storageSize"] = o.StorageSize + } + + if o.DisplayName != nil { + toSerialize["displayName"] = o.DisplayName + } + + if o.MaintenanceWindow != nil { + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + } + + return json.Marshal(toSerialize) +} + +type NullablePatchClusterProperties struct { + value *PatchClusterProperties + isSet bool +} + +func (v NullablePatchClusterProperties) Get() *PatchClusterProperties { + return v.value +} + +func (v *NullablePatchClusterProperties) Set(val *PatchClusterProperties) { + v.value = val + v.isSet = true +} + +func (v NullablePatchClusterProperties) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchClusterProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchClusterProperties(val *PatchClusterProperties) *NullablePatchClusterProperties { + return &NullablePatchClusterProperties{value: val, isSet: true} +} + +func (v NullablePatchClusterProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchClusterProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_request.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_request.go new file mode 100644 index 000000000..2bc625e9a --- /dev/null +++ b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_patch_cluster_request.go @@ -0,0 +1,164 @@ +/* + * IONOS DBaaS MariaDB REST API + * + * An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional MariaDB database clusters or modify existing ones. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" +) + +// PatchClusterRequest Request payload to change a cluster. +type PatchClusterRequest struct { + Metadata *ClusterMetadata `json:"metadata,omitempty"` + Properties *PatchClusterProperties `json:"properties,omitempty"` +} + +// NewPatchClusterRequest instantiates a new PatchClusterRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchClusterRequest() *PatchClusterRequest { + this := PatchClusterRequest{} + + return &this +} + +// NewPatchClusterRequestWithDefaults instantiates a new PatchClusterRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchClusterRequestWithDefaults() *PatchClusterRequest { + this := PatchClusterRequest{} + return &this +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for ClusterMetadata will be returned +func (o *PatchClusterRequest) GetMetadata() *ClusterMetadata { + if o == nil { + return nil + } + + return o.Metadata + +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchClusterRequest) GetMetadataOk() (*ClusterMetadata, bool) { + if o == nil { + return nil, false + } + + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *PatchClusterRequest) SetMetadata(v ClusterMetadata) { + + o.Metadata = &v + +} + +// HasMetadata returns a boolean if a field has been set. +func (o *PatchClusterRequest) HasMetadata() bool { + if o != nil && o.Metadata != nil { + return true + } + + return false +} + +// GetProperties returns the Properties field value +// If the value is explicit nil, the zero value for PatchClusterProperties will be returned +func (o *PatchClusterRequest) GetProperties() *PatchClusterProperties { + if o == nil { + return nil + } + + return o.Properties + +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchClusterRequest) GetPropertiesOk() (*PatchClusterProperties, bool) { + if o == nil { + return nil, false + } + + return o.Properties, true +} + +// SetProperties sets field value +func (o *PatchClusterRequest) SetProperties(v PatchClusterProperties) { + + o.Properties = &v + +} + +// HasProperties returns a boolean if a field has been set. +func (o *PatchClusterRequest) HasProperties() bool { + if o != nil && o.Properties != nil { + return true + } + + return false +} + +func (o PatchClusterRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + + return json.Marshal(toSerialize) +} + +type NullablePatchClusterRequest struct { + value *PatchClusterRequest + isSet bool +} + +func (v NullablePatchClusterRequest) Get() *PatchClusterRequest { + return v.value +} + +func (v *NullablePatchClusterRequest) Set(val *PatchClusterRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchClusterRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchClusterRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchClusterRequest(val *PatchClusterRequest) *NullablePatchClusterRequest { + return &NullablePatchClusterRequest{value: val, isSet: true} +} + +func (v NullablePatchClusterRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchClusterRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_restore_request.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_restore_request.go new file mode 100644 index 000000000..c2c1b1fb8 --- /dev/null +++ b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_restore_request.go @@ -0,0 +1,176 @@ +/* + * IONOS DBaaS MariaDB REST API + * + * An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional MariaDB database clusters or modify existing ones. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive. + * + * API version: 0.1.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ionoscloud + +import ( + "encoding/json" + "time" +) + +// RestoreRequest Request payload to restore a cluster from a backup. +type RestoreRequest struct { + // The unique ID of the resource. + BackupId *string `json:"backupId"` + // The timestamp to which the cluster should be restored. If empty, the backup will be applied to the latest timestamp. This value must be supplied as ISO 8601 timestamp, the backup will be replayed up until the given timestamp. If empty, the backup will be applied completely. Must be within the earliestRecoveryTargetTime and now. The earliestRecoveryTargetTime can be looked up in the backup object. + RecoveryTargetTime *IonosTime `json:"recoveryTargetTime,omitempty"` +} + +// NewRestoreRequest instantiates a new RestoreRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRestoreRequest(backupId string) *RestoreRequest { + this := RestoreRequest{} + + this.BackupId = &backupId + + return &this +} + +// NewRestoreRequestWithDefaults instantiates a new RestoreRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRestoreRequestWithDefaults() *RestoreRequest { + this := RestoreRequest{} + return &this +} + +// GetBackupId returns the BackupId field value +// If the value is explicit nil, the zero value for string will be returned +func (o *RestoreRequest) GetBackupId() *string { + if o == nil { + return nil + } + + return o.BackupId + +} + +// GetBackupIdOk returns a tuple with the BackupId field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RestoreRequest) GetBackupIdOk() (*string, bool) { + if o == nil { + return nil, false + } + + return o.BackupId, true +} + +// SetBackupId sets field value +func (o *RestoreRequest) SetBackupId(v string) { + + o.BackupId = &v + +} + +// HasBackupId returns a boolean if a field has been set. +func (o *RestoreRequest) HasBackupId() bool { + if o != nil && o.BackupId != nil { + return true + } + + return false +} + +// GetRecoveryTargetTime returns the RecoveryTargetTime field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *RestoreRequest) GetRecoveryTargetTime() *time.Time { + if o == nil { + return nil + } + + if o.RecoveryTargetTime == nil { + return nil + } + return &o.RecoveryTargetTime.Time + +} + +// GetRecoveryTargetTimeOk returns a tuple with the RecoveryTargetTime field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RestoreRequest) GetRecoveryTargetTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + + if o.RecoveryTargetTime == nil { + return nil, false + } + return &o.RecoveryTargetTime.Time, true + +} + +// SetRecoveryTargetTime sets field value +func (o *RestoreRequest) SetRecoveryTargetTime(v time.Time) { + + o.RecoveryTargetTime = &IonosTime{v} + +} + +// HasRecoveryTargetTime returns a boolean if a field has been set. +func (o *RestoreRequest) HasRecoveryTargetTime() bool { + if o != nil && o.RecoveryTargetTime != nil { + return true + } + + return false +} + +func (o RestoreRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.BackupId != nil { + toSerialize["backupId"] = o.BackupId + } + + if o.RecoveryTargetTime != nil { + toSerialize["recoveryTargetTime"] = o.RecoveryTargetTime + } + + return json.Marshal(toSerialize) +} + +type NullableRestoreRequest struct { + value *RestoreRequest + isSet bool +} + +func (v NullableRestoreRequest) Get() *RestoreRequest { + return v.value +} + +func (v *NullableRestoreRequest) Set(val *RestoreRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRestoreRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRestoreRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestoreRequest(val *RestoreRequest) *NullableRestoreRequest { + return &NullableRestoreRequest{value: val, isSet: true} +} + +func (v NullableRestoreRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestoreRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_state.go b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_state.go index 8697f8573..9f51a4c35 100644 --- a/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_state.go +++ b/vendor/github.com/ionos-cloud/sdk-go-dbaas-mariadb/model_state.go @@ -22,6 +22,9 @@ type State string const ( STATE_AVAILABLE State = "AVAILABLE" STATE_BUSY State = "BUSY" + STATE_CREATING State = "CREATING" + STATE_UPDATING State = "UPDATING" + STATE_RESTORING State = "RESTORING" STATE_DESTROYING State = "DESTROYING" STATE_DEGRADED State = "DEGRADED" STATE_FAILED State = "FAILED" @@ -35,7 +38,7 @@ func (v *State) UnmarshalJSON(src []byte) error { return err } enumTypeValue := State(value) - for _, existing := range []State{"AVAILABLE", "BUSY", "DESTROYING", "DEGRADED", "FAILED", "UNKNOWN"} { + for _, existing := range []State{"AVAILABLE", "BUSY", "CREATING", "UPDATING", "RESTORING", "DESTROYING", "DEGRADED", "FAILED", "UNKNOWN"} { if existing == enumTypeValue { *v = enumTypeValue return nil diff --git a/vendor/golang.org/x/oauth2/LICENSE b/vendor/golang.org/x/oauth2/LICENSE index 6a66aea5e..2a7cf70da 100644 --- a/vendor/golang.org/x/oauth2/LICENSE +++ b/vendor/golang.org/x/oauth2/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/oauth2/README.md b/vendor/golang.org/x/oauth2/README.md index 781770c20..48dbb9d84 100644 --- a/vendor/golang.org/x/oauth2/README.md +++ b/vendor/golang.org/x/oauth2/README.md @@ -5,15 +5,6 @@ oauth2 package contains a client implementation for OAuth 2.0 spec. -## Installation - -~~~~ -go get golang.org/x/oauth2 -~~~~ - -Or you can manually git clone the repository to -`$(go env GOPATH)/src/golang.org/x/oauth2`. - See pkg.go.dev for further documentation and examples. * [pkg.go.dev/golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2) @@ -33,7 +24,11 @@ The main issue tracker for the oauth2 repository is located at https://github.com/golang/oauth2/issues. This repository uses Gerrit for code changes. To learn how to submit changes to -this repository, see https://golang.org/doc/contribute.html. In particular: +this repository, see https://go.dev/doc/contribute. + +The git repository is https://go.googlesource.com/oauth2. + +Note: * Excluding trivial changes, all contributions should be connected to an existing issue. * API changes must go through the [change proposal process](https://go.dev/s/proposal-process) before they can be accepted. diff --git a/vendor/golang.org/x/oauth2/token.go b/vendor/golang.org/x/oauth2/token.go index 5bbb33217..109997d77 100644 --- a/vendor/golang.org/x/oauth2/token.go +++ b/vendor/golang.org/x/oauth2/token.go @@ -49,6 +49,13 @@ type Token struct { // mechanisms for that TokenSource will not be used. Expiry time.Time `json:"expiry,omitempty"` + // ExpiresIn is the OAuth2 wire format "expires_in" field, + // which specifies how many seconds later the token expires, + // relative to an unknown time base approximately around "now". + // It is the application's responsibility to populate + // `Expiry` from `ExpiresIn` when required. + ExpiresIn int64 `json:"expires_in,omitempty"` + // raw optionally contains extra metadata from the server // when updating a token. raw interface{} diff --git a/vendor/modules.txt b/vendor/modules.txt index d2cf3a3f5..e28126acc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -75,7 +75,7 @@ github.com/ionos-cloud/sdk-go-container-registry # github.com/ionos-cloud/sdk-go-dataplatform v1.0.2 ## explicit; go 1.18 github.com/ionos-cloud/sdk-go-dataplatform -# github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.0.0 +# github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.1.1 ## explicit; go 1.18 github.com/ionos-cloud/sdk-go-dbaas-mariadb # github.com/ionos-cloud/sdk-go-dbaas-mongo v1.3.1 @@ -201,7 +201,7 @@ golang.org/x/crypto/ssh/internal/bcrypt_pbkdf golang.org/x/exp/constraints golang.org/x/exp/slices golang.org/x/exp/utf8string -# golang.org/x/oauth2 v0.21.0 +# golang.org/x/oauth2 v0.24.0 ## explicit; go 1.18 golang.org/x/oauth2 golang.org/x/oauth2/internal