From 4be03fd465bcc7dd522c708974d6ffda4df672f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A1udia=20Correia?= <83580976+claudia-correia@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:17:20 +0100 Subject: [PATCH] Update API to MS-112 (#487) * Update ECE_BRANCH * Update API docs * Update client --- Makefile | 2 +- api/apidocs-user.json | 7 ++++ api/apidocs.json | 13 +++++++ .../get_deployment_templates_v2_parameters.go | 37 +++++++++++++++++++ ...elete_instance_configuration_parameters.go | 34 +++++++++++++++++ 5 files changed, 92 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fb695966..186c4a24 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL := /bin/bash export GO111MODULE ?= on export VERSION ?= v1.22.0 export ECE_VERSION ?= $(shell cat ECE_VERSION) -export ECE_BRANCH ?= ms-111 +export ECE_BRANCH ?= ms-112 ECE_DEF_FILE ?= api/version/$(ECE_VERSION).md export GOBIN = $(shell pwd)/bin BINARY := cloud-sdk-go diff --git a/api/apidocs-user.json b/api/apidocs-user.json index d9f22d18..87dc8f93 100644 --- a/api/apidocs-user.json +++ b/api/apidocs-user.json @@ -1435,6 +1435,13 @@ "description" : "If present, it will cause the returned deployment templates to be adapted to return only the elements allowed in that version.", "required" : false, "type" : "string" + }, { + "name" : "hide_deprecated", + "in" : "query", + "description" : "If true, templates flagged as deprecated will NOT be returned.", + "required" : false, + "type" : "boolean", + "default" : false }, { "name" : "region", "in" : "query", diff --git a/api/apidocs.json b/api/apidocs.json index 6dcb1687..065d4011 100644 --- a/api/apidocs.json +++ b/api/apidocs.json @@ -1893,6 +1893,13 @@ "description" : "If present, it will cause the returned deployment templates to be adapted to return only the elements allowed in that version.", "required" : false, "type" : "string" + }, { + "name" : "hide_deprecated", + "in" : "query", + "description" : "If true, templates flagged as deprecated will NOT be returned.", + "required" : false, + "type" : "boolean", + "default" : false }, { "name" : "show_hidden", "in" : "query", @@ -8467,6 +8474,12 @@ "description" : "This is a database-level field, not related to the application-level 'config_version', except as described in the following docs. If specified, checks for conflicts against 'x-cloud-resource-version' from the GET request (the GET's 'config_version' should be left blank if the IC is configuration controlled, ie to get the latest configuration)", "required" : false, "type" : "integer" + }, { + "name" : "only_test_version", + "in" : "query", + "description" : "If true, the testing version (version -1) will be permanently deleted but the latest IC version will remain untouched. Defaults to false", + "required" : false, + "type" : "boolean" } ], "responses" : { "200" : { diff --git a/pkg/client/deployment_templates/get_deployment_templates_v2_parameters.go b/pkg/client/deployment_templates/get_deployment_templates_v2_parameters.go index b5517203..333a03f4 100644 --- a/pkg/client/deployment_templates/get_deployment_templates_v2_parameters.go +++ b/pkg/client/deployment_templates/get_deployment_templates_v2_parameters.go @@ -79,6 +79,12 @@ GetDeploymentTemplatesV2Params contains all the parameters to send to the API en */ type GetDeploymentTemplatesV2Params struct { + /* HideDeprecated. + + If true, templates flagged as deprecated will NOT be returned. + */ + HideDeprecated *bool + /* Metadata. An optional key/value pair in the form of (key:value) that will act as a filter and exclude any templates that do not have a matching metadata item associated. @@ -135,6 +141,8 @@ func (o *GetDeploymentTemplatesV2Params) WithDefaults() *GetDeploymentTemplatesV // All values with no default are reset to their zero value. func (o *GetDeploymentTemplatesV2Params) SetDefaults() { var ( + hideDeprecatedDefault = bool(false) + showHiddenDefault = bool(false) showInstanceConfigurationsDefault = bool(true) @@ -143,6 +151,7 @@ func (o *GetDeploymentTemplatesV2Params) SetDefaults() { ) val := GetDeploymentTemplatesV2Params{ + HideDeprecated: &hideDeprecatedDefault, ShowHidden: &showHiddenDefault, ShowInstanceConfigurations: &showInstanceConfigurationsDefault, ShowMaxZones: &showMaxZonesDefault, @@ -187,6 +196,17 @@ func (o *GetDeploymentTemplatesV2Params) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithHideDeprecated adds the hideDeprecated to the get deployment templates v2 params +func (o *GetDeploymentTemplatesV2Params) WithHideDeprecated(hideDeprecated *bool) *GetDeploymentTemplatesV2Params { + o.SetHideDeprecated(hideDeprecated) + return o +} + +// SetHideDeprecated adds the hideDeprecated to the get deployment templates v2 params +func (o *GetDeploymentTemplatesV2Params) SetHideDeprecated(hideDeprecated *bool) { + o.HideDeprecated = hideDeprecated +} + // WithMetadata adds the metadata to the get deployment templates v2 params func (o *GetDeploymentTemplatesV2Params) WithMetadata(metadata *string) *GetDeploymentTemplatesV2Params { o.SetMetadata(metadata) @@ -261,6 +281,23 @@ func (o *GetDeploymentTemplatesV2Params) WriteToRequest(r runtime.ClientRequest, } var res []error + if o.HideDeprecated != nil { + + // query param hide_deprecated + var qrHideDeprecated bool + + if o.HideDeprecated != nil { + qrHideDeprecated = *o.HideDeprecated + } + qHideDeprecated := swag.FormatBool(qrHideDeprecated) + if qHideDeprecated != "" { + + if err := r.SetQueryParam("hide_deprecated", qHideDeprecated); err != nil { + return err + } + } + } + if o.Metadata != nil { // query param metadata diff --git a/pkg/client/platform_configuration_instances/delete_instance_configuration_parameters.go b/pkg/client/platform_configuration_instances/delete_instance_configuration_parameters.go index 9cda1790..2be11ac8 100644 --- a/pkg/client/platform_configuration_instances/delete_instance_configuration_parameters.go +++ b/pkg/client/platform_configuration_instances/delete_instance_configuration_parameters.go @@ -85,6 +85,12 @@ type DeleteInstanceConfigurationParams struct { */ ID string + /* OnlyTestVersion. + + If true, the testing version (version -1) will be permanently deleted but the latest IC version will remain untouched. Defaults to false + */ + OnlyTestVersion *bool + /* Version. This is a database-level field, not related to the application-level 'config_version', except as described in the following docs. If specified, checks for conflicts against 'x-cloud-resource-version' from the GET request (the GET's 'config_version' should be left blank if the IC is configuration controlled, ie to get the latest configuration) @@ -155,6 +161,17 @@ func (o *DeleteInstanceConfigurationParams) SetID(id string) { o.ID = id } +// WithOnlyTestVersion adds the onlyTestVersion to the delete instance configuration params +func (o *DeleteInstanceConfigurationParams) WithOnlyTestVersion(onlyTestVersion *bool) *DeleteInstanceConfigurationParams { + o.SetOnlyTestVersion(onlyTestVersion) + return o +} + +// SetOnlyTestVersion adds the onlyTestVersion to the delete instance configuration params +func (o *DeleteInstanceConfigurationParams) SetOnlyTestVersion(onlyTestVersion *bool) { + o.OnlyTestVersion = onlyTestVersion +} + // WithVersion adds the version to the delete instance configuration params func (o *DeleteInstanceConfigurationParams) WithVersion(version *int64) *DeleteInstanceConfigurationParams { o.SetVersion(version) @@ -179,6 +196,23 @@ func (o *DeleteInstanceConfigurationParams) WriteToRequest(r runtime.ClientReque return err } + if o.OnlyTestVersion != nil { + + // query param only_test_version + var qrOnlyTestVersion bool + + if o.OnlyTestVersion != nil { + qrOnlyTestVersion = *o.OnlyTestVersion + } + qOnlyTestVersion := swag.FormatBool(qrOnlyTestVersion) + if qOnlyTestVersion != "" { + + if err := r.SetQueryParam("only_test_version", qOnlyTestVersion); err != nil { + return err + } + } + } + if o.Version != nil { // query param version