From c3deb38b4e2c27a3446f157c72a28afd95c08158 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 10 May 2024 12:45:07 +0000 Subject: [PATCH 1/3] Generate opensearch --- services/opensearch/api_default.go | 260 ++++++++++++++++++ services/opensearch/api_default_test.go | 130 ++++++++- ...model_elasticsearch_instance_parameters.go | 31 --- ...ponse.go => model_get_metrics_response.go} | 2 +- .../model_log_me2_instance_parameters.go | 46 ---- .../opensearch/model_log_me_credentials.go | 23 -- .../opensearch/model_maria_db_credentials.go | 24 -- .../model_maria_db_instance_parameters.go | 27 -- services/opensearch/model_metrics.go | 2 +- .../model_postgre_sql_instance_parameters.go | 81 ------ .../model_postgres_ql_credentials.go | 24 -- .../opensearch/model_rabbit_mq_credentials.go | 28 -- .../model_rabbit_mq_instance_parameters.go | 33 --- .../opensearch/model_redis_credentials.go | 24 -- .../model_redis_instance_parameters.go | 46 ---- 15 files changed, 382 insertions(+), 399 deletions(-) delete mode 100644 services/opensearch/model_elasticsearch_instance_parameters.go rename services/opensearch/{model_list_metrics_response.go => model_get_metrics_response.go} (98%) delete mode 100644 services/opensearch/model_log_me2_instance_parameters.go delete mode 100644 services/opensearch/model_log_me_credentials.go delete mode 100644 services/opensearch/model_maria_db_credentials.go delete mode 100644 services/opensearch/model_maria_db_instance_parameters.go delete mode 100644 services/opensearch/model_postgre_sql_instance_parameters.go delete mode 100644 services/opensearch/model_postgres_ql_credentials.go delete mode 100644 services/opensearch/model_rabbit_mq_credentials.go delete mode 100644 services/opensearch/model_rabbit_mq_instance_parameters.go delete mode 100644 services/opensearch/model_redis_credentials.go delete mode 100644 services/opensearch/model_redis_instance_parameters.go diff --git a/services/opensearch/api_default.go b/services/opensearch/api_default.go index 6c9852dc6..eaf05691d 100644 --- a/services/opensearch/api_default.go +++ b/services/opensearch/api_default.go @@ -847,6 +847,266 @@ func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, in return r.Execute() } +type ApiGetMetricsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string +} + +func (r ApiGetMetricsRequest) Execute() (*GetMetricsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetMetricsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetMetrics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/metrics" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetMetrics get latest metrics for cpu load, memory and disk usage + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId Instance id + @param projectId Project id on which user has permissions + @return ApiGetMetricsRequest +*/ +func (a *APIClient) GetMetrics(ctx context.Context, instanceId string, projectId string) ApiGetMetricsRequest { + return ApiGetMetricsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) GetMetricsExecute(ctx context.Context, instanceId string, projectId string) (*GetMetricsResponse, error) { + r := ApiGetMetricsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + +type ApiListBackupsRequest struct { + ctx context.Context + apiService *DefaultApiService + instanceId string + projectId string +} + +func (r ApiListBackupsRequest) Execute() (*ListBackupsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListBackupsResponse + ) + a := r.apiService + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/instances/{instanceId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +ListBackups get latest backup information for provided instanceId + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId Instance id + @param projectId Project id on which user has permissions + @return ApiListBackupsRequest +*/ +func (a *APIClient) ListBackups(ctx context.Context, instanceId string, projectId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } +} + +func (a *APIClient) ListBackupsExecute(ctx context.Context, instanceId string, projectId string) (*ListBackupsResponse, error) { + r := ApiListBackupsRequest{ + apiService: a.defaultApi, + ctx: ctx, + instanceId: instanceId, + projectId: projectId, + } + return r.Execute() +} + type ApiListCredentialsRequest struct { ctx context.Context apiService *DefaultApiService diff --git a/services/opensearch/api_default_test.go b/services/opensearch/api_default_test.go index f2a95f06e..a5bb53522 100644 --- a/services/opensearch/api_default_test.go +++ b/services/opensearch/api_default_test.go @@ -71,7 +71,7 @@ func Test_opensearch_DefaultApiService(t *testing.T) { resp, reqErr := apiClient.CreateCredentials(context.Background(), projectId, instanceId).Execute() if reqErr != nil { - t.Fatalf("error in call: %v", err) + t.Fatalf("error in call: %v", reqErr) } if resp == nil { t.Fatalf("response not present") @@ -124,7 +124,7 @@ func Test_opensearch_DefaultApiService(t *testing.T) { resp, reqErr := apiClient.CreateInstance(context.Background(), projectId).CreateInstancePayload(createInstancePayload).Execute() if reqErr != nil { - t.Fatalf("error in call: %v", err) + t.Fatalf("error in call: %v", reqErr) } if resp == nil { t.Fatalf("response not present") @@ -179,7 +179,7 @@ func Test_opensearch_DefaultApiService(t *testing.T) { reqErr := apiClient.DeleteCredentials(context.Background(), projectId, instanceId, credentialsId).Execute() if reqErr != nil { - t.Fatalf("error in call: %v", err) + t.Fatalf("error in call: %v", reqErr) } }) @@ -228,7 +228,7 @@ func Test_opensearch_DefaultApiService(t *testing.T) { reqErr := apiClient.DeleteInstance(context.Background(), projectId, instanceId).Execute() if reqErr != nil { - t.Fatalf("error in call: %v", err) + t.Fatalf("error in call: %v", reqErr) } }) @@ -283,7 +283,7 @@ func Test_opensearch_DefaultApiService(t *testing.T) { resp, reqErr := apiClient.GetCredentials(context.Background(), projectId, instanceId, credentialsId).Execute() if reqErr != nil { - t.Fatalf("error in call: %v", err) + t.Fatalf("error in call: %v", reqErr) } if resp == nil { t.Fatalf("response not present") @@ -338,7 +338,117 @@ func Test_opensearch_DefaultApiService(t *testing.T) { resp, reqErr := apiClient.GetInstance(context.Background(), projectId, instanceId).Execute() if reqErr != nil { - t.Fatalf("error in call: %v", err) + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService GetMetrics", func(t *testing.T) { + path := "/v1/projects/{projectId}/instances/{instanceId}/metrics" + instanceIdValue := "instanceId" + path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := GetMetricsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for opensearch_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + instanceId := "instanceId" + projectId := "projectId" + + resp, reqErr := apiClient.GetMetrics(context.Background(), instanceId, projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if resp == nil { + t.Fatalf("response not present") + } + }) + + t.Run("Test DefaultApiService ListBackups", func(t *testing.T) { + path := "/v1/projects/{projectId}/instances/{instanceId}/backups" + instanceIdValue := "instanceId" + path = strings.Replace(path, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) + projectIdValue := "projectId" + path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + data := ListBackupsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for opensearch_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + instanceId := "instanceId" + projectId := "projectId" + + resp, reqErr := apiClient.ListBackups(context.Background(), instanceId, projectId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) } if resp == nil { t.Fatalf("response not present") @@ -393,7 +503,7 @@ func Test_opensearch_DefaultApiService(t *testing.T) { resp, reqErr := apiClient.ListCredentials(context.Background(), projectId, instanceId).Execute() if reqErr != nil { - t.Fatalf("error in call: %v", err) + t.Fatalf("error in call: %v", reqErr) } if resp == nil { t.Fatalf("response not present") @@ -445,7 +555,7 @@ func Test_opensearch_DefaultApiService(t *testing.T) { resp, reqErr := apiClient.ListInstances(context.Background(), projectId).Execute() if reqErr != nil { - t.Fatalf("error in call: %v", err) + t.Fatalf("error in call: %v", reqErr) } if resp == nil { t.Fatalf("response not present") @@ -497,7 +607,7 @@ func Test_opensearch_DefaultApiService(t *testing.T) { resp, reqErr := apiClient.ListOfferings(context.Background(), projectId).Execute() if reqErr != nil { - t.Fatalf("error in call: %v", err) + t.Fatalf("error in call: %v", reqErr) } if resp == nil { t.Fatalf("response not present") @@ -550,7 +660,7 @@ func Test_opensearch_DefaultApiService(t *testing.T) { reqErr := apiClient.PartialUpdateInstance(context.Background(), projectId, instanceId).PartialUpdateInstancePayload(partialUpdateInstancePayload).Execute() if reqErr != nil { - t.Fatalf("error in call: %v", err) + t.Fatalf("error in call: %v", reqErr) } }) diff --git a/services/opensearch/model_elasticsearch_instance_parameters.go b/services/opensearch/model_elasticsearch_instance_parameters.go deleted file mode 100644 index b4ac7b3e8..000000000 --- a/services/opensearch/model_elasticsearch_instance_parameters.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -STACKIT Opensearch API - -The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. - -API version: 1.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package opensearch - -type ElasticsearchInstanceParameters struct { - EnableMonitoring *bool `json:"enable_monitoring,omitempty"` - // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. - Graphite *string `json:"graphite,omitempty"` - // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. - MaxDiskThreshold *int64 `json:"max_disk_threshold,omitempty"` - // Frequency of metrics being emitted in seconds - MetricsFrequency *int64 `json:"metrics_frequency,omitempty"` - // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. - MetricsPrefix *string `json:"metrics_prefix,omitempty"` - MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` - // The plugins repository-s3 and repository-azure are enabled by default and cannot be disabled. - Plugins *[]string `json:"plugins,omitempty"` - // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - SgwAcl *string `json:"sgw_acl,omitempty"` - // The content follows the nginx configuration file measurement units. - SslSessionTimeout *string `json:"ssl_session_timeout,omitempty"` - Syslog *[]string `json:"syslog,omitempty"` -} diff --git a/services/opensearch/model_list_metrics_response.go b/services/opensearch/model_get_metrics_response.go similarity index 98% rename from services/opensearch/model_list_metrics_response.go rename to services/opensearch/model_get_metrics_response.go index 9905e83ca..b7ea02eab 100644 --- a/services/opensearch/model_list_metrics_response.go +++ b/services/opensearch/model_get_metrics_response.go @@ -10,7 +10,7 @@ API version: 1.1.0 package opensearch -type ListMetricsResponse struct { +type GetMetricsResponse struct { CpuIdleTime *int64 `json:"cpuIdleTime,omitempty"` // REQUIRED CpuLoadPercent *int64 `json:"cpuLoadPercent"` diff --git a/services/opensearch/model_log_me2_instance_parameters.go b/services/opensearch/model_log_me2_instance_parameters.go deleted file mode 100644 index cc6742250..000000000 --- a/services/opensearch/model_log_me2_instance_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -STACKIT Opensearch API - -The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. - -API version: 1.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package opensearch - -type LogMe2InstanceParameters struct { - EnableMonitoring *bool `json:"enable_monitoring,omitempty"` - FluentdTcp *int64 `json:"fluentd-tcp,omitempty"` - FluentdTls *int64 `json:"fluentd-tls,omitempty"` - FluentdTlsCiphers *string `json:"fluentd-tls-ciphers,omitempty"` - FluentdTlsMaxVersion *string `json:"fluentd-tls-max-version,omitempty"` - FluentdTlsMinVersion *string `json:"fluentd-tls-min-version,omitempty"` - FluentdTlsVersion *string `json:"fluentd-tls-version,omitempty"` - FluentdUdp *int64 `json:"fluentd-udp,omitempty"` - // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. - Graphite *string `json:"graphite,omitempty"` - Groks *[]map[string]interface{} `json:"groks,omitempty"` - // Combination of an integer and a timerange when an index will be considered 'd' and can be deleted from OpenSearch. Possible values for the timerange are s, m, h and d. - IsmDeletionAfter *string `json:"ism_deletion_after,omitempty"` - IsmJitter *float64 `json:"ism_jitter,omitempty"` - IsmJobInterval *int64 `json:"ism_job_interval,omitempty"` - // Default: not set, 46% of available memory will be used. The amount of memory (in MB) allocated as heap by the JVM for OpenSearch. - JavaHeapspace *int64 `json:"java_heapspace,omitempty"` - // The amount of memory (in MB) used by the JVM to store metadata for OpenSearch. - JavaMaxmetaspace *int64 `json:"java_maxmetaspace,omitempty"` - // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. - MaxDiskThreshold *int64 `json:"max_disk_threshold,omitempty"` - // Frequency of metrics being emitted in seconds - MetricsFrequency *int64 `json:"metrics_frequency,omitempty"` - // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. - MetricsPrefix *string `json:"metrics_prefix,omitempty"` - MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` - OpensearchTlsCiphers *[]string `json:"opensearch-tls-ciphers,omitempty"` - OpensearchTlsProtocols *[]string `json:"opensearch-tls-protocols,omitempty"` - // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - SgwAcl *string `json:"sgw_acl,omitempty"` - Syslog *[]string `json:"syslog,omitempty"` - SyslogUseUdp *string `json:"syslog-use-udp,omitempty"` -} diff --git a/services/opensearch/model_log_me_credentials.go b/services/opensearch/model_log_me_credentials.go deleted file mode 100644 index 090e9c24b..000000000 --- a/services/opensearch/model_log_me_credentials.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -STACKIT Opensearch API - -The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. - -API version: 1.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package opensearch - -type LogMeCredentials struct { - // REQUIRED - Host *string `json:"host"` - // REQUIRED - Password *string `json:"password"` - Port *int64 `json:"port,omitempty"` - SyslogDrainUrl *string `json:"syslog_drain_url,omitempty"` - Uri *string `json:"uri,omitempty"` - // REQUIRED - Username *string `json:"username"` -} diff --git a/services/opensearch/model_maria_db_credentials.go b/services/opensearch/model_maria_db_credentials.go deleted file mode 100644 index 8dd1ecfe8..000000000 --- a/services/opensearch/model_maria_db_credentials.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -STACKIT Opensearch API - -The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. - -API version: 1.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package opensearch - -type MariaDBCredentials struct { - // REQUIRED - Host *string `json:"host"` - Hosts *[]string `json:"hosts,omitempty"` - Name *string `json:"name,omitempty"` - // REQUIRED - Password *string `json:"password"` - Port *int64 `json:"port,omitempty"` - Uri *string `json:"uri,omitempty"` - // REQUIRED - Username *string `json:"username"` -} diff --git a/services/opensearch/model_maria_db_instance_parameters.go b/services/opensearch/model_maria_db_instance_parameters.go deleted file mode 100644 index acc4c1955..000000000 --- a/services/opensearch/model_maria_db_instance_parameters.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -STACKIT Opensearch API - -The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. - -API version: 1.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package opensearch - -type MariaDBInstanceParameters struct { - EnableMonitoring *bool `json:"enable_monitoring,omitempty"` - // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. - Graphite *string `json:"graphite,omitempty"` - // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. - MaxDiskThreshold *int64 `json:"max_disk_threshold,omitempty"` - // Frequency of metrics being emitted in seconds - MetricsFrequency *int64 `json:"metrics_frequency,omitempty"` - // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. - MetricsPrefix *string `json:"metrics_prefix,omitempty"` - MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` - // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - SgwAcl *string `json:"sgw_acl,omitempty"` - Syslog *[]string `json:"syslog,omitempty"` -} diff --git a/services/opensearch/model_metrics.go b/services/opensearch/model_metrics.go index 1c5c6b050..c2612d75c 100644 --- a/services/opensearch/model_metrics.go +++ b/services/opensearch/model_metrics.go @@ -12,5 +12,5 @@ package opensearch type Metrics struct { // REQUIRED - Metrics *[]ListMetricsResponse `json:"metrics"` + Metrics *[]GetMetricsResponse `json:"metrics"` } diff --git a/services/opensearch/model_postgre_sql_instance_parameters.go b/services/opensearch/model_postgre_sql_instance_parameters.go deleted file mode 100644 index e065fa18a..000000000 --- a/services/opensearch/model_postgre_sql_instance_parameters.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -STACKIT Opensearch API - -The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. - -API version: 1.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package opensearch - -type PostgreSQLInstanceParameters struct { - // The units of the property are seconds. - ArchiveTimeout *int64 `json:"archive_timeout,omitempty"` - ClientMinMessages *string `json:"client_min_messages,omitempty"` - ContinuousArchiving *string `json:"continuous_archiving,omitempty"` - // This option can only be set during creation of the service instance, and cannot be changed later. - DataChecksums *string `json:"data_checksums,omitempty"` - DeletePlugins *[]string `json:"delete_plugins,omitempty"` - // The units of the property are MB. Please note, that our BOSH release includes an algorithm which calculates a usable value for this property on the fly based on the resources of the VM running. - EffectiveCacheSize *int64 `json:"effective_cache_size,omitempty"` - EnableMonitoring *bool `json:"enable_monitoring,omitempty"` - // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. - Graphite *string `json:"graphite,omitempty"` - // The units of the property are milliseconds. - IdleInTransactionSessionTimeout *int64 `json:"idle_in_transaction_session_timeout,omitempty"` - // The plugins pgcrypto and citext are enabled by default. - InstallPlugins *[]string `json:"install_plugins,omitempty"` - LogErrorVerbosity *string `json:"log_error_verbosity,omitempty"` - LogMinDurationStatement *int64 `json:"log_min_duration_statement,omitempty"` - LogStatement *string `json:"log_statement,omitempty"` - Loglevel *string `json:"loglevel,omitempty"` - // The units of the property are kilobytes. - MaintenanceWorkMem *int64 `json:"maintenance_work_mem,omitempty"` - // You cannot decrease max_connections as this will break clustering. The default value increases with instance size. - MaxConnections *int64 `json:"max_connections,omitempty"` - // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. - MaxDiskThreshold *int64 `json:"max_disk_threshold,omitempty"` - MaxReplicationSlots *int64 `json:"max_replication_slots,omitempty"` - MaxWalSenders *int64 `json:"max_wal_senders,omitempty"` - // Expects an array of database names. If the parameter is not set or the array is set to empty, then metrics will be collected for all databases. - MetricDatabases *[]string `json:"metric_databases,omitempty"` - MetricPgDatabaseSize *int64 `json:"metric_pg_database_size,omitempty"` - MetricPgReplication *int64 `json:"metric_pg_replication,omitempty"` - MetricPgStatAllIndexes *int64 `json:"metric_pg_stat_all_indexes,omitempty"` - MetricPgStatAllTables *int64 `json:"metric_pg_stat_all_tables,omitempty"` - MetricPgStatArchiverTable *int64 `json:"metric_pg_stat_archiver_table,omitempty"` - MetricPgStatDatabase *int64 `json:"metric_pg_stat_database,omitempty"` - MetricPgStatDatabaseConflicts *int64 `json:"metric_pg_stat_database_conflicts,omitempty"` - MetricPgStatioAllIndexes *int64 `json:"metric_pg_statio_all_indexes,omitempty"` - MetricPgStatioAllTables *int64 `json:"metric_pg_statio_all_tables,omitempty"` - // Frequency of metrics being emitted in seconds - MetricsFrequency *int64 `json:"metrics_frequency,omitempty"` - // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. - MetricsPrefix *string `json:"metrics_prefix,omitempty"` - MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` - PgLogMinErrorStatement *string `json:"pg_log_min_error_statement,omitempty"` - PgLogMinMessages *string `json:"pg_log_min_messages,omitempty"` - RepmgrLoglevel *string `json:"repmgr_loglevel,omitempty"` - RolePrivileges *[]string `json:"role_privileges,omitempty"` - // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - SgwAcl *string `json:"sgw_acl,omitempty"` - // The units of the property are MB. - SharedBuffers *int64 `json:"shared_buffers,omitempty"` - SslCiphers *string `json:"ssl_ciphers,omitempty"` - SslMinProtocolVersion *string `json:"ssl_min_protocol_version,omitempty"` - // The units of the property are milliseconds. - StatementTimeout *int64 `json:"statement_timeout,omitempty"` - SynchronousCommit *string `json:"synchronous_commit,omitempty"` - Syslog *[]string `json:"syslog,omitempty"` - // An integer value greater than 0 kilobytes is expected. Alternatively -1 means no limit. - TempFileLimit *int64 `json:"temp_file_limit,omitempty"` - // The units of the property are kilobytes. - TempFiles *int64 `json:"temp_files,omitempty"` - TrackIoTiming *string `json:"track_io_timing,omitempty"` - WalLevelLogical *bool `json:"wal_level_logical,omitempty"` - WalWriterDelay *int64 `json:"wal_writer_delay,omitempty"` - // The units of the property are kilobytes. Specifies the amount of memory to be used by internal sort operations and hash tables before writing to temporary disk files. - WorkMem *int64 `json:"work_mem,omitempty"` -} diff --git a/services/opensearch/model_postgres_ql_credentials.go b/services/opensearch/model_postgres_ql_credentials.go deleted file mode 100644 index 682593a0b..000000000 --- a/services/opensearch/model_postgres_ql_credentials.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -STACKIT Opensearch API - -The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. - -API version: 1.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package opensearch - -type PostgresQLCredentials struct { - // REQUIRED - Host *string `json:"host"` - Hosts *[]string `json:"hosts,omitempty"` - Name *string `json:"name,omitempty"` - // REQUIRED - Password *string `json:"password"` - Port *int64 `json:"port,omitempty"` - Uri *string `json:"uri,omitempty"` - // REQUIRED - Username *string `json:"username"` -} diff --git a/services/opensearch/model_rabbit_mq_credentials.go b/services/opensearch/model_rabbit_mq_credentials.go deleted file mode 100644 index 8bdc90262..000000000 --- a/services/opensearch/model_rabbit_mq_credentials.go +++ /dev/null @@ -1,28 +0,0 @@ -/* -STACKIT Opensearch API - -The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. - -API version: 1.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package opensearch - -type RabbitMQCredentials struct { - // REQUIRED - Host *string `json:"host"` - Hosts *[]string `json:"hosts,omitempty"` - // for rabbitmq only - HttpApiUri *string `json:"http_api_uri,omitempty"` - HttpApiUris *[]string `json:"http_api_uris,omitempty"` - Management *string `json:"management,omitempty"` - // REQUIRED - Password *string `json:"password"` - Port *int64 `json:"port,omitempty"` - Uri *string `json:"uri,omitempty"` - Uris *[]string `json:"uris,omitempty"` - // REQUIRED - Username *string `json:"username"` -} diff --git a/services/opensearch/model_rabbit_mq_instance_parameters.go b/services/opensearch/model_rabbit_mq_instance_parameters.go deleted file mode 100644 index bf50a8618..000000000 --- a/services/opensearch/model_rabbit_mq_instance_parameters.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -STACKIT Opensearch API - -The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. - -API version: 1.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package opensearch - -type RabbitMQInstanceParameters struct { - // The unit is milliseconds. - ConsumerTimeout *int64 `json:"consumer_timeout,omitempty"` - EnableMonitoring *bool `json:"enable_monitoring,omitempty"` - // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. - Graphite *string `json:"graphite,omitempty"` - // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. - MaxDiskThreshold *int64 `json:"max_disk_threshold,omitempty"` - // Frequency of metrics being emitted in seconds - MetricsFrequency *int64 `json:"metrics_frequency,omitempty"` - // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. - MetricsPrefix *string `json:"metrics_prefix,omitempty"` - MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` - Plugins *[]string `json:"plugins,omitempty"` - Roles *[]string `json:"roles,omitempty"` - // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - SgwAcl *string `json:"sgw_acl,omitempty"` - Syslog *[]string `json:"syslog,omitempty"` - TlsCiphers *[]string `json:"tls-ciphers,omitempty"` - TlsProtocols *string `json:"tls-protocols,omitempty"` -} diff --git a/services/opensearch/model_redis_credentials.go b/services/opensearch/model_redis_credentials.go deleted file mode 100644 index ec7926e18..000000000 --- a/services/opensearch/model_redis_credentials.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -STACKIT Opensearch API - -The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. - -API version: 1.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package opensearch - -type RedisCredentials struct { - // REQUIRED - Host *string `json:"host"` - Hosts *[]string `json:"hosts,omitempty"` - LoadBalancedHost *string `json:"load_balanced_host,omitempty"` - // REQUIRED - Password *string `json:"password"` - Port *int64 `json:"port,omitempty"` - Uri *string `json:"uri,omitempty"` - // REQUIRED - Username *string `json:"username"` -} diff --git a/services/opensearch/model_redis_instance_parameters.go b/services/opensearch/model_redis_instance_parameters.go deleted file mode 100644 index 7693bceee..000000000 --- a/services/opensearch/model_redis_instance_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -STACKIT Opensearch API - -The STACKIT Opensearch API provides endpoints to list service offerings, manage service instances and service credentials within STACKIT portal projects. - -API version: 1.1.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package opensearch - -type RedisInstanceParameters struct { - // The unit is milliseconds. - DownAfterMilliseconds *int64 `json:"down-after-milliseconds,omitempty"` - EnableMonitoring *bool `json:"enable_monitoring,omitempty"` - // The unit is milliseconds. - FailoverTimeout *int64 `json:"failover-timeout,omitempty"` - // If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. - Graphite *string `json:"graphite,omitempty"` - LazyfreeLazyEviction *string `json:"lazyfree-lazy-eviction,omitempty"` - LazyfreeLazyExpire *string `json:"lazyfree-lazy-expire,omitempty"` - LuaTimeLimit *int64 `json:"lua-time-limit,omitempty"` - // This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. - MaxDiskThreshold *int64 `json:"max_disk_threshold,omitempty"` - Maxclients *int64 `json:"maxclients,omitempty"` - MaxmemoryPolicy *string `json:"maxmemory-policy,omitempty"` - MaxmemorySamples *int64 `json:"maxmemory-samples,omitempty"` - // Frequency of metrics being emitted in seconds - MetricsFrequency *int64 `json:"metrics_frequency,omitempty"` - // Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. - MetricsPrefix *string `json:"metrics_prefix,omitempty"` - // The unit is seconds. - MinReplicasMaxLag *int64 `json:"min_replicas_max_lag,omitempty"` - MonitoringInstanceId *string `json:"monitoring_instance_id,omitempty"` - // The allowed value must include the following characters only: [K,E,g,$,l,s,h,z,x,e,A,t] - NotifyKeyspaceEvents *string `json:"notify-keyspace-events,omitempty"` - // Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - SgwAcl *string `json:"sgw_acl,omitempty"` - // This setting must follow the original Redis configuration for RDB. - Snapshot *string `json:"snapshot,omitempty"` - Syslog *[]string `json:"syslog,omitempty"` - TlsCiphers *[]string `json:"tls-ciphers,omitempty"` - TlsCiphersuites *string `json:"tls-ciphersuites,omitempty"` - TlsProtocols *string `json:"tls-protocols,omitempty"` -} From 65081a18b0757574569951b5bc2e40f669e2430b Mon Sep 17 00:00:00 2001 From: vicentepinto98 Date: Mon, 13 May 2024 11:39:43 +0100 Subject: [PATCH 2/3] Update CHANGELOG --- services/opensearch/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/opensearch/CHANGELOG.md b/services/opensearch/CHANGELOG.md index 9e6a9d1a9..ef3e5e5bb 100644 --- a/services/opensearch/CHANGELOG.md +++ b/services/opensearch/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.14.0 (2024-05-13) + +- **Feature**: New method `GetMetrics` to get the latest metrics for cpu load, memory and disk usage for an instance +- **Feature**: New method `ListBackups` to list the backups for an instance +- **Breaking change**: `ListMetricsResponse` type renamed to `GetMetricsResponse` +- **Breaking change**: Deleted unused data types + ## v0.13.0 (2024-04-11) - **Breaking change**: Fields removed from `RawCredentials`: `RouteServiceUrl`, `SyslogDrainUrl`, `VolumeMounts`. From b395984fa4890961b7863a1533b8485970639038 Mon Sep 17 00:00:00 2001 From: vicentepinto98 Date: Mon, 13 May 2024 15:31:36 +0100 Subject: [PATCH 3/3] Update doc --- services/opensearch/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/opensearch/CHANGELOG.md b/services/opensearch/CHANGELOG.md index ef3e5e5bb..e34d52443 100644 --- a/services/opensearch/CHANGELOG.md +++ b/services/opensearch/CHANGELOG.md @@ -2,7 +2,7 @@ - **Feature**: New method `GetMetrics` to get the latest metrics for cpu load, memory and disk usage for an instance - **Feature**: New method `ListBackups` to list the backups for an instance -- **Breaking change**: `ListMetricsResponse` type renamed to `GetMetricsResponse` +- **Breaking change**: `ListMetricsResponse` type (previously unused) renamed to `GetMetricsResponse` - **Breaking change**: Deleted unused data types ## v0.13.0 (2024-04-11)