diff --git a/CHANGELOG.md b/CHANGELOG.md index 049b3363f..544625fd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## Release (2025-XX-XX) + +- `ske`: [v1.0.0](services/ske/CHANGELOG.md#v100) + - **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. - `opensearch`: [v0.24.0](services/opensearch/CHANGELOG.md#v0240) - **Breaking change:** `InstanceParametersTlsProtocols` is now a string array instead of a single string - Add `required:"true"` tags to model structs diff --git a/examples/ske/ske.go b/examples/ske/ske.go index 081fa92f1..c9dbcd1f4 100644 --- a/examples/ske/ske.go +++ b/examples/ske/ske.go @@ -5,7 +5,6 @@ import ( "fmt" "os" - "github.com/stackitcloud/stackit-sdk-go/core/config" "github.com/stackitcloud/stackit-sdk-go/core/utils" "github.com/stackitcloud/stackit-sdk-go/services/ske" "github.com/stackitcloud/stackit-sdk-go/services/ske/wait" @@ -15,10 +14,11 @@ func main() { // Specify the project ID projectId := "PROJECT_ID" + // Specify the region + region := "REGION" + // Create a new API client, that uses default authentication and configuration - skeClient, err := ske.NewAPIClient( - config.WithRegion("eu01"), - ) + skeClient, err := ske.NewAPIClient() if err != nil { fmt.Fprintf(os.Stderr, "Creating API client: %v\n", err) os.Exit(1) @@ -33,7 +33,7 @@ func main() { // } // Get the ske clusters for your project - getClustersResp, err := skeClient.ListClusters(context.Background(), projectId).Execute() + getClustersResp, err := skeClient.ListClusters(context.Background(), projectId, region).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `GetClusters`: %v\n", err) } else { @@ -42,7 +42,7 @@ func main() { var availableVersion string // Get the ske provider options - getOptionsResp, err := skeClient.ListProviderOptions(context.Background()).Execute() + getOptionsResp, err := skeClient.ListProviderOptions(context.Background(), region).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `GetOptions`: %v\n", err) } else { @@ -77,7 +77,7 @@ func main() { }, } clusterName := "cl-name" - createClusterResp, err := skeClient.CreateOrUpdateCluster(context.Background(), projectId, clusterName).CreateOrUpdateClusterPayload(createInstancePayload).Execute() + createClusterResp, err := skeClient.CreateOrUpdateCluster(context.Background(), projectId, region, clusterName).CreateOrUpdateClusterPayload(createInstancePayload).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `CreateCluster`: %v\n", err) } else { @@ -85,7 +85,7 @@ func main() { } // Wait for cluster creation to complete - _, err = wait.CreateOrUpdateClusterWaitHandler(context.Background(), skeClient, projectId, clusterName).WaitWithContext(context.Background()) + _, err = wait.CreateOrUpdateClusterWaitHandler(context.Background(), skeClient, projectId, region, clusterName).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `CreateOrUpdateCluster`: %v\n", err) } else { @@ -93,7 +93,7 @@ func main() { } // Start cluster credential rotation - _, err = skeClient.StartCredentialsRotationExecute(context.Background(), projectId, clusterName) + _, err = skeClient.StartCredentialsRotationExecute(context.Background(), projectId, region, clusterName) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `StartCredentialsRotation`: %v\n", err) } else { @@ -101,7 +101,7 @@ func main() { } // Wait for cluster credential rotation to be prepared - _, err = wait.StartCredentialsRotationWaitHandler(context.Background(), skeClient, projectId, clusterName).WaitWithContext(context.Background()) + _, err = wait.StartCredentialsRotationWaitHandler(context.Background(), skeClient, projectId, region, clusterName).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `StartRotateCredentials`: %v\n", err) } else { @@ -109,7 +109,7 @@ func main() { } // Complete cluster credential rotation - _, err = skeClient.CompleteCredentialsRotationExecute(context.Background(), projectId, clusterName) + _, err = skeClient.CompleteCredentialsRotationExecute(context.Background(), projectId, region, clusterName) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `CompleteCredentialsRotation`: %v\n", err) } else { @@ -117,7 +117,7 @@ func main() { } // Wait for cluster credential rotation to be completed - _, err = wait.CompleteCredentialsRotationWaitHandler(context.Background(), skeClient, projectId, clusterName).WaitWithContext(context.Background()) + _, err = wait.CompleteCredentialsRotationWaitHandler(context.Background(), skeClient, projectId, region, clusterName).WaitWithContext(context.Background()) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `CompleteRotateCredentials`: %v\n", err) } else { diff --git a/services/ske/CHANGELOG.md b/services/ske/CHANGELOG.md index 13dac8aae..f406e282d 100644 --- a/services/ske/CHANGELOG.md +++ b/services/ske/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.0.0 +- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request. + ## v0.27.0 - **Feature:** Add new `ClusterErrorCode` types: `CLUSTERERRORCODE_INFRA_SNA_NETWORK_NOT_FOUND`, `CLUSTERERRORCODE_FETCHING_ERRORS_NOT_POSSIBLE` diff --git a/services/ske/VERSION b/services/ske/VERSION index 37eb51de3..60453e690 100644 --- a/services/ske/VERSION +++ b/services/ske/VERSION @@ -1 +1 @@ -v0.27.0 \ No newline at end of file +v1.0.0 \ No newline at end of file diff --git a/services/ske/api_default.go b/services/ske/api_default.go index 0557f8ade..74a2d99ca 100644 --- a/services/ske/api_default.go +++ b/services/ske/api_default.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -30,234 +30,258 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiCompleteCredentialsRotationRequest */ - CompleteCredentialsRotation(ctx context.Context, projectId string, clusterName string) ApiCompleteCredentialsRotationRequest + CompleteCredentialsRotation(ctx context.Context, projectId string, region string, clusterName string) ApiCompleteCredentialsRotationRequest /* CompleteCredentialsRotationExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return map[string]interface{} */ - CompleteCredentialsRotationExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) + CompleteCredentialsRotationExecute(ctx context.Context, projectId string, region string, clusterName string) (map[string]interface{}, error) /* CreateKubeconfig Create a kubeconfig Create a new kubeconfig for the cluster. You can specify the expiration (in seconds) in the request body. Its value must be in the range from 600 (10 min) to 15552000 (6 months). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiCreateKubeconfigRequest */ - CreateKubeconfig(ctx context.Context, projectId string, clusterName string) ApiCreateKubeconfigRequest + CreateKubeconfig(ctx context.Context, projectId string, region string, clusterName string) ApiCreateKubeconfigRequest /* CreateKubeconfigExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return Kubeconfig */ - CreateKubeconfigExecute(ctx context.Context, projectId string, clusterName string) (*Kubeconfig, error) + CreateKubeconfigExecute(ctx context.Context, projectId string, region string, clusterName string) (*Kubeconfig, error) /* CreateOrUpdateCluster Create or update a cluster Create a new cluster in your project or modify an existing one. To get valid values for certain properties please check the [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) endpoint. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiCreateOrUpdateClusterRequest */ - CreateOrUpdateCluster(ctx context.Context, projectId string, clusterName string) ApiCreateOrUpdateClusterRequest + CreateOrUpdateCluster(ctx context.Context, projectId string, region string, clusterName string) ApiCreateOrUpdateClusterRequest /* CreateOrUpdateClusterExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return Cluster */ - CreateOrUpdateClusterExecute(ctx context.Context, projectId string, clusterName string) (*Cluster, error) + CreateOrUpdateClusterExecute(ctx context.Context, projectId string, region string, clusterName string) (*Cluster, error) /* DeleteCluster Delete a cluster Delete Kubernetes cluster specified by the identifier, belonging to the project specified by `projectId`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiDeleteClusterRequest */ - DeleteCluster(ctx context.Context, projectId string, clusterName string) ApiDeleteClusterRequest + DeleteCluster(ctx context.Context, projectId string, region string, clusterName string) ApiDeleteClusterRequest /* DeleteClusterExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return map[string]interface{} */ - DeleteClusterExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) + DeleteClusterExecute(ctx context.Context, projectId string, region string, clusterName string) (map[string]interface{}, error) /* GetCluster Get a cluster Get Kubernetes cluster for the specified identifier, belonging to the project specified by `projectId`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiGetClusterRequest */ - GetCluster(ctx context.Context, projectId string, clusterName string) ApiGetClusterRequest + GetCluster(ctx context.Context, projectId string, region string, clusterName string) ApiGetClusterRequest /* GetClusterExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return Cluster */ - GetClusterExecute(ctx context.Context, projectId string, clusterName string) (*Cluster, error) + GetClusterExecute(ctx context.Context, projectId string, region string, clusterName string) (*Cluster, error) /* GetLoginKubeconfig Get a kubeconfig for use with the STACKIT CLI A kubeconfig retrieved using this endpoint does not contain any credentials and instead obtains valid credentials via the STACKIT CLI. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiGetLoginKubeconfigRequest */ - GetLoginKubeconfig(ctx context.Context, projectId string, clusterName string) ApiGetLoginKubeconfigRequest + GetLoginKubeconfig(ctx context.Context, projectId string, region string, clusterName string) ApiGetLoginKubeconfigRequest /* GetLoginKubeconfigExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return LoginKubeconfig */ - GetLoginKubeconfigExecute(ctx context.Context, projectId string, clusterName string) (*LoginKubeconfig, error) + GetLoginKubeconfigExecute(ctx context.Context, projectId string, region string, clusterName string) (*LoginKubeconfig, error) /* ListClusters List all clusters Return a list of Kubernetes clusters in the project specified by `projectId`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @return ApiListClustersRequest */ - ListClusters(ctx context.Context, projectId string) ApiListClustersRequest + ListClusters(ctx context.Context, projectId string, region string) ApiListClustersRequest /* ListClustersExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @return ListClustersResponse */ - ListClustersExecute(ctx context.Context, projectId string) (*ListClustersResponse, error) + ListClustersExecute(ctx context.Context, projectId string, region string) (*ListClustersResponse, error) /* ListProviderOptions List provider options Returns a list of supported Kubernetes versions and a list of supported machine types for the cluster nodes. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region @return ApiListProviderOptionsRequest */ - ListProviderOptions(ctx context.Context) ApiListProviderOptionsRequest + ListProviderOptions(ctx context.Context, region string) ApiListProviderOptionsRequest /* ListProviderOptionsExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region @return ProviderOptions */ - ListProviderOptionsExecute(ctx context.Context) (*ProviderOptions, error) + ListProviderOptionsExecute(ctx context.Context, region string) (*ProviderOptions, error) /* StartCredentialsRotation Start cluster credentials rotation Start cluster credentials rotation. This is step 1 of a two-step process. Complete the rotation using [complete-credentials-rotation](#tag/Credentials/operation/SkeService_CompleteClusterCredentialsRotation). @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiStartCredentialsRotationRequest */ - StartCredentialsRotation(ctx context.Context, projectId string, clusterName string) ApiStartCredentialsRotationRequest + StartCredentialsRotation(ctx context.Context, projectId string, region string, clusterName string) ApiStartCredentialsRotationRequest /* StartCredentialsRotationExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return map[string]interface{} */ - StartCredentialsRotationExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) + StartCredentialsRotationExecute(ctx context.Context, projectId string, region string, clusterName string) (map[string]interface{}, error) /* TriggerHibernate Trigger cluster hibernation Trigger immediate hibernation of the cluster. If the cluster is already in hibernation state, the method does nothing. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiTriggerHibernateRequest */ - TriggerHibernate(ctx context.Context, projectId string, clusterName string) ApiTriggerHibernateRequest + TriggerHibernate(ctx context.Context, projectId string, region string, clusterName string) ApiTriggerHibernateRequest /* TriggerHibernateExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return map[string]interface{} */ - TriggerHibernateExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) + TriggerHibernateExecute(ctx context.Context, projectId string, region string, clusterName string) (map[string]interface{}, error) /* TriggerMaintenance Trigger cluster maintenance Trigger immediate maintenance of the cluster. The autoUpdate configuration specified in the Maintenance object of the cluster spec defines what is updated during the immediate maintenance operation. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiTriggerMaintenanceRequest */ - TriggerMaintenance(ctx context.Context, projectId string, clusterName string) ApiTriggerMaintenanceRequest + TriggerMaintenance(ctx context.Context, projectId string, region string, clusterName string) ApiTriggerMaintenanceRequest /* TriggerMaintenanceExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return map[string]interface{} */ - TriggerMaintenanceExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) + TriggerMaintenanceExecute(ctx context.Context, projectId string, region string, clusterName string) (map[string]interface{}, error) /* TriggerReconcile Trigger cluster reconciliation Trigger immediate reconciliation of the complete cluster without changing the cluster specification. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiTriggerReconcileRequest */ - TriggerReconcile(ctx context.Context, projectId string, clusterName string) ApiTriggerReconcileRequest + TriggerReconcile(ctx context.Context, projectId string, region string, clusterName string) ApiTriggerReconcileRequest /* TriggerReconcileExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return map[string]interface{} */ - TriggerReconcileExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) + TriggerReconcileExecute(ctx context.Context, projectId string, region string, clusterName string) (map[string]interface{}, error) } type ApiCompleteCredentialsRotationRequest interface { @@ -317,6 +341,7 @@ type CompleteCredentialsRotationRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string clusterName string } @@ -337,8 +362,9 @@ func (r CompleteCredentialsRotationRequest) Execute() (map[string]interface{}, e return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/complete-credentials-rotation" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/complete-credentials-rotation" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -1) localVarHeaderParams := make(map[string]string) @@ -405,6 +431,17 @@ func (r CompleteCredentialsRotationRequest) Execute() (map[string]interface{}, e newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v map[string]interface{} err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -447,23 +484,26 @@ Complete cluster credentials rotation. This is step 2 of a two-step process. Sta @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiCompleteCredentialsRotationRequest */ -func (a *APIClient) CompleteCredentialsRotation(ctx context.Context, projectId string, clusterName string) ApiCompleteCredentialsRotationRequest { +func (a *APIClient) CompleteCredentialsRotation(ctx context.Context, projectId string, region string, clusterName string) ApiCompleteCredentialsRotationRequest { return CompleteCredentialsRotationRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } } -func (a *APIClient) CompleteCredentialsRotationExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) { +func (a *APIClient) CompleteCredentialsRotationExecute(ctx context.Context, projectId string, region string, clusterName string) (map[string]interface{}, error) { r := CompleteCredentialsRotationRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } return r.Execute() @@ -473,6 +513,7 @@ type CreateKubeconfigRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string clusterName string createKubeconfigPayload *CreateKubeconfigPayload } @@ -499,8 +540,9 @@ func (r CreateKubeconfigRequest) Execute() (*Kubeconfig, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/kubeconfig" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -1) localVarHeaderParams := make(map[string]string) @@ -561,6 +603,28 @@ func (r CreateKubeconfigRequest) Execute() (*Kubeconfig, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } var v RuntimeError err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -592,23 +656,26 @@ Create a new kubeconfig for the cluster. You can specify the expiration (in seco @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiCreateKubeconfigRequest */ -func (a *APIClient) CreateKubeconfig(ctx context.Context, projectId string, clusterName string) ApiCreateKubeconfigRequest { +func (a *APIClient) CreateKubeconfig(ctx context.Context, projectId string, region string, clusterName string) ApiCreateKubeconfigRequest { return CreateKubeconfigRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } } -func (a *APIClient) CreateKubeconfigExecute(ctx context.Context, projectId string, clusterName string) (*Kubeconfig, error) { +func (a *APIClient) CreateKubeconfigExecute(ctx context.Context, projectId string, region string, clusterName string) (*Kubeconfig, error) { r := CreateKubeconfigRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } return r.Execute() @@ -618,6 +685,7 @@ type CreateOrUpdateClusterRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string clusterName string createOrUpdateClusterPayload *CreateOrUpdateClusterPayload } @@ -644,8 +712,9 @@ func (r CreateOrUpdateClusterRequest) Execute() (*Cluster, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -1) localVarHeaderParams := make(map[string]string) @@ -717,6 +786,17 @@ func (r CreateOrUpdateClusterRequest) Execute() (*Cluster, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v map[string]interface{} err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -759,23 +839,26 @@ Create a new cluster in your project or modify an existing one. To get valid val @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiCreateOrUpdateClusterRequest */ -func (a *APIClient) CreateOrUpdateCluster(ctx context.Context, projectId string, clusterName string) ApiCreateOrUpdateClusterRequest { +func (a *APIClient) CreateOrUpdateCluster(ctx context.Context, projectId string, region string, clusterName string) ApiCreateOrUpdateClusterRequest { return CreateOrUpdateClusterRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } } -func (a *APIClient) CreateOrUpdateClusterExecute(ctx context.Context, projectId string, clusterName string) (*Cluster, error) { +func (a *APIClient) CreateOrUpdateClusterExecute(ctx context.Context, projectId string, region string, clusterName string) (*Cluster, error) { r := CreateOrUpdateClusterRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } return r.Execute() @@ -785,6 +868,7 @@ type DeleteClusterRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string clusterName string } @@ -805,8 +889,9 @@ func (r DeleteClusterRequest) Execute() (map[string]interface{}, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -1) localVarHeaderParams := make(map[string]string) @@ -862,6 +947,28 @@ func (r DeleteClusterRequest) Execute() (map[string]interface{}, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } var v RuntimeError err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -893,23 +1000,26 @@ Delete Kubernetes cluster specified by the identifier, belonging to the project @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiDeleteClusterRequest */ -func (a *APIClient) DeleteCluster(ctx context.Context, projectId string, clusterName string) ApiDeleteClusterRequest { +func (a *APIClient) DeleteCluster(ctx context.Context, projectId string, region string, clusterName string) ApiDeleteClusterRequest { return DeleteClusterRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } } -func (a *APIClient) DeleteClusterExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) { +func (a *APIClient) DeleteClusterExecute(ctx context.Context, projectId string, region string, clusterName string) (map[string]interface{}, error) { r := DeleteClusterRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } return r.Execute() @@ -919,6 +1029,7 @@ type GetClusterRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string clusterName string } @@ -939,8 +1050,9 @@ func (r GetClusterRequest) Execute() (*Cluster, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -1) localVarHeaderParams := make(map[string]string) @@ -996,6 +1108,28 @@ func (r GetClusterRequest) Execute() (*Cluster, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } var v RuntimeError err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1027,23 +1161,26 @@ Get Kubernetes cluster for the specified identifier, belonging to the project sp @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiGetClusterRequest */ -func (a *APIClient) GetCluster(ctx context.Context, projectId string, clusterName string) ApiGetClusterRequest { +func (a *APIClient) GetCluster(ctx context.Context, projectId string, region string, clusterName string) ApiGetClusterRequest { return GetClusterRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } } -func (a *APIClient) GetClusterExecute(ctx context.Context, projectId string, clusterName string) (*Cluster, error) { +func (a *APIClient) GetClusterExecute(ctx context.Context, projectId string, region string, clusterName string) (*Cluster, error) { r := GetClusterRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } return r.Execute() @@ -1053,6 +1190,7 @@ type GetLoginKubeconfigRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string clusterName string } @@ -1073,8 +1211,9 @@ func (r GetLoginKubeconfigRequest) Execute() (*LoginKubeconfig, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig/login" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/kubeconfig/login" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -1) localVarHeaderParams := make(map[string]string) @@ -1130,6 +1269,28 @@ func (r GetLoginKubeconfigRequest) Execute() (*LoginKubeconfig, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } var v RuntimeError err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1161,23 +1322,26 @@ A kubeconfig retrieved using this endpoint does not contain any credentials and @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiGetLoginKubeconfigRequest */ -func (a *APIClient) GetLoginKubeconfig(ctx context.Context, projectId string, clusterName string) ApiGetLoginKubeconfigRequest { +func (a *APIClient) GetLoginKubeconfig(ctx context.Context, projectId string, region string, clusterName string) ApiGetLoginKubeconfigRequest { return GetLoginKubeconfigRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } } -func (a *APIClient) GetLoginKubeconfigExecute(ctx context.Context, projectId string, clusterName string) (*LoginKubeconfig, error) { +func (a *APIClient) GetLoginKubeconfigExecute(ctx context.Context, projectId string, region string, clusterName string) (*LoginKubeconfig, error) { r := GetLoginKubeconfigRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } return r.Execute() @@ -1187,6 +1351,7 @@ type ListClustersRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string } func (r ListClustersRequest) Execute() (*ListClustersResponse, error) { @@ -1206,8 +1371,9 @@ func (r ListClustersRequest) Execute() (*ListClustersResponse, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/clusters" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1273,6 +1439,17 @@ func (r ListClustersRequest) Execute() (*ListClustersResponse, error) { newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v map[string]interface{} err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1315,21 +1492,24 @@ Return a list of Kubernetes clusters in the project specified by `projectId`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @return ApiListClustersRequest */ -func (a *APIClient) ListClusters(ctx context.Context, projectId string) ApiListClustersRequest { +func (a *APIClient) ListClusters(ctx context.Context, projectId string, region string) ApiListClustersRequest { return ListClustersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } } -func (a *APIClient) ListClustersExecute(ctx context.Context, projectId string) (*ListClustersResponse, error) { +func (a *APIClient) ListClustersExecute(ctx context.Context, projectId string, region string) (*ListClustersResponse, error) { r := ListClustersRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, } return r.Execute() } @@ -1337,6 +1517,7 @@ func (a *APIClient) ListClustersExecute(ctx context.Context, projectId string) ( type ListProviderOptionsRequest struct { ctx context.Context apiService *DefaultApiService + region string } func (r ListProviderOptionsRequest) Execute() (*ProviderOptions, error) { @@ -1356,7 +1537,8 @@ func (r ListProviderOptionsRequest) Execute() (*ProviderOptions, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/provider-options" + localVarPath := localBasePath + "/v2/regions/{region}/provider-options" + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1411,6 +1593,28 @@ func (r ListProviderOptionsRequest) Execute() (*ProviderOptions, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } var v RuntimeError err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1441,19 +1645,22 @@ ListProviderOptions: List provider options Returns a list of supported Kubernetes versions and a list of supported machine types for the cluster nodes. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region @return ApiListProviderOptionsRequest */ -func (a *APIClient) ListProviderOptions(ctx context.Context) ApiListProviderOptionsRequest { +func (a *APIClient) ListProviderOptions(ctx context.Context, region string) ApiListProviderOptionsRequest { return ListProviderOptionsRequest{ apiService: a.defaultApi, ctx: ctx, + region: region, } } -func (a *APIClient) ListProviderOptionsExecute(ctx context.Context) (*ProviderOptions, error) { +func (a *APIClient) ListProviderOptionsExecute(ctx context.Context, region string) (*ProviderOptions, error) { r := ListProviderOptionsRequest{ apiService: a.defaultApi, ctx: ctx, + region: region, } return r.Execute() } @@ -1462,6 +1669,7 @@ type StartCredentialsRotationRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string clusterName string } @@ -1482,8 +1690,9 @@ func (r StartCredentialsRotationRequest) Execute() (map[string]interface{}, erro return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/start-credentials-rotation" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/start-credentials-rotation" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -1) localVarHeaderParams := make(map[string]string) @@ -1550,6 +1759,17 @@ func (r StartCredentialsRotationRequest) Execute() (map[string]interface{}, erro newErr.Model = v return localVarReturnValue, newErr } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v map[string]interface{} err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1592,23 +1812,26 @@ Start cluster credentials rotation. This is step 1 of a two-step process. Comple @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiStartCredentialsRotationRequest */ -func (a *APIClient) StartCredentialsRotation(ctx context.Context, projectId string, clusterName string) ApiStartCredentialsRotationRequest { +func (a *APIClient) StartCredentialsRotation(ctx context.Context, projectId string, region string, clusterName string) ApiStartCredentialsRotationRequest { return StartCredentialsRotationRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } } -func (a *APIClient) StartCredentialsRotationExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) { +func (a *APIClient) StartCredentialsRotationExecute(ctx context.Context, projectId string, region string, clusterName string) (map[string]interface{}, error) { r := StartCredentialsRotationRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } return r.Execute() @@ -1618,6 +1841,7 @@ type TriggerHibernateRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string clusterName string } @@ -1638,8 +1862,9 @@ func (r TriggerHibernateRequest) Execute() (map[string]interface{}, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/hibernate" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/hibernate" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -1) localVarHeaderParams := make(map[string]string) @@ -1695,6 +1920,28 @@ func (r TriggerHibernateRequest) Execute() (map[string]interface{}, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v map[string]interface{} err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1737,23 +1984,26 @@ Trigger immediate hibernation of the cluster. If the cluster is already in hiber @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiTriggerHibernateRequest */ -func (a *APIClient) TriggerHibernate(ctx context.Context, projectId string, clusterName string) ApiTriggerHibernateRequest { +func (a *APIClient) TriggerHibernate(ctx context.Context, projectId string, region string, clusterName string) ApiTriggerHibernateRequest { return TriggerHibernateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } } -func (a *APIClient) TriggerHibernateExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) { +func (a *APIClient) TriggerHibernateExecute(ctx context.Context, projectId string, region string, clusterName string) (map[string]interface{}, error) { r := TriggerHibernateRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } return r.Execute() @@ -1763,6 +2013,7 @@ type TriggerMaintenanceRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string clusterName string } @@ -1783,8 +2034,9 @@ func (r TriggerMaintenanceRequest) Execute() (map[string]interface{}, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/maintenance" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/maintenance" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -1) localVarHeaderParams := make(map[string]string) @@ -1840,6 +2092,28 @@ func (r TriggerMaintenanceRequest) Execute() (map[string]interface{}, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v map[string]interface{} err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1882,23 +2156,26 @@ Trigger immediate maintenance of the cluster. The autoUpdate configuration speci @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiTriggerMaintenanceRequest */ -func (a *APIClient) TriggerMaintenance(ctx context.Context, projectId string, clusterName string) ApiTriggerMaintenanceRequest { +func (a *APIClient) TriggerMaintenance(ctx context.Context, projectId string, region string, clusterName string) ApiTriggerMaintenanceRequest { return TriggerMaintenanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } } -func (a *APIClient) TriggerMaintenanceExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) { +func (a *APIClient) TriggerMaintenanceExecute(ctx context.Context, projectId string, region string, clusterName string) (map[string]interface{}, error) { r := TriggerMaintenanceRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } return r.Execute() @@ -1908,6 +2185,7 @@ type TriggerReconcileRequest struct { ctx context.Context apiService *DefaultApiService projectId string + region string clusterName string } @@ -1928,8 +2206,9 @@ func (r TriggerReconcileRequest) Execute() (map[string]interface{}, error) { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/clusters/{clusterName}/reconcile" + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/reconcile" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(r.clusterName, "clusterName")), -1) localVarHeaderParams := make(map[string]string) @@ -1985,6 +2264,28 @@ func (r TriggerReconcileRequest) Execute() (map[string]interface{}, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v map[string]interface{} + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } if localVarHTTPResponse.StatusCode == 404 { var v map[string]interface{} err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2027,23 +2328,26 @@ Trigger immediate reconciliation of the complete cluster without changing the cl @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId + @param region @param clusterName @return ApiTriggerReconcileRequest */ -func (a *APIClient) TriggerReconcile(ctx context.Context, projectId string, clusterName string) ApiTriggerReconcileRequest { +func (a *APIClient) TriggerReconcile(ctx context.Context, projectId string, region string, clusterName string) ApiTriggerReconcileRequest { return TriggerReconcileRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } } -func (a *APIClient) TriggerReconcileExecute(ctx context.Context, projectId string, clusterName string) (map[string]interface{}, error) { +func (a *APIClient) TriggerReconcileExecute(ctx context.Context, projectId string, region string, clusterName string) (map[string]interface{}, error) { r := TriggerReconcileRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + region: region, clusterName: clusterName, } return r.Execute() diff --git a/services/ske/api_default_test.go b/services/ske/api_default_test.go index 14f37d2f0..cf52e5b88 100644 --- a/services/ske/api_default_test.go +++ b/services/ske/api_default_test.go @@ -24,9 +24,11 @@ import ( func Test_ske_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService CompleteCredentialsRotation", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/complete-credentials-rotation" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/complete-credentials-rotation" projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) clusterNameValue := "clusterName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) @@ -66,9 +68,10 @@ func Test_ske_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue clusterName := clusterNameValue - resp, reqErr := apiClient.CompleteCredentialsRotation(context.Background(), projectId, clusterName).Execute() + resp, reqErr := apiClient.CompleteCredentialsRotation(context.Background(), projectId, region, clusterName).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -79,9 +82,11 @@ func Test_ske_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateKubeconfig", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/kubeconfig" projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) clusterNameValue := "clusterName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) @@ -121,10 +126,11 @@ func Test_ske_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue clusterName := clusterNameValue createKubeconfigPayload := CreateKubeconfigPayload{} - resp, reqErr := apiClient.CreateKubeconfig(context.Background(), projectId, clusterName).CreateKubeconfigPayload(createKubeconfigPayload).Execute() + resp, reqErr := apiClient.CreateKubeconfig(context.Background(), projectId, region, clusterName).CreateKubeconfigPayload(createKubeconfigPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -135,9 +141,11 @@ func Test_ske_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService CreateOrUpdateCluster", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}" projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) clusterNameValue := "clusterName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) @@ -177,10 +185,11 @@ func Test_ske_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue clusterName := clusterNameValue createOrUpdateClusterPayload := CreateOrUpdateClusterPayload{} - resp, reqErr := apiClient.CreateOrUpdateCluster(context.Background(), projectId, clusterName).CreateOrUpdateClusterPayload(createOrUpdateClusterPayload).Execute() + resp, reqErr := apiClient.CreateOrUpdateCluster(context.Background(), projectId, region, clusterName).CreateOrUpdateClusterPayload(createOrUpdateClusterPayload).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -191,9 +200,11 @@ func Test_ske_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteCluster", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}" projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) clusterNameValue := "clusterName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) @@ -233,9 +244,10 @@ func Test_ske_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue clusterName := clusterNameValue - resp, reqErr := apiClient.DeleteCluster(context.Background(), projectId, clusterName).Execute() + resp, reqErr := apiClient.DeleteCluster(context.Background(), projectId, region, clusterName).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -246,9 +258,11 @@ func Test_ske_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetCluster", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}" projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) clusterNameValue := "clusterName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) @@ -288,9 +302,10 @@ func Test_ske_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue clusterName := clusterNameValue - resp, reqErr := apiClient.GetCluster(context.Background(), projectId, clusterName).Execute() + resp, reqErr := apiClient.GetCluster(context.Background(), projectId, region, clusterName).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -301,9 +316,11 @@ func Test_ske_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetLoginKubeconfig", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig/login" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/kubeconfig/login" projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) clusterNameValue := "clusterName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) @@ -343,9 +360,10 @@ func Test_ske_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue clusterName := clusterNameValue - resp, reqErr := apiClient.GetLoginKubeconfig(context.Background(), projectId, clusterName).Execute() + resp, reqErr := apiClient.GetLoginKubeconfig(context.Background(), projectId, region, clusterName).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -356,9 +374,11 @@ func Test_ske_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListClusters", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/clusters" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/clusters" projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -396,8 +416,9 @@ func Test_ske_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue - resp, reqErr := apiClient.ListClusters(context.Background(), projectId).Execute() + resp, reqErr := apiClient.ListClusters(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -408,7 +429,9 @@ func Test_ske_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ListProviderOptions", func(t *testing.T) { - _apiUrlPath := "/v1/provider-options" + _apiUrlPath := "/v2/regions/{region}/provider-options" + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { @@ -445,7 +468,9 @@ func Test_ske_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - resp, reqErr := apiClient.ListProviderOptions(context.Background()).Execute() + region := regionValue + + resp, reqErr := apiClient.ListProviderOptions(context.Background(), region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -456,9 +481,11 @@ func Test_ske_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService StartCredentialsRotation", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/start-credentials-rotation" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/start-credentials-rotation" projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) clusterNameValue := "clusterName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) @@ -498,9 +525,10 @@ func Test_ske_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue clusterName := clusterNameValue - resp, reqErr := apiClient.StartCredentialsRotation(context.Background(), projectId, clusterName).Execute() + resp, reqErr := apiClient.StartCredentialsRotation(context.Background(), projectId, region, clusterName).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -511,9 +539,11 @@ func Test_ske_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService TriggerHibernate", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/hibernate" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/hibernate" projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) clusterNameValue := "clusterName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) @@ -553,9 +583,10 @@ func Test_ske_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue clusterName := clusterNameValue - resp, reqErr := apiClient.TriggerHibernate(context.Background(), projectId, clusterName).Execute() + resp, reqErr := apiClient.TriggerHibernate(context.Background(), projectId, region, clusterName).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -566,9 +597,11 @@ func Test_ske_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService TriggerMaintenance", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/maintenance" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/maintenance" projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) clusterNameValue := "clusterName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) @@ -608,9 +641,10 @@ func Test_ske_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue clusterName := clusterNameValue - resp, reqErr := apiClient.TriggerMaintenance(context.Background(), projectId, clusterName).Execute() + resp, reqErr := apiClient.TriggerMaintenance(context.Background(), projectId, region, clusterName).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) @@ -621,9 +655,11 @@ func Test_ske_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService TriggerReconcile", func(t *testing.T) { - _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/reconcile" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/reconcile" projectIdValue := "projectId-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + regionValue := "region-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) clusterNameValue := "clusterName-value" _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) @@ -663,9 +699,10 @@ func Test_ske_DefaultApiService(t *testing.T) { } projectId := projectIdValue + region := regionValue clusterName := clusterNameValue - resp, reqErr := apiClient.TriggerReconcile(context.Background(), projectId, clusterName).Execute() + resp, reqErr := apiClient.TriggerReconcile(context.Background(), projectId, region, clusterName).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) diff --git a/services/ske/client.go b/services/ske/client.go index 58da36ba6..6be216902 100644 --- a/services/ske/client.go +++ b/services/ske/client.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the SKE-API API v1.1 +// APIClient manages communication with the SKE-API API v2.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *config.Configuration diff --git a/services/ske/configuration.go b/services/ske/configuration.go index 94778ada1..9a5cfb762 100644 --- a/services/ske/configuration.go +++ b/services/ske/configuration.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,15 +22,12 @@ func NewConfiguration() *config.Configuration { Debug: false, Servers: config.ServerConfigurations{ { - URL: "https://ske.api.{region}stackit.cloud", + URL: "https://ske.api.stackit.cloud", Description: "No description provided", Variables: map[string]config.ServerVariable{ "region": { Description: "No description provided", - DefaultValue: "eu01.", - EnumValues: []string{ - "eu01.", - }, + DefaultValue: "global", }, }, }, diff --git a/services/ske/model_acl.go b/services/ske/model_acl.go index e12f9084c..2a2799bf0 100644 --- a/services/ske/model_acl.go +++ b/services/ske/model_acl.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_acl_test.go b/services/ske/model_acl_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_acl_test.go +++ b/services/ske/model_acl_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_argus.go b/services/ske/model_argus.go deleted file mode 100644 index 375bd71a1..000000000 --- a/services/ske/model_argus.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -SKE-API - -The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - -API version: 1.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package ske - -import ( - "encoding/json" -) - -// checks if the Argus type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Argus{} - -/* - types and functions for argusInstanceId -*/ - -// isNotNullableString -type ArgusGetArgusInstanceIdAttributeType = *string - -func getArgusGetArgusInstanceIdAttributeTypeOk(arg ArgusGetArgusInstanceIdAttributeType) (ret ArgusGetArgusInstanceIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setArgusGetArgusInstanceIdAttributeType(arg *ArgusGetArgusInstanceIdAttributeType, val ArgusGetArgusInstanceIdRetType) { - *arg = &val -} - -type ArgusGetArgusInstanceIdArgType = string -type ArgusGetArgusInstanceIdRetType = string - -/* - types and functions for enabled -*/ - -// isBoolean -type ArgusgetEnabledAttributeType = *bool -type ArgusgetEnabledArgType = bool -type ArgusgetEnabledRetType = bool - -func getArgusgetEnabledAttributeTypeOk(arg ArgusgetEnabledAttributeType) (ret ArgusgetEnabledRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setArgusgetEnabledAttributeType(arg *ArgusgetEnabledAttributeType, val ArgusgetEnabledRetType) { - *arg = &val -} - -// Argus struct for Argus -type Argus struct { - // Argus instance ID to choose which Argus instance is used. - // REQUIRED - ArgusInstanceId ArgusGetArgusInstanceIdAttributeType `json:"argusInstanceId" required:"true"` - // Enables the argus extension. - // REQUIRED - Enabled ArgusgetEnabledAttributeType `json:"enabled" required:"true"` -} - -type _Argus Argus - -// NewArgus instantiates a new Argus 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 NewArgus(argusInstanceId ArgusGetArgusInstanceIdArgType, enabled ArgusgetEnabledArgType) *Argus { - this := Argus{} - setArgusGetArgusInstanceIdAttributeType(&this.ArgusInstanceId, argusInstanceId) - setArgusgetEnabledAttributeType(&this.Enabled, enabled) - return &this -} - -// NewArgusWithDefaults instantiates a new Argus 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 NewArgusWithDefaults() *Argus { - this := Argus{} - return &this -} - -// GetArgusInstanceId returns the ArgusInstanceId field value -func (o *Argus) GetArgusInstanceId() (ret ArgusGetArgusInstanceIdRetType) { - ret, _ = o.GetArgusInstanceIdOk() - return ret -} - -// GetArgusInstanceIdOk returns a tuple with the ArgusInstanceId field value -// and a boolean to check if the value has been set. -func (o *Argus) GetArgusInstanceIdOk() (ret ArgusGetArgusInstanceIdRetType, ok bool) { - return getArgusGetArgusInstanceIdAttributeTypeOk(o.ArgusInstanceId) -} - -// SetArgusInstanceId sets field value -func (o *Argus) SetArgusInstanceId(v ArgusGetArgusInstanceIdRetType) { - setArgusGetArgusInstanceIdAttributeType(&o.ArgusInstanceId, v) -} - -// GetEnabled returns the Enabled field value -func (o *Argus) GetEnabled() (ret ArgusgetEnabledRetType) { - ret, _ = o.GetEnabledOk() - return ret -} - -// GetEnabledOk returns a tuple with the Enabled field value -// and a boolean to check if the value has been set. -func (o *Argus) GetEnabledOk() (ret ArgusgetEnabledRetType, ok bool) { - return getArgusgetEnabledAttributeTypeOk(o.Enabled) -} - -// SetEnabled sets field value -func (o *Argus) SetEnabled(v ArgusgetEnabledRetType) { - setArgusgetEnabledAttributeType(&o.Enabled, v) -} - -func (o Argus) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getArgusGetArgusInstanceIdAttributeTypeOk(o.ArgusInstanceId); ok { - toSerialize["ArgusInstanceId"] = val - } - if val, ok := getArgusgetEnabledAttributeTypeOk(o.Enabled); ok { - toSerialize["Enabled"] = val - } - return toSerialize, nil -} - -type NullableArgus struct { - value *Argus - isSet bool -} - -func (v NullableArgus) Get() *Argus { - return v.value -} - -func (v *NullableArgus) Set(val *Argus) { - v.value = val - v.isSet = true -} - -func (v NullableArgus) IsSet() bool { - return v.isSet -} - -func (v *NullableArgus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableArgus(val *Argus) *NullableArgus { - return &NullableArgus{value: val, isSet: true} -} - -func (v NullableArgus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableArgus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/ske/model_availability_zone.go b/services/ske/model_availability_zone.go index c8e974479..5afb8c704 100644 --- a/services/ske/model_availability_zone.go +++ b/services/ske/model_availability_zone.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_availability_zone_test.go b/services/ske/model_availability_zone_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_availability_zone_test.go +++ b/services/ske/model_availability_zone_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_cluster.go b/services/ske/model_cluster.go index 348d161d6..cb3365db1 100644 --- a/services/ske/model_cluster.go +++ b/services/ske/model_cluster.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_cluster_error.go b/services/ske/model_cluster_error.go index 78ab0f910..fe861e6c6 100644 --- a/services/ske/model_cluster_error.go +++ b/services/ske/model_cluster_error.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_cluster_error_test.go b/services/ske/model_cluster_error_test.go index 1463b485c..c3b673432 100644 --- a/services/ske/model_cluster_error_test.go +++ b/services/ske/model_cluster_error_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_cluster_status.go b/services/ske/model_cluster_status.go index ca5e4f513..259ab6cc1 100644 --- a/services/ske/model_cluster_status.go +++ b/services/ske/model_cluster_status.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_cluster_status_state.go b/services/ske/model_cluster_status_state.go index 6ece4dfef..e9fe6c353 100644 --- a/services/ske/model_cluster_status_state.go +++ b/services/ske/model_cluster_status_state.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_cluster_status_state_test.go b/services/ske/model_cluster_status_state_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_cluster_status_state_test.go +++ b/services/ske/model_cluster_status_state_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_cluster_status_test.go b/services/ske/model_cluster_status_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_cluster_status_test.go +++ b/services/ske/model_cluster_status_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_cluster_test.go b/services/ske/model_cluster_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_cluster_test.go +++ b/services/ske/model_cluster_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_create_kubeconfig_payload.go b/services/ske/model_create_kubeconfig_payload.go index 2a7db83bb..a2c265093 100644 --- a/services/ske/model_create_kubeconfig_payload.go +++ b/services/ske/model_create_kubeconfig_payload.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_create_kubeconfig_payload_test.go b/services/ske/model_create_kubeconfig_payload_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_create_kubeconfig_payload_test.go +++ b/services/ske/model_create_kubeconfig_payload_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_create_or_update_cluster_payload.go b/services/ske/model_create_or_update_cluster_payload.go index 65ba4eaeb..e156c49ff 100644 --- a/services/ske/model_create_or_update_cluster_payload.go +++ b/services/ske/model_create_or_update_cluster_payload.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_create_or_update_cluster_payload_test.go b/services/ske/model_create_or_update_cluster_payload_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_create_or_update_cluster_payload_test.go +++ b/services/ske/model_create_or_update_cluster_payload_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_credentials_rotation_state.go b/services/ske/model_credentials_rotation_state.go index b7646e51e..18bbe6423 100644 --- a/services/ske/model_credentials_rotation_state.go +++ b/services/ske/model_credentials_rotation_state.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -65,7 +65,7 @@ func setCredentialsRotationStateGetLastInitiationTimeAttributeType(arg *Credenti // isEnum -// CredentialsRotationStatePhase Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. +// CredentialsRotationStatePhase Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. Using the deprecated [rotate-credentials](#tag/Credentials/operation/SkeService_GetClusterCredentials) endpoint will not update this status field. // value type for enums type CredentialsRotationStatePhase string @@ -195,7 +195,7 @@ type CredentialsRotationState struct { LastCompletionTime CredentialsRotationStateGetLastCompletionTimeAttributeType `json:"lastCompletionTime,omitempty"` // Format: `2024-02-15T11:06:29Z` LastInitiationTime CredentialsRotationStateGetLastInitiationTimeAttributeType `json:"lastInitiationTime,omitempty"` - // Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. + // Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. Using the deprecated [rotate-credentials](#tag/Credentials/operation/SkeService_GetClusterCredentials) endpoint will not update this status field. Phase CredentialsRotationStateGetPhaseAttributeType `json:"phase,omitempty"` } diff --git a/services/ske/model_credentials_rotation_state_test.go b/services/ske/model_credentials_rotation_state_test.go index 894354db4..ea3c7dabc 100644 --- a/services/ske/model_credentials_rotation_state_test.go +++ b/services/ske/model_credentials_rotation_state_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_cri.go b/services/ske/model_cri.go index e80c6d1f9..03001b58b 100644 --- a/services/ske/model_cri.go +++ b/services/ske/model_cri.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_cri_test.go b/services/ske/model_cri_test.go index 64bb71697..6a7d31524 100644 --- a/services/ske/model_cri_test.go +++ b/services/ske/model_cri_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_dns.go b/services/ske/model_dns.go index 2e790634a..82510ff9d 100644 --- a/services/ske/model_dns.go +++ b/services/ske/model_dns.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_dns_test.go b/services/ske/model_dns_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_dns_test.go +++ b/services/ske/model_dns_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_extension.go b/services/ske/model_extension.go index fe67e8cda..d8c9f1566 100644 --- a/services/ske/model_extension.go +++ b/services/ske/model_extension.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -38,50 +38,50 @@ func setExtensionGetAclAttributeType(arg *ExtensionGetAclAttributeType, val Exte } /* - types and functions for argus + types and functions for dns */ // isModel -type ExtensionGetArgusAttributeType = *Argus -type ExtensionGetArgusArgType = Argus -type ExtensionGetArgusRetType = Argus +type ExtensionGetDnsAttributeType = *DNS +type ExtensionGetDnsArgType = DNS +type ExtensionGetDnsRetType = DNS -func getExtensionGetArgusAttributeTypeOk(arg ExtensionGetArgusAttributeType) (ret ExtensionGetArgusRetType, ok bool) { +func getExtensionGetDnsAttributeTypeOk(arg ExtensionGetDnsAttributeType) (ret ExtensionGetDnsRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setExtensionGetArgusAttributeType(arg *ExtensionGetArgusAttributeType, val ExtensionGetArgusRetType) { +func setExtensionGetDnsAttributeType(arg *ExtensionGetDnsAttributeType, val ExtensionGetDnsRetType) { *arg = &val } /* - types and functions for dns + types and functions for observability */ // isModel -type ExtensionGetDnsAttributeType = *DNS -type ExtensionGetDnsArgType = DNS -type ExtensionGetDnsRetType = DNS +type ExtensionGetObservabilityAttributeType = *Observability +type ExtensionGetObservabilityArgType = Observability +type ExtensionGetObservabilityRetType = Observability -func getExtensionGetDnsAttributeTypeOk(arg ExtensionGetDnsAttributeType) (ret ExtensionGetDnsRetType, ok bool) { +func getExtensionGetObservabilityAttributeTypeOk(arg ExtensionGetObservabilityAttributeType) (ret ExtensionGetObservabilityRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } -func setExtensionGetDnsAttributeType(arg *ExtensionGetDnsAttributeType, val ExtensionGetDnsRetType) { +func setExtensionGetObservabilityAttributeType(arg *ExtensionGetObservabilityAttributeType, val ExtensionGetObservabilityRetType) { *arg = &val } // Extension struct for Extension type Extension struct { - Acl ExtensionGetAclAttributeType `json:"acl,omitempty"` - Argus ExtensionGetArgusAttributeType `json:"argus,omitempty"` - Dns ExtensionGetDnsAttributeType `json:"dns,omitempty"` + Acl ExtensionGetAclAttributeType `json:"acl,omitempty"` + Dns ExtensionGetDnsAttributeType `json:"dns,omitempty"` + Observability ExtensionGetObservabilityAttributeType `json:"observability,omitempty"` } // NewExtension instantiates a new Extension object @@ -124,29 +124,6 @@ func (o *Extension) SetAcl(v ExtensionGetAclRetType) { setExtensionGetAclAttributeType(&o.Acl, v) } -// GetArgus returns the Argus field value if set, zero value otherwise. -func (o *Extension) GetArgus() (res ExtensionGetArgusRetType) { - res, _ = o.GetArgusOk() - return -} - -// GetArgusOk returns a tuple with the Argus field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Extension) GetArgusOk() (ret ExtensionGetArgusRetType, ok bool) { - return getExtensionGetArgusAttributeTypeOk(o.Argus) -} - -// HasArgus returns a boolean if a field has been set. -func (o *Extension) HasArgus() bool { - _, ok := o.GetArgusOk() - return ok -} - -// SetArgus gets a reference to the given Argus and assigns it to the Argus field. -func (o *Extension) SetArgus(v ExtensionGetArgusRetType) { - setExtensionGetArgusAttributeType(&o.Argus, v) -} - // GetDns returns the Dns field value if set, zero value otherwise. func (o *Extension) GetDns() (res ExtensionGetDnsRetType) { res, _ = o.GetDnsOk() @@ -170,17 +147,40 @@ func (o *Extension) SetDns(v ExtensionGetDnsRetType) { setExtensionGetDnsAttributeType(&o.Dns, v) } +// GetObservability returns the Observability field value if set, zero value otherwise. +func (o *Extension) GetObservability() (res ExtensionGetObservabilityRetType) { + res, _ = o.GetObservabilityOk() + return +} + +// GetObservabilityOk returns a tuple with the Observability field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Extension) GetObservabilityOk() (ret ExtensionGetObservabilityRetType, ok bool) { + return getExtensionGetObservabilityAttributeTypeOk(o.Observability) +} + +// HasObservability returns a boolean if a field has been set. +func (o *Extension) HasObservability() bool { + _, ok := o.GetObservabilityOk() + return ok +} + +// SetObservability gets a reference to the given Observability and assigns it to the Observability field. +func (o *Extension) SetObservability(v ExtensionGetObservabilityRetType) { + setExtensionGetObservabilityAttributeType(&o.Observability, v) +} + func (o Extension) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getExtensionGetAclAttributeTypeOk(o.Acl); ok { toSerialize["Acl"] = val } - if val, ok := getExtensionGetArgusAttributeTypeOk(o.Argus); ok { - toSerialize["Argus"] = val - } if val, ok := getExtensionGetDnsAttributeTypeOk(o.Dns); ok { toSerialize["Dns"] = val } + if val, ok := getExtensionGetObservabilityAttributeTypeOk(o.Observability); ok { + toSerialize["Observability"] = val + } return toSerialize, nil } diff --git a/services/ske/model_extension_test.go b/services/ske/model_extension_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_extension_test.go +++ b/services/ske/model_extension_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_hibernation.go b/services/ske/model_hibernation.go index 1b9510a6f..25bcebbe9 100644 --- a/services/ske/model_hibernation.go +++ b/services/ske/model_hibernation.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_hibernation_schedule.go b/services/ske/model_hibernation_schedule.go index 54f5df283..4d3b7ba3b 100644 --- a/services/ske/model_hibernation_schedule.go +++ b/services/ske/model_hibernation_schedule.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_hibernation_schedule_test.go b/services/ske/model_hibernation_schedule_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_hibernation_schedule_test.go +++ b/services/ske/model_hibernation_schedule_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_hibernation_test.go b/services/ske/model_hibernation_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_hibernation_test.go +++ b/services/ske/model_hibernation_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_image.go b/services/ske/model_image.go index 343739cb5..3aa065d36 100644 --- a/services/ske/model_image.go +++ b/services/ske/model_image.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_image_test.go b/services/ske/model_image_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_image_test.go +++ b/services/ske/model_image_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_kubeconfig.go b/services/ske/model_kubeconfig.go index 6ed0c68d1..059413e1b 100644 --- a/services/ske/model_kubeconfig.go +++ b/services/ske/model_kubeconfig.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_kubeconfig_test.go b/services/ske/model_kubeconfig_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_kubeconfig_test.go +++ b/services/ske/model_kubeconfig_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_kubernetes.go b/services/ske/model_kubernetes.go index 2b86b5389..e950c3866 100644 --- a/services/ske/model_kubernetes.go +++ b/services/ske/model_kubernetes.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,26 +17,6 @@ import ( // checks if the Kubernetes type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Kubernetes{} -/* - types and functions for allowPrivilegedContainers -*/ - -// isBoolean -type KubernetesgetAllowPrivilegedContainersAttributeType = *bool -type KubernetesgetAllowPrivilegedContainersArgType = bool -type KubernetesgetAllowPrivilegedContainersRetType = bool - -func getKubernetesgetAllowPrivilegedContainersAttributeTypeOk(arg KubernetesgetAllowPrivilegedContainersAttributeType) (ret KubernetesgetAllowPrivilegedContainersRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setKubernetesgetAllowPrivilegedContainersAttributeType(arg *KubernetesgetAllowPrivilegedContainersAttributeType, val KubernetesgetAllowPrivilegedContainersRetType) { - *arg = &val -} - /* types and functions for version */ @@ -60,8 +40,6 @@ type KubernetesGetVersionRetType = string // Kubernetes For valid versions please take a look at [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) `kubernetesVersions`. type Kubernetes struct { - // DEPRECATED as of Kubernetes 1.25+ Flag to specify if privileged mode for containers is enabled or not. This should be used with care since it also disables a couple of other features like the use of some volume type (e.g. PVCs). By default this is set to true. - AllowPrivilegedContainers KubernetesgetAllowPrivilegedContainersAttributeType `json:"allowPrivilegedContainers,omitempty"` // REQUIRED Version KubernetesGetVersionAttributeType `json:"version" required:"true"` } @@ -86,29 +64,6 @@ func NewKubernetesWithDefaults() *Kubernetes { return &this } -// GetAllowPrivilegedContainers returns the AllowPrivilegedContainers field value if set, zero value otherwise. -func (o *Kubernetes) GetAllowPrivilegedContainers() (res KubernetesgetAllowPrivilegedContainersRetType) { - res, _ = o.GetAllowPrivilegedContainersOk() - return -} - -// GetAllowPrivilegedContainersOk returns a tuple with the AllowPrivilegedContainers field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Kubernetes) GetAllowPrivilegedContainersOk() (ret KubernetesgetAllowPrivilegedContainersRetType, ok bool) { - return getKubernetesgetAllowPrivilegedContainersAttributeTypeOk(o.AllowPrivilegedContainers) -} - -// HasAllowPrivilegedContainers returns a boolean if a field has been set. -func (o *Kubernetes) HasAllowPrivilegedContainers() bool { - _, ok := o.GetAllowPrivilegedContainersOk() - return ok -} - -// SetAllowPrivilegedContainers gets a reference to the given bool and assigns it to the AllowPrivilegedContainers field. -func (o *Kubernetes) SetAllowPrivilegedContainers(v KubernetesgetAllowPrivilegedContainersRetType) { - setKubernetesgetAllowPrivilegedContainersAttributeType(&o.AllowPrivilegedContainers, v) -} - // GetVersion returns the Version field value func (o *Kubernetes) GetVersion() (ret KubernetesGetVersionRetType) { ret, _ = o.GetVersionOk() @@ -128,9 +83,6 @@ func (o *Kubernetes) SetVersion(v KubernetesGetVersionRetType) { func (o Kubernetes) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if val, ok := getKubernetesgetAllowPrivilegedContainersAttributeTypeOk(o.AllowPrivilegedContainers); ok { - toSerialize["AllowPrivilegedContainers"] = val - } if val, ok := getKubernetesGetVersionAttributeTypeOk(o.Version); ok { toSerialize["Version"] = val } diff --git a/services/ske/model_kubernetes_test.go b/services/ske/model_kubernetes_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_kubernetes_test.go +++ b/services/ske/model_kubernetes_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_kubernetes_version.go b/services/ske/model_kubernetes_version.go index 2f0e2d408..07c3c2be1 100644 --- a/services/ske/model_kubernetes_version.go +++ b/services/ske/model_kubernetes_version.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_kubernetes_version_test.go b/services/ske/model_kubernetes_version_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_kubernetes_version_test.go +++ b/services/ske/model_kubernetes_version_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_list_clusters_response.go b/services/ske/model_list_clusters_response.go index af2b88b8e..809019637 100644 --- a/services/ske/model_list_clusters_response.go +++ b/services/ske/model_list_clusters_response.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_list_clusters_response_test.go b/services/ske/model_list_clusters_response_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_list_clusters_response_test.go +++ b/services/ske/model_list_clusters_response_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_login_kubeconfig.go b/services/ske/model_login_kubeconfig.go index 839aefb75..e70652349 100644 --- a/services/ske/model_login_kubeconfig.go +++ b/services/ske/model_login_kubeconfig.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_login_kubeconfig_test.go b/services/ske/model_login_kubeconfig_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_login_kubeconfig_test.go +++ b/services/ske/model_login_kubeconfig_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_machine.go b/services/ske/model_machine.go index b308bbc44..d6499a9be 100644 --- a/services/ske/model_machine.go +++ b/services/ske/model_machine.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_machine_image.go b/services/ske/model_machine_image.go index d0999c062..17e7ecb4c 100644 --- a/services/ske/model_machine_image.go +++ b/services/ske/model_machine_image.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_machine_image_test.go b/services/ske/model_machine_image_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_machine_image_test.go +++ b/services/ske/model_machine_image_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_machine_image_version.go b/services/ske/model_machine_image_version.go index 5d73e817c..06bc11fdc 100644 --- a/services/ske/model_machine_image_version.go +++ b/services/ske/model_machine_image_version.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_machine_image_version_test.go b/services/ske/model_machine_image_version_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_machine_image_version_test.go +++ b/services/ske/model_machine_image_version_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_machine_test.go b/services/ske/model_machine_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_machine_test.go +++ b/services/ske/model_machine_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_machine_type.go b/services/ske/model_machine_type.go index 090290cb3..5bc7a6fd3 100644 --- a/services/ske/model_machine_type.go +++ b/services/ske/model_machine_type.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_machine_type_test.go b/services/ske/model_machine_type_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_machine_type_test.go +++ b/services/ske/model_machine_type_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_maintenance.go b/services/ske/model_maintenance.go index 001422343..14d99c521 100644 --- a/services/ske/model_maintenance.go +++ b/services/ske/model_maintenance.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_maintenance_auto_update.go b/services/ske/model_maintenance_auto_update.go index 925303a04..784852f24 100644 --- a/services/ske/model_maintenance_auto_update.go +++ b/services/ske/model_maintenance_auto_update.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_maintenance_auto_update_test.go b/services/ske/model_maintenance_auto_update_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_maintenance_auto_update_test.go +++ b/services/ske/model_maintenance_auto_update_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_maintenance_test.go b/services/ske/model_maintenance_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_maintenance_test.go +++ b/services/ske/model_maintenance_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_network.go b/services/ske/model_network.go index f8fabf55b..d9d78679d 100644 --- a/services/ske/model_network.go +++ b/services/ske/model_network.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_network_test.go b/services/ske/model_network_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_network_test.go +++ b/services/ske/model_network_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_nodepool.go b/services/ske/model_nodepool.go index d9d5858a6..50fa186a3 100644 --- a/services/ske/model_nodepool.go +++ b/services/ske/model_nodepool.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_nodepool_test.go b/services/ske/model_nodepool_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_nodepool_test.go +++ b/services/ske/model_nodepool_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_observability.go b/services/ske/model_observability.go new file mode 100644 index 000000000..ca7c69ae5 --- /dev/null +++ b/services/ske/model_observability.go @@ -0,0 +1,171 @@ +/* +SKE-API + +The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. + +API version: 2.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package ske + +import ( + "encoding/json" +) + +// checks if the Observability type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Observability{} + +/* + types and functions for enabled +*/ + +// isBoolean +type ObservabilitygetEnabledAttributeType = *bool +type ObservabilitygetEnabledArgType = bool +type ObservabilitygetEnabledRetType = bool + +func getObservabilitygetEnabledAttributeTypeOk(arg ObservabilitygetEnabledAttributeType) (ret ObservabilitygetEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setObservabilitygetEnabledAttributeType(arg *ObservabilitygetEnabledAttributeType, val ObservabilitygetEnabledRetType) { + *arg = &val +} + +/* + types and functions for instanceId +*/ + +// isNotNullableString +type ObservabilityGetInstanceIdAttributeType = *string + +func getObservabilityGetInstanceIdAttributeTypeOk(arg ObservabilityGetInstanceIdAttributeType) (ret ObservabilityGetInstanceIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setObservabilityGetInstanceIdAttributeType(arg *ObservabilityGetInstanceIdAttributeType, val ObservabilityGetInstanceIdRetType) { + *arg = &val +} + +type ObservabilityGetInstanceIdArgType = string +type ObservabilityGetInstanceIdRetType = string + +// Observability struct for Observability +type Observability struct { + // Enables the Observability extension. + // REQUIRED + Enabled ObservabilitygetEnabledAttributeType `json:"enabled" required:"true"` + // Instance ID to choose which Observability instance is used. + // REQUIRED + InstanceId ObservabilityGetInstanceIdAttributeType `json:"instanceId" required:"true"` +} + +type _Observability Observability + +// NewObservability instantiates a new Observability 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 NewObservability(enabled ObservabilitygetEnabledArgType, instanceId ObservabilityGetInstanceIdArgType) *Observability { + this := Observability{} + setObservabilitygetEnabledAttributeType(&this.Enabled, enabled) + setObservabilityGetInstanceIdAttributeType(&this.InstanceId, instanceId) + return &this +} + +// NewObservabilityWithDefaults instantiates a new Observability 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 NewObservabilityWithDefaults() *Observability { + this := Observability{} + return &this +} + +// GetEnabled returns the Enabled field value +func (o *Observability) GetEnabled() (ret ObservabilitygetEnabledRetType) { + ret, _ = o.GetEnabledOk() + return ret +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *Observability) GetEnabledOk() (ret ObservabilitygetEnabledRetType, ok bool) { + return getObservabilitygetEnabledAttributeTypeOk(o.Enabled) +} + +// SetEnabled sets field value +func (o *Observability) SetEnabled(v ObservabilitygetEnabledRetType) { + setObservabilitygetEnabledAttributeType(&o.Enabled, v) +} + +// GetInstanceId returns the InstanceId field value +func (o *Observability) GetInstanceId() (ret ObservabilityGetInstanceIdRetType) { + ret, _ = o.GetInstanceIdOk() + return ret +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value +// and a boolean to check if the value has been set. +func (o *Observability) GetInstanceIdOk() (ret ObservabilityGetInstanceIdRetType, ok bool) { + return getObservabilityGetInstanceIdAttributeTypeOk(o.InstanceId) +} + +// SetInstanceId sets field value +func (o *Observability) SetInstanceId(v ObservabilityGetInstanceIdRetType) { + setObservabilityGetInstanceIdAttributeType(&o.InstanceId, v) +} + +func (o Observability) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getObservabilitygetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val + } + if val, ok := getObservabilityGetInstanceIdAttributeTypeOk(o.InstanceId); ok { + toSerialize["InstanceId"] = val + } + return toSerialize, nil +} + +type NullableObservability struct { + value *Observability + isSet bool +} + +func (v NullableObservability) Get() *Observability { + return v.value +} + +func (v *NullableObservability) Set(val *Observability) { + v.value = val + v.isSet = true +} + +func (v NullableObservability) IsSet() bool { + return v.isSet +} + +func (v *NullableObservability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableObservability(val *Observability) *NullableObservability { + return &NullableObservability{value: val, isSet: true} +} + +func (v NullableObservability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableObservability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/ske/model_argus_test.go b/services/ske/model_observability_test.go similarity index 93% rename from services/ske/model_argus_test.go rename to services/ske/model_observability_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_argus_test.go +++ b/services/ske/model_observability_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_provider_options.go b/services/ske/model_provider_options.go index a79f64dc7..3c0a97867 100644 --- a/services/ske/model_provider_options.go +++ b/services/ske/model_provider_options.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_provider_options_test.go b/services/ske/model_provider_options_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_provider_options_test.go +++ b/services/ske/model_provider_options_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_runtime_error.go b/services/ske/model_runtime_error.go index aef019091..0e636da0f 100644 --- a/services/ske/model_runtime_error.go +++ b/services/ske/model_runtime_error.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -24,23 +24,23 @@ var _ MappedNullable = &RuntimeError{} // isEnum -// RuntimeErrorCode - Code: `SKE_UNSPECIFIED` Message: \"An error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_TMP_AUTH_ERROR` Message: \"Authentication failed. This is a temporary error. Please wait while the system recovers.\" - Code: `SKE_QUOTA_EXCEEDED` Message: \"Your project's resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster.\" - Code: `SKE_ARGUS_INSTANCE_NOT_FOUND` Message: \"The provided Argus instance could not be found.\" - Code: `SKE_RATE_LIMITS` Message: \"While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers.\" - Code: `SKE_INFRA_ERROR` Message: \"An error occurred with the underlying infrastructure. Please open a support ticket if this error persists.\" - Code: `SKE_REMAINING_RESOURCES` Message: \"There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them.\" - Code: `SKE_CONFIGURATION_PROBLEM` Message: \"A configuration error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_UNREADY_NODES` Message: \"Not all worker nodes are ready. Please open a support ticket if this error persists.\" - Code: `SKE_API_SERVER_ERROR` Message: \"The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists.\" - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: \"The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone.\" +// RuntimeErrorCode - Code: `SKE_UNSPECIFIED` Message: \"An error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_TMP_AUTH_ERROR` Message: \"Authentication failed. This is a temporary error. Please wait while the system recovers.\" - Code: `SKE_QUOTA_EXCEEDED` Message: \"Your project's resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster.\" - Code: `SKE_OBSERVABILITY_INSTANCE_NOT_FOUND` Message: \"The provided Observability instance could not be found.\" - Code: `SKE_RATE_LIMITS` Message: \"While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers.\" - Code: `SKE_INFRA_ERROR` Message: \"An error occurred with the underlying infrastructure. Please open a support ticket if this error persists.\" - Code: `SKE_REMAINING_RESOURCES` Message: \"There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them.\" - Code: `SKE_CONFIGURATION_PROBLEM` Message: \"A configuration error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_UNREADY_NODES` Message: \"Not all worker nodes are ready. Please open a support ticket if this error persists.\" - Code: `SKE_API_SERVER_ERROR` Message: \"The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists.\" - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: \"The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone.\" // value type for enums type RuntimeErrorCode string // List of Code const ( - RUNTIMEERRORCODE_UNSPECIFIED RuntimeErrorCode = "SKE_UNSPECIFIED" - RUNTIMEERRORCODE_TMP_AUTH_ERROR RuntimeErrorCode = "SKE_TMP_AUTH_ERROR" - RUNTIMEERRORCODE_QUOTA_EXCEEDED RuntimeErrorCode = "SKE_QUOTA_EXCEEDED" - RUNTIMEERRORCODE_ARGUS_INSTANCE_NOT_FOUND RuntimeErrorCode = "SKE_ARGUS_INSTANCE_NOT_FOUND" - RUNTIMEERRORCODE_RATE_LIMITS RuntimeErrorCode = "SKE_RATE_LIMITS" - RUNTIMEERRORCODE_INFRA_ERROR RuntimeErrorCode = "SKE_INFRA_ERROR" - RUNTIMEERRORCODE_REMAINING_RESOURCES RuntimeErrorCode = "SKE_REMAINING_RESOURCES" - RUNTIMEERRORCODE_CONFIGURATION_PROBLEM RuntimeErrorCode = "SKE_CONFIGURATION_PROBLEM" - RUNTIMEERRORCODE_UNREADY_NODES RuntimeErrorCode = "SKE_UNREADY_NODES" - RUNTIMEERRORCODE_API_SERVER_ERROR RuntimeErrorCode = "SKE_API_SERVER_ERROR" - RUNTIMEERRORCODE_DNS_ZONE_NOT_FOUND RuntimeErrorCode = "SKE_DNS_ZONE_NOT_FOUND" + RUNTIMEERRORCODE_UNSPECIFIED RuntimeErrorCode = "SKE_UNSPECIFIED" + RUNTIMEERRORCODE_TMP_AUTH_ERROR RuntimeErrorCode = "SKE_TMP_AUTH_ERROR" + RUNTIMEERRORCODE_QUOTA_EXCEEDED RuntimeErrorCode = "SKE_QUOTA_EXCEEDED" + RUNTIMEERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND RuntimeErrorCode = "SKE_OBSERVABILITY_INSTANCE_NOT_FOUND" + RUNTIMEERRORCODE_RATE_LIMITS RuntimeErrorCode = "SKE_RATE_LIMITS" + RUNTIMEERRORCODE_INFRA_ERROR RuntimeErrorCode = "SKE_INFRA_ERROR" + RUNTIMEERRORCODE_REMAINING_RESOURCES RuntimeErrorCode = "SKE_REMAINING_RESOURCES" + RUNTIMEERRORCODE_CONFIGURATION_PROBLEM RuntimeErrorCode = "SKE_CONFIGURATION_PROBLEM" + RUNTIMEERRORCODE_UNREADY_NODES RuntimeErrorCode = "SKE_UNREADY_NODES" + RUNTIMEERRORCODE_API_SERVER_ERROR RuntimeErrorCode = "SKE_API_SERVER_ERROR" + RUNTIMEERRORCODE_DNS_ZONE_NOT_FOUND RuntimeErrorCode = "SKE_DNS_ZONE_NOT_FOUND" ) // All allowed values of RuntimeError enum @@ -48,7 +48,7 @@ var AllowedRuntimeErrorCodeEnumValues = []RuntimeErrorCode{ "SKE_UNSPECIFIED", "SKE_TMP_AUTH_ERROR", "SKE_QUOTA_EXCEEDED", - "SKE_ARGUS_INSTANCE_NOT_FOUND", + "SKE_OBSERVABILITY_INSTANCE_NOT_FOUND", "SKE_RATE_LIMITS", "SKE_INFRA_ERROR", "SKE_REMAINING_RESOURCES", @@ -204,7 +204,7 @@ type RuntimeErrorGetMessageRetType = string // RuntimeError struct for RuntimeError type RuntimeError struct { - // - Code: `SKE_UNSPECIFIED` Message: \"An error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_TMP_AUTH_ERROR` Message: \"Authentication failed. This is a temporary error. Please wait while the system recovers.\" - Code: `SKE_QUOTA_EXCEEDED` Message: \"Your project's resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster.\" - Code: `SKE_ARGUS_INSTANCE_NOT_FOUND` Message: \"The provided Argus instance could not be found.\" - Code: `SKE_RATE_LIMITS` Message: \"While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers.\" - Code: `SKE_INFRA_ERROR` Message: \"An error occurred with the underlying infrastructure. Please open a support ticket if this error persists.\" - Code: `SKE_REMAINING_RESOURCES` Message: \"There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them.\" - Code: `SKE_CONFIGURATION_PROBLEM` Message: \"A configuration error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_UNREADY_NODES` Message: \"Not all worker nodes are ready. Please open a support ticket if this error persists.\" - Code: `SKE_API_SERVER_ERROR` Message: \"The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists.\" - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: \"The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone.\" + // - Code: `SKE_UNSPECIFIED` Message: \"An error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_TMP_AUTH_ERROR` Message: \"Authentication failed. This is a temporary error. Please wait while the system recovers.\" - Code: `SKE_QUOTA_EXCEEDED` Message: \"Your project's resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster.\" - Code: `SKE_OBSERVABILITY_INSTANCE_NOT_FOUND` Message: \"The provided Observability instance could not be found.\" - Code: `SKE_RATE_LIMITS` Message: \"While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers.\" - Code: `SKE_INFRA_ERROR` Message: \"An error occurred with the underlying infrastructure. Please open a support ticket if this error persists.\" - Code: `SKE_REMAINING_RESOURCES` Message: \"There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them.\" - Code: `SKE_CONFIGURATION_PROBLEM` Message: \"A configuration error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_UNREADY_NODES` Message: \"Not all worker nodes are ready. Please open a support ticket if this error persists.\" - Code: `SKE_API_SERVER_ERROR` Message: \"The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists.\" - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: \"The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone.\" Code RuntimeErrorGetCodeAttributeType `json:"code,omitempty"` Details RuntimeErrorGetDetailsAttributeType `json:"details,omitempty"` Message RuntimeErrorGetMessageAttributeType `json:"message,omitempty"` diff --git a/services/ske/model_runtime_error_test.go b/services/ske/model_runtime_error_test.go index af14195bb..5a6402a21 100644 --- a/services/ske/model_runtime_error_test.go +++ b/services/ske/model_runtime_error_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -49,7 +49,7 @@ func TestRuntimeErrorCode_UnmarshalJSON(t *testing.T) { { name: `success - possible enum value no. 4`, args: args{ - src: []byte(`"SKE_ARGUS_INSTANCE_NOT_FOUND"`), + src: []byte(`"SKE_OBSERVABILITY_INSTANCE_NOT_FOUND"`), }, wantErr: false, }, diff --git a/services/ske/model_taint.go b/services/ske/model_taint.go index a91c08d63..553a2f5fe 100644 --- a/services/ske/model_taint.go +++ b/services/ske/model_taint.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_taint_test.go b/services/ske/model_taint_test.go index b927864c1..002209948 100644 --- a/services/ske/model_taint_test.go +++ b/services/ske/model_taint_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_time_window.go b/services/ske/model_time_window.go index df318e42e..3d72ea35e 100644 --- a/services/ske/model_time_window.go +++ b/services/ske/model_time_window.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_time_window_test.go b/services/ske/model_time_window_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_time_window_test.go +++ b/services/ske/model_time_window_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_volume.go b/services/ske/model_volume.go index 753ae5c87..ab9a64d8f 100644 --- a/services/ske/model_volume.go +++ b/services/ske/model_volume.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_volume_test.go b/services/ske/model_volume_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_volume_test.go +++ b/services/ske/model_volume_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_volume_type.go b/services/ske/model_volume_type.go index 90b314990..2cc2c5b55 100644 --- a/services/ske/model_volume_type.go +++ b/services/ske/model_volume_type.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/model_volume_type_test.go b/services/ske/model_volume_type_test.go index 68eb6a637..416840235 100644 --- a/services/ske/model_volume_type_test.go +++ b/services/ske/model_volume_type_test.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/utils.go b/services/ske/utils.go index 88d47eabd..334ef94ec 100644 --- a/services/ske/utils.go +++ b/services/ske/utils.go @@ -3,7 +3,7 @@ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. -API version: 1.1 +API version: 2.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/services/ske/wait/wait.go b/services/ske/wait/wait.go index 575660943..5b87ac69a 100644 --- a/services/ske/wait/wait.go +++ b/services/ske/wait/wait.go @@ -31,19 +31,19 @@ const ( CredentialsRotationStateCompleting = "COMPLETING" // Deprecated: CredentialsRotationStateCompleted is deprecated and will be removed after 14th November 2025. Use [ske.CREDENTIALSROTATIONSTATEPHASE_COMPLETED] instead. CredentialsRotationStateCompleted = "COMPLETED" - // Deprecated: InvalidArgusInstanceErrorCode is deprecated and will be removed after 14th November 2025. Use [ske.RUNTIMEERRORCODE_ARGUS_INSTANCE_NOT_FOUND] instead. + // Deprecated: InvalidArgusInstanceErrorCode is deprecated and will be removed after 14th November 2025. Use [ske.RUNTIMEERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND] instead. InvalidArgusInstanceErrorCode = "SKE_ARGUS_INSTANCE_NOT_FOUND" ) type APIClientClusterInterface interface { - GetClusterExecute(ctx context.Context, projectId, name string) (*ske.Cluster, error) - ListClustersExecute(ctx context.Context, projectId string) (*ske.ListClustersResponse, error) + GetClusterExecute(ctx context.Context, projectId, region, name string) (*ske.Cluster, error) + ListClustersExecute(ctx context.Context, projectId, region string) (*ske.ListClustersResponse, error) } // CreateOrUpdateClusterWaitHandler will wait for cluster creation or update -func CreateOrUpdateClusterWaitHandler(ctx context.Context, a APIClientClusterInterface, projectId, name string) *wait.AsyncActionHandler[ske.Cluster] { +func CreateOrUpdateClusterWaitHandler(ctx context.Context, a APIClientClusterInterface, projectId, region, name string) *wait.AsyncActionHandler[ske.Cluster] { handler := wait.New(func() (waitFinished bool, response *ske.Cluster, err error) { - s, err := a.GetClusterExecute(ctx, projectId, name) + s, err := a.GetClusterExecute(ctx, projectId, region, name) if err != nil { return false, nil, err } @@ -52,7 +52,7 @@ func CreateOrUpdateClusterWaitHandler(ctx context.Context, a APIClientClusterInt // The state "STATE_UNHEALTHY" (aka "Impaired" in the portal) could be temporarily occur during cluster creation and the system is recovering usually, so it is not considered as a failed state here. // -- alignment meeting with SKE team on 4.8.23 // The exception is when providing an invalid argus instance id, in that case the cluster will stay as "Impaired" until the SKE team solves it, but it is still usable. - if state == ske.CLUSTERSTATUSSTATE_UNHEALTHY && s.Status.Error != nil && s.Status.Error.Message != nil && *s.Status.Error.Code == ske.RUNTIMEERRORCODE_ARGUS_INSTANCE_NOT_FOUND { + if state == ske.CLUSTERSTATUSSTATE_UNHEALTHY && s.Status.Error != nil && s.Status.Error.Message != nil && *s.Status.Error.Code == ske.RUNTIMEERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND { return true, s, nil } @@ -71,9 +71,9 @@ func CreateOrUpdateClusterWaitHandler(ctx context.Context, a APIClientClusterInt } // DeleteClusterWaitHandler will wait for cluster deletion -func DeleteClusterWaitHandler(ctx context.Context, a APIClientClusterInterface, projectId, name string) *wait.AsyncActionHandler[ske.ListClustersResponse] { +func DeleteClusterWaitHandler(ctx context.Context, a APIClientClusterInterface, projectId, region, name string) *wait.AsyncActionHandler[ske.ListClustersResponse] { handler := wait.New(func() (waitFinished bool, response *ske.ListClustersResponse, err error) { - s, err := a.ListClustersExecute(ctx, projectId) + s, err := a.ListClustersExecute(ctx, projectId, region) if err != nil { return false, nil, err } @@ -91,9 +91,9 @@ func DeleteClusterWaitHandler(ctx context.Context, a APIClientClusterInterface, } // RotateCredentialsWaitHandler will wait for credentials rotation -func RotateCredentialsWaitHandler(ctx context.Context, a APIClientClusterInterface, projectId, clusterName string) *wait.AsyncActionHandler[ske.Cluster] { +func RotateCredentialsWaitHandler(ctx context.Context, a APIClientClusterInterface, projectId, region, clusterName string) *wait.AsyncActionHandler[ske.Cluster] { handler := wait.New(func() (waitFinished bool, response *ske.Cluster, err error) { - s, err := a.GetClusterExecute(ctx, projectId, clusterName) + s, err := a.GetClusterExecute(ctx, projectId, region, clusterName) if err != nil { return false, nil, err } @@ -119,9 +119,9 @@ func RotateCredentialsWaitHandler(ctx context.Context, a APIClientClusterInterfa } // StartCredentialsRotationWaitHandler will wait for credentials rotation -func StartCredentialsRotationWaitHandler(ctx context.Context, a APIClientClusterInterface, projectId, clusterName string) *wait.AsyncActionHandler[ske.Cluster] { +func StartCredentialsRotationWaitHandler(ctx context.Context, a APIClientClusterInterface, projectId, region, clusterName string) *wait.AsyncActionHandler[ske.Cluster] { handler := wait.New(func() (waitFinished bool, response *ske.Cluster, err error) { - s, err := a.GetClusterExecute(ctx, projectId, clusterName) + s, err := a.GetClusterExecute(ctx, projectId, region, clusterName) if err != nil { return false, nil, err } @@ -143,9 +143,9 @@ func StartCredentialsRotationWaitHandler(ctx context.Context, a APIClientCluster } // CompleteCredentialsRotationWaitHandler will wait for credentials rotation -func CompleteCredentialsRotationWaitHandler(ctx context.Context, a APIClientClusterInterface, projectId, clusterName string) *wait.AsyncActionHandler[ske.Cluster] { +func CompleteCredentialsRotationWaitHandler(ctx context.Context, a APIClientClusterInterface, projectId, region, clusterName string) *wait.AsyncActionHandler[ske.Cluster] { handler := wait.New(func() (waitFinished bool, response *ske.Cluster, err error) { - s, err := a.GetClusterExecute(ctx, projectId, clusterName) + s, err := a.GetClusterExecute(ctx, projectId, region, clusterName) if err != nil { return false, nil, err } diff --git a/services/ske/wait/wait_test.go b/services/ske/wait/wait_test.go index 35c6c78e9..3e838d95e 100644 --- a/services/ske/wait/wait_test.go +++ b/services/ske/wait/wait_test.go @@ -20,7 +20,9 @@ type apiClientClusterMocked struct { invalidArgusInstance bool } -func (a *apiClientClusterMocked) GetClusterExecute(_ context.Context, _, _ string) (*ske.Cluster, error) { +const testRegion = "eu01" + +func (a *apiClientClusterMocked) GetClusterExecute(_ context.Context, _, _, _ string) (*ske.Cluster, error) { if a.getFails { return nil, &oapierror.GenericOpenAPIError{ StatusCode: http.StatusInternalServerError, @@ -34,7 +36,7 @@ func (a *apiClientClusterMocked) GetClusterExecute(_ context.Context, _, _ strin Status: &ske.ClusterStatus{ Aggregated: &rs, Error: &ske.RuntimeError{ - Code: utils.Ptr(ske.RUNTIMEERRORCODE_ARGUS_INSTANCE_NOT_FOUND), + Code: utils.Ptr(ske.RUNTIMEERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND), Message: utils.Ptr("invalid argus instance"), }, }, @@ -48,7 +50,7 @@ func (a *apiClientClusterMocked) GetClusterExecute(_ context.Context, _, _ strin }, nil } -func (a *apiClientClusterMocked) ListClustersExecute(_ context.Context, _ string) (*ske.ListClustersResponse, error) { +func (a *apiClientClusterMocked) ListClustersExecute(_ context.Context, _, _ string) (*ske.ListClustersResponse, error) { if a.getFails { return nil, &oapierror.GenericOpenAPIError{ StatusCode: http.StatusInternalServerError, @@ -141,13 +143,13 @@ func TestCreateOrUpdateClusterWaitHandler(t *testing.T) { if tt.invalidArgusInstance { wantRes.Status.Error = &ske.RuntimeError{ - Code: utils.Ptr(ske.RUNTIMEERRORCODE_ARGUS_INSTANCE_NOT_FOUND), + Code: utils.Ptr(ske.RUNTIMEERRORCODE_OBSERVABILITY_INSTANCE_NOT_FOUND), Message: utils.Ptr("invalid argus instance"), } } } - handler := CreateOrUpdateClusterWaitHandler(context.Background(), apiClient, "", name) + handler := CreateOrUpdateClusterWaitHandler(context.Background(), apiClient, "", testRegion, name) gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) @@ -223,7 +225,7 @@ func TestRotateCredentialsWaitHandler(t *testing.T) { } } - handler := RotateCredentialsWaitHandler(context.Background(), apiClient, "", name) + handler := RotateCredentialsWaitHandler(context.Background(), apiClient, "", testRegion, name) gotRes, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background())