diff --git a/Makefile b/Makefile index 3918d7b4..5debb452 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL := /bin/bash export GO111MODULE ?= on export VERSION ?= v1.15.0 export ECE_VERSION ?= $(shell cat ECE_VERSION) -export ECE_BRANCH ?= ms-98 +export ECE_BRANCH ?= ms-101 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 33cf1283..e6489d13 100644 --- a/api/apidocs-user.json +++ b/api/apidocs-user.json @@ -2312,6 +2312,13 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -2651,6 +2658,13 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -2824,6 +2838,13 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -3118,6 +3139,13 @@ "required" : false, "type" : "boolean", "default" : true + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -3799,8 +3827,8 @@ "/deployments/{deployment_id}/elasticsearch/{ref_id}/remote-clusters" : { "get" : { "tags" : [ "Deployments" ], - "summary" : "Get remote clusters", - "description" : "Returns the list of remote clusters for the elasticsearch resource.", + "summary" : "Get certificate based remote clusters", + "description" : "Returns the list of certificate based remote clusters for the elasticsearch resource.", "operationId" : "get-deployment-es-resource-remote-clusters", "produces" : [ "application/json" ], "parameters" : [ { @@ -3818,7 +3846,7 @@ } ], "responses" : { "200" : { - "description" : "List of remote clusters for the resource", + "description" : "List of certificate based remote clusters for the resource", "schema" : { "$ref" : "#/definitions/RemoteResources" } @@ -3843,8 +3871,8 @@ }, "put" : { "tags" : [ "Deployments" ], - "summary" : "Set remote clusters", - "description" : "Overwrites or creates the remote clusters for the elasticsearch resource.", + "summary" : "Set certificate based remote clusters", + "description" : "Overwrites or creates the list of certificate based remote clusters for the elasticsearch resource.", "operationId" : "set-deployment-es-resource-remote-clusters", "consumes" : [ "application/json" ], "produces" : [ "application/json" ], @@ -3863,7 +3891,7 @@ }, { "in" : "body", "name" : "body", - "description" : "List of remote clusters for the resource", + "description" : "List of certificate based remote clusters for the resource", "required" : true, "schema" : { "$ref" : "#/definitions/RemoteResources" @@ -3895,6 +3923,130 @@ } } }, + "/deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency" : { + "get" : { + "tags" : [ "Deployments" ], + "summary" : "Get the depedencies of Elasticsearch resource snapshot", + "description" : "Fetches the current dependencies of the snapshot for the Elasticsearch resource.", + "operationId" : "get-deployment-es-resource-snapshot-dependency", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "deployment_id", + "in" : "path", + "description" : "Identifier for the Deployment", + "required" : true, + "type" : "string" + }, { + "name" : "ref_id", + "in" : "path", + "description" : "User-specified RefId for the Resource (or '_main' if there is only one)", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "List of snapshot dependency", + "schema" : { + "$ref" : "#/definitions/SnapshotDependencies" + } + }, + "404" : { + "description" : "* The Deployment specified by {deployment_id} cannot be found. (code: `deployments.deployment_not_found`)\n* The Resource specified by {ref_id} cannot be found. (code: `deployments.deployment_resource_not_found`)", + "headers" : { + "x-cloud-error-codes" : { + "type" : "string", + "description" : "The error codes associated with the response", + "enum" : [ "deployments.deployment_not_found", "deployments.deployment_resource_not_found" ] + } + }, + "schema" : { + "$ref" : "#/definitions/BasicFailedReply" + } + }, + "500" : { + "description" : "We have failed you. (code: `deployments.metadata_internal_error`)", + "headers" : { + "x-cloud-error-codes" : { + "type" : "string", + "description" : "The error codes associated with the response", + "enum" : [ "deployments.metadata_internal_error" ] + } + }, + "schema" : { + "$ref" : "#/definitions/BasicFailedReply" + } + } + }, + "x-doc" : { + "tag" : "Deployment Resources - CRUD" + } + } + }, + "/deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency/{resource_id}" : { + "delete" : { + "tags" : [ "Deployments" ], + "summary" : "Delete a dependency of Elasticsearch resource snapshot", + "description" : "Delete the dependency of a Elasticsearch resource snapshot. Doing so will cause the cloned snapshot to be inaccessible.", + "operationId" : "delete-deployment-es-resource-snapshot-dependency", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "deployment_id", + "in" : "path", + "description" : "Identifier for the Deployment", + "required" : true, + "type" : "string" + }, { + "name" : "ref_id", + "in" : "path", + "description" : "User-specified RefId for the Resource (or '_main' if there is only one)", + "required" : true, + "type" : "string" + }, { + "name" : "resource_id", + "in" : "path", + "description" : "System generated UUID for the Resource (Elasticsearch)", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "", + "schema" : { + "$ref" : "#/definitions/EmptyResponse" + } + }, + "404" : { + "description" : "* The Deployment specified by {deployment_id} cannot be found. (code: `deployments.deployment_not_found`)\n* The Resource specified by {ref_id} cannot be found. (code: `deployments.deployment_resource_not_found`)", + "headers" : { + "x-cloud-error-codes" : { + "type" : "string", + "description" : "The error codes associated with the response", + "enum" : [ "deployments.deployment_not_found", "deployments.deployment_resource_not_found" ] + } + }, + "schema" : { + "$ref" : "#/definitions/BasicFailedReply" + } + }, + "500" : { + "description" : "We have failed you. (code: `deployments.metadata_internal_error`)", + "headers" : { + "x-cloud-error-codes" : { + "type" : "string", + "description" : "The error codes associated with the response", + "enum" : [ "deployments.metadata_internal_error" ] + } + }, + "schema" : { + "$ref" : "#/definitions/BasicFailedReply" + } + } + }, + "x-doc" : { + "tag" : "Deployment Resources - CRUD" + } + } + }, "/deployments/{deployment_id}/enterprise_search/{ref_id}" : { "get" : { "tags" : [ "Deployments" ], @@ -3956,6 +4108,13 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -4057,6 +4216,13 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -4165,6 +4331,13 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -8991,7 +9164,7 @@ }, "DiscreteSizes" : { "type" : "object", - "required" : [ "default_size", "resource", "sizes" ], + "required" : [ "sizes" ], "properties" : { "sizes" : { "type" : "array", @@ -9008,7 +9181,7 @@ }, "resource" : { "type" : "string", - "description" : "The unit that each size represents", + "description" : "The unit that each size represents. If not specified, it will default to 'memory'.", "enum" : [ "memory", "storage" ] } }, @@ -10739,7 +10912,7 @@ }, "InstanceConfigurationInfo" : { "type" : "object", - "required" : [ "discrete_sizes", "instance_type", "name" ], + "required" : [ "discrete_sizes", "name" ], "properties" : { "id" : { "type" : "string", @@ -10760,12 +10933,12 @@ }, "instance_type" : { "type" : "string", - "description" : "The type of instance", + "description" : "The type of instance. For instance configurations where the type is specified in the 'id', the default value of 'instance_type' will be automatically inferred.", "enum" : [ "elasticsearch", "kibana", "apm", "integrations_server", "appsearch", "enterprise_search" ] }, "node_types" : { "type" : "array", - "description" : "Node types (master, data) for the instance", + "description" : "Node types (master, data) for the instance. For instance configurations where the type (and tier) is specified in the 'id', the default value of 'node_types' will be automatically inferred.", "items" : { "type" : "string" } @@ -10817,7 +10990,7 @@ "description" : "Tells the infrastructure that the instance should be considered as permanently down when deciding how to migrate data to new nodes. If left blank then the system will automatically decide (currently: will treat the instances as up)" } }, - "description" : "The request that specifies the Elasticsearch instances, Kibana instances, and APM Servers to move to allocators as part of the upgrade plan." + "description" : "The request that specifies the Elasticsearch or stateless (eg Kibana) instances to move to allocators as part of the upgrade plan. When used in conjunction with '\\_\\_all\\_\\_' (roll all instances as a single unit) strategy, these instances are not restarted, which can sometimes enable recovery plans when these instances are boot-looping." }, "InstanceOverrides" : { "type" : "object", @@ -10958,7 +11131,7 @@ "apm_server_mode" : { "type" : "string", "description" : "The mode APM is operating in.", - "enum" : [ "Standalone", "Managed" ] + "enum" : [ "standalone", "managed" ] } }, "description" : "The overview information for the Integrations Server." @@ -12604,6 +12777,35 @@ }, "description" : "Line Item" }, + "SnapshotDependencies" : { + "type" : "object", + "required" : [ "resources" ], + "properties" : { + "resources" : { + "type" : "array", + "description" : "Client name that use to access additional resource", + "items" : { + "$ref" : "#/definitions/SnapshotDependency" + } + } + }, + "description" : "The additional resource of Elasticsearch cluster." + }, + "SnapshotDependency" : { + "type" : "object", + "required" : [ "client_name", "resource_id" ], + "properties" : { + "resource_id" : { + "type" : "string", + "description" : "Resource (Elasticsearch cluster) id" + }, + "client_name" : { + "type" : "string", + "description" : "Client name that use to access additional resource" + } + }, + "description" : "The additional resource of Elasticsearch cluster." + }, "SnapshotStatusInfo" : { "type" : "object", "required" : [ "count", "healthy", "recent_success" ], diff --git a/api/apidocs.json b/api/apidocs.json index 484f432d..693f5168 100644 --- a/api/apidocs.json +++ b/api/apidocs.json @@ -3040,6 +3040,13 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -3469,6 +3476,13 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -3642,6 +3656,13 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -3936,6 +3957,13 @@ "required" : false, "type" : "boolean", "default" : true + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -4546,7 +4574,7 @@ "description" : "When `true`, moves the specified instances and ignores the changes for the cluster state.", "required" : false, "type" : "boolean", - "default" : false + "default" : true }, { "name" : "force_move", "in" : "query", @@ -4730,8 +4758,8 @@ "/deployments/{deployment_id}/elasticsearch/{ref_id}/remote-clusters" : { "get" : { "tags" : [ "Deployments" ], - "summary" : "Get remote clusters", - "description" : "Returns the list of remote clusters for the elasticsearch resource.", + "summary" : "Get certificate based remote clusters", + "description" : "Returns the list of certificate based remote clusters for the elasticsearch resource.", "operationId" : "get-deployment-es-resource-remote-clusters", "produces" : [ "application/json" ], "parameters" : [ { @@ -4749,7 +4777,7 @@ } ], "responses" : { "200" : { - "description" : "List of remote clusters for the resource", + "description" : "List of certificate based remote clusters for the resource", "schema" : { "$ref" : "#/definitions/RemoteResources" } @@ -4774,8 +4802,8 @@ }, "put" : { "tags" : [ "Deployments" ], - "summary" : "Set remote clusters", - "description" : "Overwrites or creates the remote clusters for the elasticsearch resource.", + "summary" : "Set certificate based remote clusters", + "description" : "Overwrites or creates the list of certificate based remote clusters for the elasticsearch resource.", "operationId" : "set-deployment-es-resource-remote-clusters", "consumes" : [ "application/json" ], "produces" : [ "application/json" ], @@ -4794,7 +4822,7 @@ }, { "in" : "body", "name" : "body", - "description" : "List of remote clusters for the resource", + "description" : "List of certificate based remote clusters for the resource", "required" : true, "schema" : { "$ref" : "#/definitions/RemoteResources" @@ -4826,6 +4854,130 @@ } } }, + "/deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency" : { + "get" : { + "tags" : [ "Deployments" ], + "summary" : "Get the depedencies of Elasticsearch resource snapshot", + "description" : "Fetches the current dependencies of the snapshot for the Elasticsearch resource.", + "operationId" : "get-deployment-es-resource-snapshot-dependency", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "deployment_id", + "in" : "path", + "description" : "Identifier for the Deployment", + "required" : true, + "type" : "string" + }, { + "name" : "ref_id", + "in" : "path", + "description" : "User-specified RefId for the Resource (or '_main' if there is only one)", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "List of snapshot dependency", + "schema" : { + "$ref" : "#/definitions/SnapshotDependencies" + } + }, + "404" : { + "description" : "* The Deployment specified by {deployment_id} cannot be found. (code: `deployments.deployment_not_found`)\n* The Resource specified by {ref_id} cannot be found. (code: `deployments.deployment_resource_not_found`)", + "headers" : { + "x-cloud-error-codes" : { + "type" : "string", + "description" : "The error codes associated with the response", + "enum" : [ "deployments.deployment_not_found", "deployments.deployment_resource_not_found" ] + } + }, + "schema" : { + "$ref" : "#/definitions/BasicFailedReply" + } + }, + "500" : { + "description" : "We have failed you. (code: `deployments.metadata_internal_error`)", + "headers" : { + "x-cloud-error-codes" : { + "type" : "string", + "description" : "The error codes associated with the response", + "enum" : [ "deployments.metadata_internal_error" ] + } + }, + "schema" : { + "$ref" : "#/definitions/BasicFailedReply" + } + } + }, + "x-doc" : { + "tag" : "Deployment Resources - CRUD" + } + } + }, + "/deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency/{resource_id}" : { + "delete" : { + "tags" : [ "Deployments" ], + "summary" : "Delete a dependency of Elasticsearch resource snapshot", + "description" : "Delete the dependency of a Elasticsearch resource snapshot. Doing so will cause the cloned snapshot to be inaccessible.", + "operationId" : "delete-deployment-es-resource-snapshot-dependency", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "deployment_id", + "in" : "path", + "description" : "Identifier for the Deployment", + "required" : true, + "type" : "string" + }, { + "name" : "ref_id", + "in" : "path", + "description" : "User-specified RefId for the Resource (or '_main' if there is only one)", + "required" : true, + "type" : "string" + }, { + "name" : "resource_id", + "in" : "path", + "description" : "System generated UUID for the Resource (Elasticsearch)", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "", + "schema" : { + "$ref" : "#/definitions/EmptyResponse" + } + }, + "404" : { + "description" : "* The Deployment specified by {deployment_id} cannot be found. (code: `deployments.deployment_not_found`)\n* The Resource specified by {ref_id} cannot be found. (code: `deployments.deployment_resource_not_found`)", + "headers" : { + "x-cloud-error-codes" : { + "type" : "string", + "description" : "The error codes associated with the response", + "enum" : [ "deployments.deployment_not_found", "deployments.deployment_resource_not_found" ] + } + }, + "schema" : { + "$ref" : "#/definitions/BasicFailedReply" + } + }, + "500" : { + "description" : "We have failed you. (code: `deployments.metadata_internal_error`)", + "headers" : { + "x-cloud-error-codes" : { + "type" : "string", + "description" : "The error codes associated with the response", + "enum" : [ "deployments.metadata_internal_error" ] + } + }, + "schema" : { + "$ref" : "#/definitions/BasicFailedReply" + } + } + }, + "x-doc" : { + "tag" : "Deployment Resources - CRUD" + } + } + }, "/deployments/{deployment_id}/enterprise_search/{ref_id}" : { "get" : { "tags" : [ "Deployments" ], @@ -4887,6 +5039,13 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -5028,6 +5187,13 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -5136,6 +5302,13 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "clear_transient", + "in" : "query", + "description" : "If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "200" : { @@ -5735,6 +5908,14 @@ "description" : "User-specified RefId for the Resource (or '_main' if there is only one).", "required" : true, "type" : "string" + }, { + "name" : "mode", + "in" : "query", + "description" : "Capture mode - whether to obtain all the diagnostics data or the lightweight, essential-only subset of it. Applicable only to Elasticsearch, ignored for any other components which have just one capture mode implemented.", + "required" : false, + "type" : "string", + "default" : "Full", + "enum" : [ "full", "light" ] } ], "responses" : { "200" : { @@ -20637,7 +20818,7 @@ }, "DiscreteSizes" : { "type" : "object", - "required" : [ "default_size", "resource", "sizes" ], + "required" : [ "sizes" ], "properties" : { "sizes" : { "type" : "array", @@ -20654,7 +20835,7 @@ }, "resource" : { "type" : "string", - "description" : "The unit that each size represents", + "description" : "The unit that each size represents. If not specified, it will default to 'memory'.", "enum" : [ "memory", "storage" ] } }, @@ -22655,7 +22836,7 @@ }, "InstanceConfiguration" : { "type" : "object", - "required" : [ "discrete_sizes", "instance_type", "name" ], + "required" : [ "discrete_sizes", "name" ], "properties" : { "id" : { "type" : "string", @@ -22676,12 +22857,12 @@ }, "instance_type" : { "type" : "string", - "description" : "The type of instance", + "description" : "The type of instance. For instance configurations where the type is specified in the 'id', the default value of 'instance_type' will be automatically inferred.", "enum" : [ "elasticsearch", "kibana", "apm", "integrations_server", "appsearch", "enterprise_search" ] }, "node_types" : { "type" : "array", - "description" : "Node types (master, data) for the instance", + "description" : "Node types (master, data) for the instance. For instance configurations where the type (and tier) is specified in the 'id', the default value of 'node_types' will be automatically inferred.", "items" : { "type" : "string" } @@ -22728,7 +22909,7 @@ }, "InstanceConfigurationInfo" : { "type" : "object", - "required" : [ "discrete_sizes", "instance_type", "name" ], + "required" : [ "discrete_sizes", "name" ], "properties" : { "id" : { "type" : "string", @@ -22749,12 +22930,12 @@ }, "instance_type" : { "type" : "string", - "description" : "The type of instance", + "description" : "The type of instance. For instance configurations where the type is specified in the 'id', the default value of 'instance_type' will be automatically inferred.", "enum" : [ "elasticsearch", "kibana", "apm", "integrations_server", "appsearch", "enterprise_search" ] }, "node_types" : { "type" : "array", - "description" : "Node types (master, data) for the instance", + "description" : "Node types (master, data) for the instance. For instance configurations where the type (and tier) is specified in the 'id', the default value of 'node_types' will be automatically inferred.", "items" : { "type" : "string" } @@ -22806,7 +22987,7 @@ "description" : "Tells the infrastructure that the instance should be considered as permanently down when deciding how to migrate data to new nodes. If left blank then the system will automatically decide (currently: will treat the instances as up)" } }, - "description" : "The request that specifies the Elasticsearch instances, Kibana instances, and APM Servers to move to allocators as part of the upgrade plan." + "description" : "The request that specifies the Elasticsearch or stateless (eg Kibana) instances to move to allocators as part of the upgrade plan. When used in conjunction with '\\_\\_all\\_\\_' (roll all instances as a single unit) strategy, these instances are not restarted, which can sometimes enable recovery plans when these instances are boot-looping." }, "InstanceOverrides" : { "type" : "object", @@ -22984,7 +23165,7 @@ "apm_server_mode" : { "type" : "string", "description" : "The mode APM is operating in.", - "enum" : [ "Standalone", "Managed" ] + "enum" : [ "standalone", "managed" ] } }, "description" : "The overview information for the Integrations Server." @@ -26808,6 +26989,35 @@ }, "description" : "Line Item" }, + "SnapshotDependencies" : { + "type" : "object", + "required" : [ "resources" ], + "properties" : { + "resources" : { + "type" : "array", + "description" : "Client name that use to access additional resource", + "items" : { + "$ref" : "#/definitions/SnapshotDependency" + } + } + }, + "description" : "The additional resource of Elasticsearch cluster." + }, + "SnapshotDependency" : { + "type" : "object", + "required" : [ "client_name", "resource_id" ], + "properties" : { + "resource_id" : { + "type" : "string", + "description" : "Resource (Elasticsearch cluster) id" + }, + "client_name" : { + "type" : "string", + "description" : "Client name that use to access additional resource" + } + }, + "description" : "The additional resource of Elasticsearch cluster." + }, "SnapshotRepositoryConfiguration" : { "type" : "object", "required" : [ "settings", "type" ], @@ -27471,11 +27681,16 @@ }, "TokenResponse" : { "type" : "object", - "required" : [ "token" ], + "required" : [ "session_expiration_time", "token" ], "properties" : { "token" : { "type" : "string", "description" : "The authorization bearer token that you use in subsequent requests" + }, + "session_expiration_time" : { + "type" : "string", + "format" : "date-time", + "description" : "The time that the session token will expire" } }, "description" : "The response value after a login without redirect configured, or after elevated permissions are enabled or disabled." diff --git a/api/version/3.7.0.md b/api/version/3.7.0.md index 2bb36b21..46f75131 100644 --- a/api/version/3.7.0.md +++ b/api/version/3.7.0.md @@ -1,6 +1,6 @@ # ECE 3.7.0 Command Declaration -Total of 277 commands found +Total of 279 commands found ## Command list @@ -43,6 +43,7 @@ Total of 277 commands found - `delete-config-store-option` (**DELETE** /platform/configuration/store/{config_option_id}) - `delete-constructor-logging-settings` (**DELETE** /platform/infrastructure/constructors/{constructor_id}/logging_settings) - `delete-coordinator-candidate` (**DELETE** /platform/infrastructure/coordinators/candidates/{coordinator_candidate_id}) +- `delete-deployment-es-resource-snapshot-dependency` (**DELETE** /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency/{resource_id}) - `delete-deployment-note` (**DELETE** /deployments/{deployment_id}/notes/{note_id}) - `delete-deployment-resource-proxy-requests` (**DELETE** /deployments/{deployment_id}/{resource_kind}/{ref_id}/proxy/{proxy_path}) - `delete-deployment-stateless-resource` (**DELETE** /deployments/{deployment_id}/{stateless_resource_kind}/{ref_id}) @@ -115,6 +116,7 @@ Total of 277 commands found - `get-deployment-es-resource-info` (**GET** /deployments/{deployment_id}/elasticsearch/{ref_id}) - `get-deployment-es-resource-keystore` (**GET** /deployments/{deployment_id}/elasticsearch/{ref_id}/keystore) - `get-deployment-es-resource-remote-clusters` (**GET** /deployments/{deployment_id}/elasticsearch/{ref_id}/remote-clusters) +- `get-deployment-es-resource-snapshot-dependency` (**GET** /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency) - `get-deployment-heap-dumps` (**GET** /deployments/{deployment_id}/heap_dumps) - `get-deployment-integrations-server-resource-info` (**GET** /deployments/{deployment_id}/integrations_server/{ref_id}) - `get-deployment-kib-resource-info` (**GET** /deployments/{deployment_id}/kibana/{ref_id}) diff --git a/pkg/api/platformapi/instanceconfigapi/config_test.go b/pkg/api/platformapi/instanceconfigapi/config_test.go index c58ee961..1ae520d8 100644 --- a/pkg/api/platformapi/instanceconfigapi/config_test.go +++ b/pkg/api/platformapi/instanceconfigapi/config_test.go @@ -47,12 +47,12 @@ func TestNewConfig(t *testing.T) { ID: "kibana", Description: "Instance configuration to be used for Kibana", Name: ec.String("kibana"), - InstanceType: ec.String("kibana"), + InstanceType: "kibana", StorageMultiplier: float64(4), NodeTypes: []string{}, DiscreteSizes: &models.DiscreteSizes{ - DefaultSize: ec.Int32(1024), - Resource: ec.String("memory"), + DefaultSize: 1024, + Resource: "memory", Sizes: []int32{ 1024, 2048, diff --git a/pkg/api/platformapi/instanceconfigapi/create_test.go b/pkg/api/platformapi/instanceconfigapi/create_test.go index 8bf2609e..185219eb 100644 --- a/pkg/api/platformapi/instanceconfigapi/create_test.go +++ b/pkg/api/platformapi/instanceconfigapi/create_test.go @@ -62,12 +62,12 @@ func TestCreate(t *testing.T) { Config: &models.InstanceConfiguration{ Description: "Instance configuration to be used for Kibana", Name: ec.String("kibana"), - InstanceType: ec.String("kibana"), + InstanceType: "kibana", StorageMultiplier: float64(4), NodeTypes: []string{}, DiscreteSizes: &models.DiscreteSizes{ - DefaultSize: ec.Int32(1024), - Resource: ec.String("memory"), + DefaultSize: 1024, + Resource: "memory", Sizes: []int32{ 1024, 2048, @@ -100,12 +100,12 @@ func TestCreate(t *testing.T) { ID: "kibana", Description: "Instance configuration to be used for Kibana", Name: ec.String("kibana"), - InstanceType: ec.String("kibana"), + InstanceType: "kibana", StorageMultiplier: float64(4), NodeTypes: []string{}, DiscreteSizes: &models.DiscreteSizes{ - DefaultSize: ec.Int32(1024), - Resource: ec.String("memory"), + DefaultSize: 1024, + Resource: "memory", Sizes: []int32{ 1024, 2048, @@ -125,12 +125,12 @@ func TestCreate(t *testing.T) { ID: "kibana", Description: "Instance configuration to be used for Kibana", Name: ec.String("kibana"), - InstanceType: ec.String("kibana"), + InstanceType: "kibana", StorageMultiplier: float64(4), NodeTypes: []string{}, DiscreteSizes: &models.DiscreteSizes{ - DefaultSize: ec.Int32(1024), - Resource: ec.String("memory"), + DefaultSize: 1024, + Resource: "memory", Sizes: []int32{ 1024, 2048, diff --git a/pkg/api/platformapi/instanceconfigapi/get_test.go b/pkg/api/platformapi/instanceconfigapi/get_test.go index 1b14ab06..ecf958f8 100644 --- a/pkg/api/platformapi/instanceconfigapi/get_test.go +++ b/pkg/api/platformapi/instanceconfigapi/get_test.go @@ -64,12 +64,12 @@ func TestGet(t *testing.T) { ID: "data.highstorage", Description: "Instance configuration to be used for a higher disk/memory ratio", Name: ec.String("data.highstorage"), - InstanceType: ec.String("elasticsearch"), + InstanceType: "elasticsearch", StorageMultiplier: float64(32), NodeTypes: []string{"data", "ingest", "master"}, DiscreteSizes: &models.DiscreteSizes{ - DefaultSize: ec.Int32(1024), - Resource: ec.String("memory"), + DefaultSize: 1024, + Resource: "memory", Sizes: []int32{ 1024, 2048, @@ -106,11 +106,11 @@ func TestGet(t *testing.T) { ID: "kibana", Description: "Instance configuration to be used for Kibana", Name: ec.String("kibana"), - InstanceType: ec.String("kibana"), + InstanceType: "kibana", StorageMultiplier: float64(4), DiscreteSizes: &models.DiscreteSizes{ - DefaultSize: ec.Int32(1024), - Resource: ec.String("memory"), + DefaultSize: 1024, + Resource: "memory", Sizes: []int32{ 1024, 2048, diff --git a/pkg/api/platformapi/instanceconfigapi/list_test.go b/pkg/api/platformapi/instanceconfigapi/list_test.go index cf5beb91..b3bab5e3 100644 --- a/pkg/api/platformapi/instanceconfigapi/list_test.go +++ b/pkg/api/platformapi/instanceconfigapi/list_test.go @@ -66,12 +66,12 @@ func TestList(t *testing.T) { ID: "data.highstorage", Description: "Instance configuration to be used for a higher disk/memory ratio", Name: ec.String("data.highstorage"), - InstanceType: ec.String("elasticsearch"), + InstanceType: "elasticsearch", StorageMultiplier: float64(32), NodeTypes: []string{"data", "ingest", "master"}, DiscreteSizes: &models.DiscreteSizes{ - DefaultSize: ec.Int32(1024), - Resource: ec.String("memory"), + DefaultSize: 1024, + Resource: "memory", Sizes: []int32{ 1024, 2048, @@ -89,11 +89,11 @@ func TestList(t *testing.T) { ID: "kibana", Description: "Instance configuration to be used for Kibana", Name: ec.String("kibana"), - InstanceType: ec.String("kibana"), + InstanceType: "kibana", StorageMultiplier: float64(4), DiscreteSizes: &models.DiscreteSizes{ - DefaultSize: ec.Int32(1024), - Resource: ec.String("memory"), + DefaultSize: 1024, + Resource: "memory", Sizes: []int32{ 1024, 2048, diff --git a/pkg/api/platformapi/instanceconfigapi/update_test.go b/pkg/api/platformapi/instanceconfigapi/update_test.go index bd4f6f05..3590e608 100644 --- a/pkg/api/platformapi/instanceconfigapi/update_test.go +++ b/pkg/api/platformapi/instanceconfigapi/update_test.go @@ -63,12 +63,12 @@ func TestUpdate(t *testing.T) { ID: "kibana", Description: "Instance configuration to be used for Kibana", Name: ec.String("kibana"), - InstanceType: ec.String("kibana"), + InstanceType: "kibana", StorageMultiplier: float64(4), NodeTypes: []string{}, DiscreteSizes: &models.DiscreteSizes{ - DefaultSize: ec.Int32(1024), - Resource: ec.String("memory"), + DefaultSize: 1024, + Resource: "memory", Sizes: []int32{ 1024, 2048, @@ -88,12 +88,12 @@ func TestUpdate(t *testing.T) { ID: "kibana", Description: "Instance configuration to be used for Kibana", Name: ec.String("kibana"), - InstanceType: ec.String("kibana"), + InstanceType: "kibana", StorageMultiplier: float64(4), NodeTypes: []string{}, DiscreteSizes: &models.DiscreteSizes{ - DefaultSize: ec.Int32(1024), - Resource: ec.String("memory"), + DefaultSize: 1024, + Resource: "memory", Sizes: []int32{ 1024, 2048, diff --git a/pkg/client/deployments/capture_deployment_resource_diagnostics_parameters.go b/pkg/client/deployments/capture_deployment_resource_diagnostics_parameters.go index 41fd6531..0f3cb094 100644 --- a/pkg/client/deployments/capture_deployment_resource_diagnostics_parameters.go +++ b/pkg/client/deployments/capture_deployment_resource_diagnostics_parameters.go @@ -84,6 +84,14 @@ type CaptureDeploymentResourceDiagnosticsParams struct { */ DeploymentID string + /* Mode. + + Capture mode - whether to obtain all the diagnostics data or the lightweight, essential-only subset of it. Applicable only to Elasticsearch, ignored for any other components which have just one capture mode implemented. + + Default: "Full" + */ + Mode *string + /* RefID. User-specified RefId for the Resource (or '_main' if there is only one). @@ -113,7 +121,18 @@ func (o *CaptureDeploymentResourceDiagnosticsParams) WithDefaults() *CaptureDepl // // All values with no default are reset to their zero value. func (o *CaptureDeploymentResourceDiagnosticsParams) SetDefaults() { - // no default values defined for this parameter + var ( + modeDefault = string("Full") + ) + + val := CaptureDeploymentResourceDiagnosticsParams{ + Mode: &modeDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val } // WithTimeout adds the timeout to the capture deployment resource diagnostics params @@ -160,6 +179,17 @@ func (o *CaptureDeploymentResourceDiagnosticsParams) SetDeploymentID(deploymentI o.DeploymentID = deploymentID } +// WithMode adds the mode to the capture deployment resource diagnostics params +func (o *CaptureDeploymentResourceDiagnosticsParams) WithMode(mode *string) *CaptureDeploymentResourceDiagnosticsParams { + o.SetMode(mode) + return o +} + +// SetMode adds the mode to the capture deployment resource diagnostics params +func (o *CaptureDeploymentResourceDiagnosticsParams) SetMode(mode *string) { + o.Mode = mode +} + // WithRefID adds the refID to the capture deployment resource diagnostics params func (o *CaptureDeploymentResourceDiagnosticsParams) WithRefID(refID string) *CaptureDeploymentResourceDiagnosticsParams { o.SetRefID(refID) @@ -195,6 +225,23 @@ func (o *CaptureDeploymentResourceDiagnosticsParams) WriteToRequest(r runtime.Cl return err } + if o.Mode != nil { + + // query param mode + var qrMode string + + if o.Mode != nil { + qrMode = *o.Mode + } + qMode := qrMode + if qMode != "" { + + if err := r.SetQueryParam("mode", qMode); err != nil { + return err + } + } + } + // path param ref_id if err := r.SetPathParam("ref_id", o.RefID); err != nil { return err diff --git a/pkg/client/deployments/delete_deployment_es_resource_snapshot_dependency_parameters.go b/pkg/client/deployments/delete_deployment_es_resource_snapshot_dependency_parameters.go new file mode 100644 index 00000000..dea75246 --- /dev/null +++ b/pkg/client/deployments/delete_deployment_es_resource_snapshot_dependency_parameters.go @@ -0,0 +1,212 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package deployments + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteDeploymentEsResourceSnapshotDependencyParams creates a new DeleteDeploymentEsResourceSnapshotDependencyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteDeploymentEsResourceSnapshotDependencyParams() *DeleteDeploymentEsResourceSnapshotDependencyParams { + return &DeleteDeploymentEsResourceSnapshotDependencyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteDeploymentEsResourceSnapshotDependencyParamsWithTimeout creates a new DeleteDeploymentEsResourceSnapshotDependencyParams object +// with the ability to set a timeout on a request. +func NewDeleteDeploymentEsResourceSnapshotDependencyParamsWithTimeout(timeout time.Duration) *DeleteDeploymentEsResourceSnapshotDependencyParams { + return &DeleteDeploymentEsResourceSnapshotDependencyParams{ + timeout: timeout, + } +} + +// NewDeleteDeploymentEsResourceSnapshotDependencyParamsWithContext creates a new DeleteDeploymentEsResourceSnapshotDependencyParams object +// with the ability to set a context for a request. +func NewDeleteDeploymentEsResourceSnapshotDependencyParamsWithContext(ctx context.Context) *DeleteDeploymentEsResourceSnapshotDependencyParams { + return &DeleteDeploymentEsResourceSnapshotDependencyParams{ + Context: ctx, + } +} + +// NewDeleteDeploymentEsResourceSnapshotDependencyParamsWithHTTPClient creates a new DeleteDeploymentEsResourceSnapshotDependencyParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteDeploymentEsResourceSnapshotDependencyParamsWithHTTPClient(client *http.Client) *DeleteDeploymentEsResourceSnapshotDependencyParams { + return &DeleteDeploymentEsResourceSnapshotDependencyParams{ + HTTPClient: client, + } +} + +/* +DeleteDeploymentEsResourceSnapshotDependencyParams contains all the parameters to send to the API endpoint + + for the delete deployment es resource snapshot dependency operation. + + Typically these are written to a http.Request. +*/ +type DeleteDeploymentEsResourceSnapshotDependencyParams struct { + + /* DeploymentID. + + Identifier for the Deployment + */ + DeploymentID string + + /* RefID. + + User-specified RefId for the Resource (or '_main' if there is only one) + */ + RefID string + + /* ResourceID. + + System generated UUID for the Resource (Elasticsearch) + */ + ResourceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete deployment es resource snapshot dependency params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) WithDefaults() *DeleteDeploymentEsResourceSnapshotDependencyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete deployment es resource snapshot dependency params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete deployment es resource snapshot dependency params +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) WithTimeout(timeout time.Duration) *DeleteDeploymentEsResourceSnapshotDependencyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete deployment es resource snapshot dependency params +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete deployment es resource snapshot dependency params +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) WithContext(ctx context.Context) *DeleteDeploymentEsResourceSnapshotDependencyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete deployment es resource snapshot dependency params +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete deployment es resource snapshot dependency params +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) WithHTTPClient(client *http.Client) *DeleteDeploymentEsResourceSnapshotDependencyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete deployment es resource snapshot dependency params +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDeploymentID adds the deploymentID to the delete deployment es resource snapshot dependency params +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) WithDeploymentID(deploymentID string) *DeleteDeploymentEsResourceSnapshotDependencyParams { + o.SetDeploymentID(deploymentID) + return o +} + +// SetDeploymentID adds the deploymentId to the delete deployment es resource snapshot dependency params +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) SetDeploymentID(deploymentID string) { + o.DeploymentID = deploymentID +} + +// WithRefID adds the refID to the delete deployment es resource snapshot dependency params +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) WithRefID(refID string) *DeleteDeploymentEsResourceSnapshotDependencyParams { + o.SetRefID(refID) + return o +} + +// SetRefID adds the refId to the delete deployment es resource snapshot dependency params +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) SetRefID(refID string) { + o.RefID = refID +} + +// WithResourceID adds the resourceID to the delete deployment es resource snapshot dependency params +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) WithResourceID(resourceID string) *DeleteDeploymentEsResourceSnapshotDependencyParams { + o.SetResourceID(resourceID) + return o +} + +// SetResourceID adds the resourceId to the delete deployment es resource snapshot dependency params +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) SetResourceID(resourceID string) { + o.ResourceID = resourceID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteDeploymentEsResourceSnapshotDependencyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param deployment_id + if err := r.SetPathParam("deployment_id", o.DeploymentID); err != nil { + return err + } + + // path param ref_id + if err := r.SetPathParam("ref_id", o.RefID); err != nil { + return err + } + + // path param resource_id + if err := r.SetPathParam("resource_id", o.ResourceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/client/deployments/delete_deployment_es_resource_snapshot_dependency_responses.go b/pkg/client/deployments/delete_deployment_es_resource_snapshot_dependency_responses.go new file mode 100644 index 00000000..1cf813df --- /dev/null +++ b/pkg/client/deployments/delete_deployment_es_resource_snapshot_dependency_responses.go @@ -0,0 +1,292 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package deployments + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/elastic/cloud-sdk-go/pkg/models" +) + +// DeleteDeploymentEsResourceSnapshotDependencyReader is a Reader for the DeleteDeploymentEsResourceSnapshotDependency structure. +type DeleteDeploymentEsResourceSnapshotDependencyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteDeploymentEsResourceSnapshotDependencyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteDeploymentEsResourceSnapshotDependencyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewDeleteDeploymentEsResourceSnapshotDependencyNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteDeploymentEsResourceSnapshotDependencyInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteDeploymentEsResourceSnapshotDependencyOK creates a DeleteDeploymentEsResourceSnapshotDependencyOK with default headers values +func NewDeleteDeploymentEsResourceSnapshotDependencyOK() *DeleteDeploymentEsResourceSnapshotDependencyOK { + return &DeleteDeploymentEsResourceSnapshotDependencyOK{} +} + +/* +DeleteDeploymentEsResourceSnapshotDependencyOK describes a response with status code 200, with default header values. + +DeleteDeploymentEsResourceSnapshotDependencyOK delete deployment es resource snapshot dependency o k +*/ +type DeleteDeploymentEsResourceSnapshotDependencyOK struct { + Payload models.EmptyResponse +} + +// IsSuccess returns true when this delete deployment es resource snapshot dependency o k response has a 2xx status code +func (o *DeleteDeploymentEsResourceSnapshotDependencyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete deployment es resource snapshot dependency o k response has a 3xx status code +func (o *DeleteDeploymentEsResourceSnapshotDependencyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete deployment es resource snapshot dependency o k response has a 4xx status code +func (o *DeleteDeploymentEsResourceSnapshotDependencyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete deployment es resource snapshot dependency o k response has a 5xx status code +func (o *DeleteDeploymentEsResourceSnapshotDependencyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete deployment es resource snapshot dependency o k response a status code equal to that given +func (o *DeleteDeploymentEsResourceSnapshotDependencyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete deployment es resource snapshot dependency o k response +func (o *DeleteDeploymentEsResourceSnapshotDependencyOK) Code() int { + return 200 +} + +func (o *DeleteDeploymentEsResourceSnapshotDependencyOK) Error() string { + return fmt.Sprintf("[DELETE /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency/{resource_id}][%d] deleteDeploymentEsResourceSnapshotDependencyOK %+v", 200, o.Payload) +} + +func (o *DeleteDeploymentEsResourceSnapshotDependencyOK) String() string { + return fmt.Sprintf("[DELETE /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency/{resource_id}][%d] deleteDeploymentEsResourceSnapshotDependencyOK %+v", 200, o.Payload) +} + +func (o *DeleteDeploymentEsResourceSnapshotDependencyOK) GetPayload() models.EmptyResponse { + return o.Payload +} + +func (o *DeleteDeploymentEsResourceSnapshotDependencyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteDeploymentEsResourceSnapshotDependencyNotFound creates a DeleteDeploymentEsResourceSnapshotDependencyNotFound with default headers values +func NewDeleteDeploymentEsResourceSnapshotDependencyNotFound() *DeleteDeploymentEsResourceSnapshotDependencyNotFound { + return &DeleteDeploymentEsResourceSnapshotDependencyNotFound{} +} + +/* + DeleteDeploymentEsResourceSnapshotDependencyNotFound describes a response with status code 404, with default header values. + + * The Deployment specified by {deployment_id} cannot be found. (code: `deployments.deployment_not_found`) + +* The Resource specified by {ref_id} cannot be found. (code: `deployments.deployment_resource_not_found`) +*/ +type DeleteDeploymentEsResourceSnapshotDependencyNotFound struct { + + /* The error codes associated with the response + */ + XCloudErrorCodes string + + Payload *models.BasicFailedReply +} + +// IsSuccess returns true when this delete deployment es resource snapshot dependency not found response has a 2xx status code +func (o *DeleteDeploymentEsResourceSnapshotDependencyNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete deployment es resource snapshot dependency not found response has a 3xx status code +func (o *DeleteDeploymentEsResourceSnapshotDependencyNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete deployment es resource snapshot dependency not found response has a 4xx status code +func (o *DeleteDeploymentEsResourceSnapshotDependencyNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete deployment es resource snapshot dependency not found response has a 5xx status code +func (o *DeleteDeploymentEsResourceSnapshotDependencyNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this delete deployment es resource snapshot dependency not found response a status code equal to that given +func (o *DeleteDeploymentEsResourceSnapshotDependencyNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the delete deployment es resource snapshot dependency not found response +func (o *DeleteDeploymentEsResourceSnapshotDependencyNotFound) Code() int { + return 404 +} + +func (o *DeleteDeploymentEsResourceSnapshotDependencyNotFound) Error() string { + return fmt.Sprintf("[DELETE /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency/{resource_id}][%d] deleteDeploymentEsResourceSnapshotDependencyNotFound %+v", 404, o.Payload) +} + +func (o *DeleteDeploymentEsResourceSnapshotDependencyNotFound) String() string { + return fmt.Sprintf("[DELETE /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency/{resource_id}][%d] deleteDeploymentEsResourceSnapshotDependencyNotFound %+v", 404, o.Payload) +} + +func (o *DeleteDeploymentEsResourceSnapshotDependencyNotFound) GetPayload() *models.BasicFailedReply { + return o.Payload +} + +func (o *DeleteDeploymentEsResourceSnapshotDependencyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-cloud-error-codes + hdrXCloudErrorCodes := response.GetHeader("x-cloud-error-codes") + + if hdrXCloudErrorCodes != "" { + o.XCloudErrorCodes = hdrXCloudErrorCodes + } + + o.Payload = new(models.BasicFailedReply) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteDeploymentEsResourceSnapshotDependencyInternalServerError creates a DeleteDeploymentEsResourceSnapshotDependencyInternalServerError with default headers values +func NewDeleteDeploymentEsResourceSnapshotDependencyInternalServerError() *DeleteDeploymentEsResourceSnapshotDependencyInternalServerError { + return &DeleteDeploymentEsResourceSnapshotDependencyInternalServerError{} +} + +/* +DeleteDeploymentEsResourceSnapshotDependencyInternalServerError describes a response with status code 500, with default header values. + +We have failed you. (code: `deployments.metadata_internal_error`) +*/ +type DeleteDeploymentEsResourceSnapshotDependencyInternalServerError struct { + + /* The error codes associated with the response + */ + XCloudErrorCodes string + + Payload *models.BasicFailedReply +} + +// IsSuccess returns true when this delete deployment es resource snapshot dependency internal server error response has a 2xx status code +func (o *DeleteDeploymentEsResourceSnapshotDependencyInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete deployment es resource snapshot dependency internal server error response has a 3xx status code +func (o *DeleteDeploymentEsResourceSnapshotDependencyInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete deployment es resource snapshot dependency internal server error response has a 4xx status code +func (o *DeleteDeploymentEsResourceSnapshotDependencyInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete deployment es resource snapshot dependency internal server error response has a 5xx status code +func (o *DeleteDeploymentEsResourceSnapshotDependencyInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this delete deployment es resource snapshot dependency internal server error response a status code equal to that given +func (o *DeleteDeploymentEsResourceSnapshotDependencyInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the delete deployment es resource snapshot dependency internal server error response +func (o *DeleteDeploymentEsResourceSnapshotDependencyInternalServerError) Code() int { + return 500 +} + +func (o *DeleteDeploymentEsResourceSnapshotDependencyInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency/{resource_id}][%d] deleteDeploymentEsResourceSnapshotDependencyInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteDeploymentEsResourceSnapshotDependencyInternalServerError) String() string { + return fmt.Sprintf("[DELETE /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency/{resource_id}][%d] deleteDeploymentEsResourceSnapshotDependencyInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteDeploymentEsResourceSnapshotDependencyInternalServerError) GetPayload() *models.BasicFailedReply { + return o.Payload +} + +func (o *DeleteDeploymentEsResourceSnapshotDependencyInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-cloud-error-codes + hdrXCloudErrorCodes := response.GetHeader("x-cloud-error-codes") + + if hdrXCloudErrorCodes != "" { + o.XCloudErrorCodes = hdrXCloudErrorCodes + } + + o.Payload = new(models.BasicFailedReply) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/client/deployments/deployments_client.go b/pkg/client/deployments/deployments_client.go index eab9072a..b95a37ad 100644 --- a/pkg/client/deployments/deployments_client.go +++ b/pkg/client/deployments/deployments_client.go @@ -59,6 +59,8 @@ type ClientService interface { DeleteDeployment(params *DeleteDeploymentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteDeploymentOK, error) + DeleteDeploymentEsResourceSnapshotDependency(params *DeleteDeploymentEsResourceSnapshotDependencyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteDeploymentEsResourceSnapshotDependencyOK, error) + DeleteDeploymentResourceProxyRequests(params *DeleteDeploymentResourceProxyRequestsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteDeploymentResourceProxyRequestsOK, error) DeleteDeploymentStatelessResource(params *DeleteDeploymentStatelessResourceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteDeploymentStatelessResourceOK, error) @@ -93,6 +95,8 @@ type ClientService interface { GetDeploymentEsResourceRemoteClusters(params *GetDeploymentEsResourceRemoteClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeploymentEsResourceRemoteClustersOK, error) + GetDeploymentEsResourceSnapshotDependency(params *GetDeploymentEsResourceSnapshotDependencyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeploymentEsResourceSnapshotDependencyOK, error) + GetDeploymentHeapDumps(params *GetDeploymentHeapDumpsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeploymentHeapDumpsOK, error) GetDeploymentIntegrationsServerResourceInfo(params *GetDeploymentIntegrationsServerResourceInfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeploymentIntegrationsServerResourceInfoOK, error) @@ -423,6 +427,47 @@ func (a *Client) DeleteDeployment(params *DeleteDeploymentParams, authInfo runti panic(msg) } +/* +DeleteDeploymentEsResourceSnapshotDependency deletes a dependency of elasticsearch resource snapshot + +Delete the dependency of a Elasticsearch resource snapshot. Doing so will cause the cloned snapshot to be inaccessible. +*/ +func (a *Client) DeleteDeploymentEsResourceSnapshotDependency(params *DeleteDeploymentEsResourceSnapshotDependencyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteDeploymentEsResourceSnapshotDependencyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteDeploymentEsResourceSnapshotDependencyParams() + } + op := &runtime.ClientOperation{ + ID: "delete-deployment-es-resource-snapshot-dependency", + Method: "DELETE", + PathPattern: "/deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency/{resource_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteDeploymentEsResourceSnapshotDependencyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteDeploymentEsResourceSnapshotDependencyOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for delete-deployment-es-resource-snapshot-dependency: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* DeleteDeploymentResourceProxyRequests proxies HTTP d e l e t e request @@ -1080,9 +1125,9 @@ func (a *Client) GetDeploymentEsResourceKeystore(params *GetDeploymentEsResource } /* -GetDeploymentEsResourceRemoteClusters gets remote clusters +GetDeploymentEsResourceRemoteClusters gets certificate based remote clusters -Returns the list of remote clusters for the elasticsearch resource. +Returns the list of certificate based remote clusters for the elasticsearch resource. */ func (a *Client) GetDeploymentEsResourceRemoteClusters(params *GetDeploymentEsResourceRemoteClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeploymentEsResourceRemoteClustersOK, error) { // TODO: Validate the params before sending @@ -1120,6 +1165,47 @@ func (a *Client) GetDeploymentEsResourceRemoteClusters(params *GetDeploymentEsRe panic(msg) } +/* +GetDeploymentEsResourceSnapshotDependency gets the depedencies of elasticsearch resource snapshot + +Fetches the current dependencies of the snapshot for the Elasticsearch resource. +*/ +func (a *Client) GetDeploymentEsResourceSnapshotDependency(params *GetDeploymentEsResourceSnapshotDependencyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDeploymentEsResourceSnapshotDependencyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDeploymentEsResourceSnapshotDependencyParams() + } + op := &runtime.ClientOperation{ + ID: "get-deployment-es-resource-snapshot-dependency", + Method: "GET", + PathPattern: "/deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetDeploymentEsResourceSnapshotDependencyReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetDeploymentEsResourceSnapshotDependencyOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for get-deployment-es-resource-snapshot-dependency: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetDeploymentHeapDumps gets details about heap dumps for a deployment @@ -2065,9 +2151,9 @@ func (a *Client) SetDeploymentEsResourceKeystore(params *SetDeploymentEsResource } /* -SetDeploymentEsResourceRemoteClusters sets remote clusters +SetDeploymentEsResourceRemoteClusters sets certificate based remote clusters -Overwrites or creates the remote clusters for the elasticsearch resource. +Overwrites or creates the list of certificate based remote clusters for the elasticsearch resource. */ func (a *Client) SetDeploymentEsResourceRemoteClusters(params *SetDeploymentEsResourceRemoteClustersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*SetDeploymentEsResourceRemoteClustersAccepted, error) { // TODO: Validate the params before sending diff --git a/pkg/client/deployments/get_deployment_apm_resource_info_parameters.go b/pkg/client/deployments/get_deployment_apm_resource_info_parameters.go index 3d643ce5..064788e1 100644 --- a/pkg/client/deployments/get_deployment_apm_resource_info_parameters.go +++ b/pkg/client/deployments/get_deployment_apm_resource_info_parameters.go @@ -79,6 +79,12 @@ GetDeploymentApmResourceInfoParams contains all the parameters to send to the AP */ type GetDeploymentApmResourceInfoParams struct { + /* ClearTransient. + + If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update + */ + ClearTransient *bool + /* DeploymentID. Identifier for the Deployment @@ -147,6 +153,8 @@ func (o *GetDeploymentApmResourceInfoParams) WithDefaults() *GetDeploymentApmRes // All values with no default are reset to their zero value. func (o *GetDeploymentApmResourceInfoParams) SetDefaults() { var ( + clearTransientDefault = bool(false) + showMetadataDefault = bool(false) showPlanDefaultsDefault = bool(false) @@ -161,6 +169,7 @@ func (o *GetDeploymentApmResourceInfoParams) SetDefaults() { ) val := GetDeploymentApmResourceInfoParams{ + ClearTransient: &clearTransientDefault, ShowMetadata: &showMetadataDefault, ShowPlanDefaults: &showPlanDefaultsDefault, ShowPlanHistory: &showPlanHistoryDefault, @@ -208,6 +217,17 @@ func (o *GetDeploymentApmResourceInfoParams) SetHTTPClient(client *http.Client) o.HTTPClient = client } +// WithClearTransient adds the clearTransient to the get deployment apm resource info params +func (o *GetDeploymentApmResourceInfoParams) WithClearTransient(clearTransient *bool) *GetDeploymentApmResourceInfoParams { + o.SetClearTransient(clearTransient) + return o +} + +// SetClearTransient adds the clearTransient to the get deployment apm resource info params +func (o *GetDeploymentApmResourceInfoParams) SetClearTransient(clearTransient *bool) { + o.ClearTransient = clearTransient +} + // WithDeploymentID adds the deploymentID to the get deployment apm resource info params func (o *GetDeploymentApmResourceInfoParams) WithDeploymentID(deploymentID string) *GetDeploymentApmResourceInfoParams { o.SetDeploymentID(deploymentID) @@ -304,6 +324,23 @@ func (o *GetDeploymentApmResourceInfoParams) WriteToRequest(r runtime.ClientRequ } var res []error + if o.ClearTransient != nil { + + // query param clear_transient + var qrClearTransient bool + + if o.ClearTransient != nil { + qrClearTransient = *o.ClearTransient + } + qClearTransient := swag.FormatBool(qrClearTransient) + if qClearTransient != "" { + + if err := r.SetQueryParam("clear_transient", qClearTransient); err != nil { + return err + } + } + } + // path param deployment_id if err := r.SetPathParam("deployment_id", o.DeploymentID); err != nil { return err diff --git a/pkg/client/deployments/get_deployment_appsearch_resource_info_parameters.go b/pkg/client/deployments/get_deployment_appsearch_resource_info_parameters.go index 4e432f76..4babdf5b 100644 --- a/pkg/client/deployments/get_deployment_appsearch_resource_info_parameters.go +++ b/pkg/client/deployments/get_deployment_appsearch_resource_info_parameters.go @@ -79,6 +79,12 @@ GetDeploymentAppsearchResourceInfoParams contains all the parameters to send to */ type GetDeploymentAppsearchResourceInfoParams struct { + /* ClearTransient. + + If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update + */ + ClearTransient *bool + /* DeploymentID. Identifier for the Deployment @@ -147,6 +153,8 @@ func (o *GetDeploymentAppsearchResourceInfoParams) WithDefaults() *GetDeployment // All values with no default are reset to their zero value. func (o *GetDeploymentAppsearchResourceInfoParams) SetDefaults() { var ( + clearTransientDefault = bool(false) + showMetadataDefault = bool(false) showPlanDefaultsDefault = bool(false) @@ -161,6 +169,7 @@ func (o *GetDeploymentAppsearchResourceInfoParams) SetDefaults() { ) val := GetDeploymentAppsearchResourceInfoParams{ + ClearTransient: &clearTransientDefault, ShowMetadata: &showMetadataDefault, ShowPlanDefaults: &showPlanDefaultsDefault, ShowPlanHistory: &showPlanHistoryDefault, @@ -208,6 +217,17 @@ func (o *GetDeploymentAppsearchResourceInfoParams) SetHTTPClient(client *http.Cl o.HTTPClient = client } +// WithClearTransient adds the clearTransient to the get deployment appsearch resource info params +func (o *GetDeploymentAppsearchResourceInfoParams) WithClearTransient(clearTransient *bool) *GetDeploymentAppsearchResourceInfoParams { + o.SetClearTransient(clearTransient) + return o +} + +// SetClearTransient adds the clearTransient to the get deployment appsearch resource info params +func (o *GetDeploymentAppsearchResourceInfoParams) SetClearTransient(clearTransient *bool) { + o.ClearTransient = clearTransient +} + // WithDeploymentID adds the deploymentID to the get deployment appsearch resource info params func (o *GetDeploymentAppsearchResourceInfoParams) WithDeploymentID(deploymentID string) *GetDeploymentAppsearchResourceInfoParams { o.SetDeploymentID(deploymentID) @@ -304,6 +324,23 @@ func (o *GetDeploymentAppsearchResourceInfoParams) WriteToRequest(r runtime.Clie } var res []error + if o.ClearTransient != nil { + + // query param clear_transient + var qrClearTransient bool + + if o.ClearTransient != nil { + qrClearTransient = *o.ClearTransient + } + qClearTransient := swag.FormatBool(qrClearTransient) + if qClearTransient != "" { + + if err := r.SetQueryParam("clear_transient", qClearTransient); err != nil { + return err + } + } + } + // path param deployment_id if err := r.SetPathParam("deployment_id", o.DeploymentID); err != nil { return err diff --git a/pkg/client/deployments/get_deployment_enterprise_search_resource_info_parameters.go b/pkg/client/deployments/get_deployment_enterprise_search_resource_info_parameters.go index 91ad13bd..769bc5c7 100644 --- a/pkg/client/deployments/get_deployment_enterprise_search_resource_info_parameters.go +++ b/pkg/client/deployments/get_deployment_enterprise_search_resource_info_parameters.go @@ -79,6 +79,12 @@ GetDeploymentEnterpriseSearchResourceInfoParams contains all the parameters to s */ type GetDeploymentEnterpriseSearchResourceInfoParams struct { + /* ClearTransient. + + If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update + */ + ClearTransient *bool + /* DeploymentID. Identifier for the Deployment @@ -147,6 +153,8 @@ func (o *GetDeploymentEnterpriseSearchResourceInfoParams) WithDefaults() *GetDep // All values with no default are reset to their zero value. func (o *GetDeploymentEnterpriseSearchResourceInfoParams) SetDefaults() { var ( + clearTransientDefault = bool(false) + showMetadataDefault = bool(false) showPlanDefaultsDefault = bool(false) @@ -161,6 +169,7 @@ func (o *GetDeploymentEnterpriseSearchResourceInfoParams) SetDefaults() { ) val := GetDeploymentEnterpriseSearchResourceInfoParams{ + ClearTransient: &clearTransientDefault, ShowMetadata: &showMetadataDefault, ShowPlanDefaults: &showPlanDefaultsDefault, ShowPlanHistory: &showPlanHistoryDefault, @@ -208,6 +217,17 @@ func (o *GetDeploymentEnterpriseSearchResourceInfoParams) SetHTTPClient(client * o.HTTPClient = client } +// WithClearTransient adds the clearTransient to the get deployment enterprise search resource info params +func (o *GetDeploymentEnterpriseSearchResourceInfoParams) WithClearTransient(clearTransient *bool) *GetDeploymentEnterpriseSearchResourceInfoParams { + o.SetClearTransient(clearTransient) + return o +} + +// SetClearTransient adds the clearTransient to the get deployment enterprise search resource info params +func (o *GetDeploymentEnterpriseSearchResourceInfoParams) SetClearTransient(clearTransient *bool) { + o.ClearTransient = clearTransient +} + // WithDeploymentID adds the deploymentID to the get deployment enterprise search resource info params func (o *GetDeploymentEnterpriseSearchResourceInfoParams) WithDeploymentID(deploymentID string) *GetDeploymentEnterpriseSearchResourceInfoParams { o.SetDeploymentID(deploymentID) @@ -304,6 +324,23 @@ func (o *GetDeploymentEnterpriseSearchResourceInfoParams) WriteToRequest(r runti } var res []error + if o.ClearTransient != nil { + + // query param clear_transient + var qrClearTransient bool + + if o.ClearTransient != nil { + qrClearTransient = *o.ClearTransient + } + qClearTransient := swag.FormatBool(qrClearTransient) + if qClearTransient != "" { + + if err := r.SetQueryParam("clear_transient", qClearTransient); err != nil { + return err + } + } + } + // path param deployment_id if err := r.SetPathParam("deployment_id", o.DeploymentID); err != nil { return err diff --git a/pkg/client/deployments/get_deployment_es_resource_info_parameters.go b/pkg/client/deployments/get_deployment_es_resource_info_parameters.go index 3f5a4e19..15acea54 100644 --- a/pkg/client/deployments/get_deployment_es_resource_info_parameters.go +++ b/pkg/client/deployments/get_deployment_es_resource_info_parameters.go @@ -79,6 +79,12 @@ GetDeploymentEsResourceInfoParams contains all the parameters to send to the API */ type GetDeploymentEsResourceInfoParams struct { + /* ClearTransient. + + If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update + */ + ClearTransient *bool + /* ConvertLegacyPlans. If showing plans, whether to leave pre-2.0.0 plans in their legacy format (the default), or whether to update them to 2.0.x+ format (if 'true'). @@ -173,6 +179,8 @@ func (o *GetDeploymentEsResourceInfoParams) WithDefaults() *GetDeploymentEsResou // All values with no default are reset to their zero value. func (o *GetDeploymentEsResourceInfoParams) SetDefaults() { var ( + clearTransientDefault = bool(false) + convertLegacyPlansDefault = bool(false) enrichWithTemplateDefault = bool(true) @@ -195,6 +203,7 @@ func (o *GetDeploymentEsResourceInfoParams) SetDefaults() { ) val := GetDeploymentEsResourceInfoParams{ + ClearTransient: &clearTransientDefault, ConvertLegacyPlans: &convertLegacyPlansDefault, EnrichWithTemplate: &enrichWithTemplateDefault, ShowMetadata: &showMetadataDefault, @@ -246,6 +255,17 @@ func (o *GetDeploymentEsResourceInfoParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithClearTransient adds the clearTransient to the get deployment es resource info params +func (o *GetDeploymentEsResourceInfoParams) WithClearTransient(clearTransient *bool) *GetDeploymentEsResourceInfoParams { + o.SetClearTransient(clearTransient) + return o +} + +// SetClearTransient adds the clearTransient to the get deployment es resource info params +func (o *GetDeploymentEsResourceInfoParams) SetClearTransient(clearTransient *bool) { + o.ClearTransient = clearTransient +} + // WithConvertLegacyPlans adds the convertLegacyPlans to the get deployment es resource info params func (o *GetDeploymentEsResourceInfoParams) WithConvertLegacyPlans(convertLegacyPlans *bool) *GetDeploymentEsResourceInfoParams { o.SetConvertLegacyPlans(convertLegacyPlans) @@ -386,6 +406,23 @@ func (o *GetDeploymentEsResourceInfoParams) WriteToRequest(r runtime.ClientReque } var res []error + if o.ClearTransient != nil { + + // query param clear_transient + var qrClearTransient bool + + if o.ClearTransient != nil { + qrClearTransient = *o.ClearTransient + } + qClearTransient := swag.FormatBool(qrClearTransient) + if qClearTransient != "" { + + if err := r.SetQueryParam("clear_transient", qClearTransient); err != nil { + return err + } + } + } + if o.ConvertLegacyPlans != nil { // query param convert_legacy_plans diff --git a/pkg/client/deployments/get_deployment_es_resource_remote_clusters_responses.go b/pkg/client/deployments/get_deployment_es_resource_remote_clusters_responses.go index 2fb30b2e..763611be 100644 --- a/pkg/client/deployments/get_deployment_es_resource_remote_clusters_responses.go +++ b/pkg/client/deployments/get_deployment_es_resource_remote_clusters_responses.go @@ -65,7 +65,7 @@ func NewGetDeploymentEsResourceRemoteClustersOK() *GetDeploymentEsResourceRemote /* GetDeploymentEsResourceRemoteClustersOK describes a response with status code 200, with default header values. -List of remote clusters for the resource +List of certificate based remote clusters for the resource */ type GetDeploymentEsResourceRemoteClustersOK struct { Payload *models.RemoteResources diff --git a/pkg/client/deployments/get_deployment_es_resource_snapshot_dependency_parameters.go b/pkg/client/deployments/get_deployment_es_resource_snapshot_dependency_parameters.go new file mode 100644 index 00000000..3af87c99 --- /dev/null +++ b/pkg/client/deployments/get_deployment_es_resource_snapshot_dependency_parameters.go @@ -0,0 +1,190 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package deployments + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetDeploymentEsResourceSnapshotDependencyParams creates a new GetDeploymentEsResourceSnapshotDependencyParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetDeploymentEsResourceSnapshotDependencyParams() *GetDeploymentEsResourceSnapshotDependencyParams { + return &GetDeploymentEsResourceSnapshotDependencyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDeploymentEsResourceSnapshotDependencyParamsWithTimeout creates a new GetDeploymentEsResourceSnapshotDependencyParams object +// with the ability to set a timeout on a request. +func NewGetDeploymentEsResourceSnapshotDependencyParamsWithTimeout(timeout time.Duration) *GetDeploymentEsResourceSnapshotDependencyParams { + return &GetDeploymentEsResourceSnapshotDependencyParams{ + timeout: timeout, + } +} + +// NewGetDeploymentEsResourceSnapshotDependencyParamsWithContext creates a new GetDeploymentEsResourceSnapshotDependencyParams object +// with the ability to set a context for a request. +func NewGetDeploymentEsResourceSnapshotDependencyParamsWithContext(ctx context.Context) *GetDeploymentEsResourceSnapshotDependencyParams { + return &GetDeploymentEsResourceSnapshotDependencyParams{ + Context: ctx, + } +} + +// NewGetDeploymentEsResourceSnapshotDependencyParamsWithHTTPClient creates a new GetDeploymentEsResourceSnapshotDependencyParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDeploymentEsResourceSnapshotDependencyParamsWithHTTPClient(client *http.Client) *GetDeploymentEsResourceSnapshotDependencyParams { + return &GetDeploymentEsResourceSnapshotDependencyParams{ + HTTPClient: client, + } +} + +/* +GetDeploymentEsResourceSnapshotDependencyParams contains all the parameters to send to the API endpoint + + for the get deployment es resource snapshot dependency operation. + + Typically these are written to a http.Request. +*/ +type GetDeploymentEsResourceSnapshotDependencyParams struct { + + /* DeploymentID. + + Identifier for the Deployment + */ + DeploymentID string + + /* RefID. + + User-specified RefId for the Resource (or '_main' if there is only one) + */ + RefID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get deployment es resource snapshot dependency params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentEsResourceSnapshotDependencyParams) WithDefaults() *GetDeploymentEsResourceSnapshotDependencyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get deployment es resource snapshot dependency params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDeploymentEsResourceSnapshotDependencyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get deployment es resource snapshot dependency params +func (o *GetDeploymentEsResourceSnapshotDependencyParams) WithTimeout(timeout time.Duration) *GetDeploymentEsResourceSnapshotDependencyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get deployment es resource snapshot dependency params +func (o *GetDeploymentEsResourceSnapshotDependencyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get deployment es resource snapshot dependency params +func (o *GetDeploymentEsResourceSnapshotDependencyParams) WithContext(ctx context.Context) *GetDeploymentEsResourceSnapshotDependencyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get deployment es resource snapshot dependency params +func (o *GetDeploymentEsResourceSnapshotDependencyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get deployment es resource snapshot dependency params +func (o *GetDeploymentEsResourceSnapshotDependencyParams) WithHTTPClient(client *http.Client) *GetDeploymentEsResourceSnapshotDependencyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get deployment es resource snapshot dependency params +func (o *GetDeploymentEsResourceSnapshotDependencyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDeploymentID adds the deploymentID to the get deployment es resource snapshot dependency params +func (o *GetDeploymentEsResourceSnapshotDependencyParams) WithDeploymentID(deploymentID string) *GetDeploymentEsResourceSnapshotDependencyParams { + o.SetDeploymentID(deploymentID) + return o +} + +// SetDeploymentID adds the deploymentId to the get deployment es resource snapshot dependency params +func (o *GetDeploymentEsResourceSnapshotDependencyParams) SetDeploymentID(deploymentID string) { + o.DeploymentID = deploymentID +} + +// WithRefID adds the refID to the get deployment es resource snapshot dependency params +func (o *GetDeploymentEsResourceSnapshotDependencyParams) WithRefID(refID string) *GetDeploymentEsResourceSnapshotDependencyParams { + o.SetRefID(refID) + return o +} + +// SetRefID adds the refId to the get deployment es resource snapshot dependency params +func (o *GetDeploymentEsResourceSnapshotDependencyParams) SetRefID(refID string) { + o.RefID = refID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDeploymentEsResourceSnapshotDependencyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param deployment_id + if err := r.SetPathParam("deployment_id", o.DeploymentID); err != nil { + return err + } + + // path param ref_id + if err := r.SetPathParam("ref_id", o.RefID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/client/deployments/get_deployment_es_resource_snapshot_dependency_responses.go b/pkg/client/deployments/get_deployment_es_resource_snapshot_dependency_responses.go new file mode 100644 index 00000000..07466534 --- /dev/null +++ b/pkg/client/deployments/get_deployment_es_resource_snapshot_dependency_responses.go @@ -0,0 +1,294 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package deployments + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/elastic/cloud-sdk-go/pkg/models" +) + +// GetDeploymentEsResourceSnapshotDependencyReader is a Reader for the GetDeploymentEsResourceSnapshotDependency structure. +type GetDeploymentEsResourceSnapshotDependencyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDeploymentEsResourceSnapshotDependencyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDeploymentEsResourceSnapshotDependencyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetDeploymentEsResourceSnapshotDependencyNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetDeploymentEsResourceSnapshotDependencyInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetDeploymentEsResourceSnapshotDependencyOK creates a GetDeploymentEsResourceSnapshotDependencyOK with default headers values +func NewGetDeploymentEsResourceSnapshotDependencyOK() *GetDeploymentEsResourceSnapshotDependencyOK { + return &GetDeploymentEsResourceSnapshotDependencyOK{} +} + +/* +GetDeploymentEsResourceSnapshotDependencyOK describes a response with status code 200, with default header values. + +List of snapshot dependency +*/ +type GetDeploymentEsResourceSnapshotDependencyOK struct { + Payload *models.SnapshotDependencies +} + +// IsSuccess returns true when this get deployment es resource snapshot dependency o k response has a 2xx status code +func (o *GetDeploymentEsResourceSnapshotDependencyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get deployment es resource snapshot dependency o k response has a 3xx status code +func (o *GetDeploymentEsResourceSnapshotDependencyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get deployment es resource snapshot dependency o k response has a 4xx status code +func (o *GetDeploymentEsResourceSnapshotDependencyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get deployment es resource snapshot dependency o k response has a 5xx status code +func (o *GetDeploymentEsResourceSnapshotDependencyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get deployment es resource snapshot dependency o k response a status code equal to that given +func (o *GetDeploymentEsResourceSnapshotDependencyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get deployment es resource snapshot dependency o k response +func (o *GetDeploymentEsResourceSnapshotDependencyOK) Code() int { + return 200 +} + +func (o *GetDeploymentEsResourceSnapshotDependencyOK) Error() string { + return fmt.Sprintf("[GET /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency][%d] getDeploymentEsResourceSnapshotDependencyOK %+v", 200, o.Payload) +} + +func (o *GetDeploymentEsResourceSnapshotDependencyOK) String() string { + return fmt.Sprintf("[GET /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency][%d] getDeploymentEsResourceSnapshotDependencyOK %+v", 200, o.Payload) +} + +func (o *GetDeploymentEsResourceSnapshotDependencyOK) GetPayload() *models.SnapshotDependencies { + return o.Payload +} + +func (o *GetDeploymentEsResourceSnapshotDependencyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SnapshotDependencies) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDeploymentEsResourceSnapshotDependencyNotFound creates a GetDeploymentEsResourceSnapshotDependencyNotFound with default headers values +func NewGetDeploymentEsResourceSnapshotDependencyNotFound() *GetDeploymentEsResourceSnapshotDependencyNotFound { + return &GetDeploymentEsResourceSnapshotDependencyNotFound{} +} + +/* + GetDeploymentEsResourceSnapshotDependencyNotFound describes a response with status code 404, with default header values. + + * The Deployment specified by {deployment_id} cannot be found. (code: `deployments.deployment_not_found`) + +* The Resource specified by {ref_id} cannot be found. (code: `deployments.deployment_resource_not_found`) +*/ +type GetDeploymentEsResourceSnapshotDependencyNotFound struct { + + /* The error codes associated with the response + */ + XCloudErrorCodes string + + Payload *models.BasicFailedReply +} + +// IsSuccess returns true when this get deployment es resource snapshot dependency not found response has a 2xx status code +func (o *GetDeploymentEsResourceSnapshotDependencyNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get deployment es resource snapshot dependency not found response has a 3xx status code +func (o *GetDeploymentEsResourceSnapshotDependencyNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get deployment es resource snapshot dependency not found response has a 4xx status code +func (o *GetDeploymentEsResourceSnapshotDependencyNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get deployment es resource snapshot dependency not found response has a 5xx status code +func (o *GetDeploymentEsResourceSnapshotDependencyNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get deployment es resource snapshot dependency not found response a status code equal to that given +func (o *GetDeploymentEsResourceSnapshotDependencyNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get deployment es resource snapshot dependency not found response +func (o *GetDeploymentEsResourceSnapshotDependencyNotFound) Code() int { + return 404 +} + +func (o *GetDeploymentEsResourceSnapshotDependencyNotFound) Error() string { + return fmt.Sprintf("[GET /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency][%d] getDeploymentEsResourceSnapshotDependencyNotFound %+v", 404, o.Payload) +} + +func (o *GetDeploymentEsResourceSnapshotDependencyNotFound) String() string { + return fmt.Sprintf("[GET /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency][%d] getDeploymentEsResourceSnapshotDependencyNotFound %+v", 404, o.Payload) +} + +func (o *GetDeploymentEsResourceSnapshotDependencyNotFound) GetPayload() *models.BasicFailedReply { + return o.Payload +} + +func (o *GetDeploymentEsResourceSnapshotDependencyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-cloud-error-codes + hdrXCloudErrorCodes := response.GetHeader("x-cloud-error-codes") + + if hdrXCloudErrorCodes != "" { + o.XCloudErrorCodes = hdrXCloudErrorCodes + } + + o.Payload = new(models.BasicFailedReply) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDeploymentEsResourceSnapshotDependencyInternalServerError creates a GetDeploymentEsResourceSnapshotDependencyInternalServerError with default headers values +func NewGetDeploymentEsResourceSnapshotDependencyInternalServerError() *GetDeploymentEsResourceSnapshotDependencyInternalServerError { + return &GetDeploymentEsResourceSnapshotDependencyInternalServerError{} +} + +/* +GetDeploymentEsResourceSnapshotDependencyInternalServerError describes a response with status code 500, with default header values. + +We have failed you. (code: `deployments.metadata_internal_error`) +*/ +type GetDeploymentEsResourceSnapshotDependencyInternalServerError struct { + + /* The error codes associated with the response + */ + XCloudErrorCodes string + + Payload *models.BasicFailedReply +} + +// IsSuccess returns true when this get deployment es resource snapshot dependency internal server error response has a 2xx status code +func (o *GetDeploymentEsResourceSnapshotDependencyInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get deployment es resource snapshot dependency internal server error response has a 3xx status code +func (o *GetDeploymentEsResourceSnapshotDependencyInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get deployment es resource snapshot dependency internal server error response has a 4xx status code +func (o *GetDeploymentEsResourceSnapshotDependencyInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get deployment es resource snapshot dependency internal server error response has a 5xx status code +func (o *GetDeploymentEsResourceSnapshotDependencyInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get deployment es resource snapshot dependency internal server error response a status code equal to that given +func (o *GetDeploymentEsResourceSnapshotDependencyInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get deployment es resource snapshot dependency internal server error response +func (o *GetDeploymentEsResourceSnapshotDependencyInternalServerError) Code() int { + return 500 +} + +func (o *GetDeploymentEsResourceSnapshotDependencyInternalServerError) Error() string { + return fmt.Sprintf("[GET /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency][%d] getDeploymentEsResourceSnapshotDependencyInternalServerError %+v", 500, o.Payload) +} + +func (o *GetDeploymentEsResourceSnapshotDependencyInternalServerError) String() string { + return fmt.Sprintf("[GET /deployments/{deployment_id}/elasticsearch/{ref_id}/snapshot/dependency][%d] getDeploymentEsResourceSnapshotDependencyInternalServerError %+v", 500, o.Payload) +} + +func (o *GetDeploymentEsResourceSnapshotDependencyInternalServerError) GetPayload() *models.BasicFailedReply { + return o.Payload +} + +func (o *GetDeploymentEsResourceSnapshotDependencyInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header x-cloud-error-codes + hdrXCloudErrorCodes := response.GetHeader("x-cloud-error-codes") + + if hdrXCloudErrorCodes != "" { + o.XCloudErrorCodes = hdrXCloudErrorCodes + } + + o.Payload = new(models.BasicFailedReply) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/client/deployments/get_deployment_integrations_server_resource_info_parameters.go b/pkg/client/deployments/get_deployment_integrations_server_resource_info_parameters.go index 9591c206..b7be4259 100644 --- a/pkg/client/deployments/get_deployment_integrations_server_resource_info_parameters.go +++ b/pkg/client/deployments/get_deployment_integrations_server_resource_info_parameters.go @@ -79,6 +79,12 @@ GetDeploymentIntegrationsServerResourceInfoParams contains all the parameters to */ type GetDeploymentIntegrationsServerResourceInfoParams struct { + /* ClearTransient. + + If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update + */ + ClearTransient *bool + /* DeploymentID. Identifier for the Deployment @@ -147,6 +153,8 @@ func (o *GetDeploymentIntegrationsServerResourceInfoParams) WithDefaults() *GetD // All values with no default are reset to their zero value. func (o *GetDeploymentIntegrationsServerResourceInfoParams) SetDefaults() { var ( + clearTransientDefault = bool(false) + showMetadataDefault = bool(false) showPlanDefaultsDefault = bool(false) @@ -161,6 +169,7 @@ func (o *GetDeploymentIntegrationsServerResourceInfoParams) SetDefaults() { ) val := GetDeploymentIntegrationsServerResourceInfoParams{ + ClearTransient: &clearTransientDefault, ShowMetadata: &showMetadataDefault, ShowPlanDefaults: &showPlanDefaultsDefault, ShowPlanHistory: &showPlanHistoryDefault, @@ -208,6 +217,17 @@ func (o *GetDeploymentIntegrationsServerResourceInfoParams) SetHTTPClient(client o.HTTPClient = client } +// WithClearTransient adds the clearTransient to the get deployment integrations server resource info params +func (o *GetDeploymentIntegrationsServerResourceInfoParams) WithClearTransient(clearTransient *bool) *GetDeploymentIntegrationsServerResourceInfoParams { + o.SetClearTransient(clearTransient) + return o +} + +// SetClearTransient adds the clearTransient to the get deployment integrations server resource info params +func (o *GetDeploymentIntegrationsServerResourceInfoParams) SetClearTransient(clearTransient *bool) { + o.ClearTransient = clearTransient +} + // WithDeploymentID adds the deploymentID to the get deployment integrations server resource info params func (o *GetDeploymentIntegrationsServerResourceInfoParams) WithDeploymentID(deploymentID string) *GetDeploymentIntegrationsServerResourceInfoParams { o.SetDeploymentID(deploymentID) @@ -304,6 +324,23 @@ func (o *GetDeploymentIntegrationsServerResourceInfoParams) WriteToRequest(r run } var res []error + if o.ClearTransient != nil { + + // query param clear_transient + var qrClearTransient bool + + if o.ClearTransient != nil { + qrClearTransient = *o.ClearTransient + } + qClearTransient := swag.FormatBool(qrClearTransient) + if qClearTransient != "" { + + if err := r.SetQueryParam("clear_transient", qClearTransient); err != nil { + return err + } + } + } + // path param deployment_id if err := r.SetPathParam("deployment_id", o.DeploymentID); err != nil { return err diff --git a/pkg/client/deployments/get_deployment_kib_resource_info_parameters.go b/pkg/client/deployments/get_deployment_kib_resource_info_parameters.go index 0a48aefc..69b44aa0 100644 --- a/pkg/client/deployments/get_deployment_kib_resource_info_parameters.go +++ b/pkg/client/deployments/get_deployment_kib_resource_info_parameters.go @@ -79,6 +79,12 @@ GetDeploymentKibResourceInfoParams contains all the parameters to send to the AP */ type GetDeploymentKibResourceInfoParams struct { + /* ClearTransient. + + If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update + */ + ClearTransient *bool + /* ConvertLegacyPlans. If showing plans, whether to leave pre-2.0.0 plans in their legacy format (the default), or whether to update them to 2.0.x+ format (if 'true'). @@ -153,6 +159,8 @@ func (o *GetDeploymentKibResourceInfoParams) WithDefaults() *GetDeploymentKibRes // All values with no default are reset to their zero value. func (o *GetDeploymentKibResourceInfoParams) SetDefaults() { var ( + clearTransientDefault = bool(false) + convertLegacyPlansDefault = bool(false) showMetadataDefault = bool(false) @@ -169,6 +177,7 @@ func (o *GetDeploymentKibResourceInfoParams) SetDefaults() { ) val := GetDeploymentKibResourceInfoParams{ + ClearTransient: &clearTransientDefault, ConvertLegacyPlans: &convertLegacyPlansDefault, ShowMetadata: &showMetadataDefault, ShowPlanDefaults: &showPlanDefaultsDefault, @@ -217,6 +226,17 @@ func (o *GetDeploymentKibResourceInfoParams) SetHTTPClient(client *http.Client) o.HTTPClient = client } +// WithClearTransient adds the clearTransient to the get deployment kib resource info params +func (o *GetDeploymentKibResourceInfoParams) WithClearTransient(clearTransient *bool) *GetDeploymentKibResourceInfoParams { + o.SetClearTransient(clearTransient) + return o +} + +// SetClearTransient adds the clearTransient to the get deployment kib resource info params +func (o *GetDeploymentKibResourceInfoParams) SetClearTransient(clearTransient *bool) { + o.ClearTransient = clearTransient +} + // WithConvertLegacyPlans adds the convertLegacyPlans to the get deployment kib resource info params func (o *GetDeploymentKibResourceInfoParams) WithConvertLegacyPlans(convertLegacyPlans *bool) *GetDeploymentKibResourceInfoParams { o.SetConvertLegacyPlans(convertLegacyPlans) @@ -324,6 +344,23 @@ func (o *GetDeploymentKibResourceInfoParams) WriteToRequest(r runtime.ClientRequ } var res []error + if o.ClearTransient != nil { + + // query param clear_transient + var qrClearTransient bool + + if o.ClearTransient != nil { + qrClearTransient = *o.ClearTransient + } + qClearTransient := swag.FormatBool(qrClearTransient) + if qClearTransient != "" { + + if err := r.SetQueryParam("clear_transient", qClearTransient); err != nil { + return err + } + } + } + if o.ConvertLegacyPlans != nil { // query param convert_legacy_plans diff --git a/pkg/client/deployments/get_deployment_parameters.go b/pkg/client/deployments/get_deployment_parameters.go index 373da403..02c12e57 100644 --- a/pkg/client/deployments/get_deployment_parameters.go +++ b/pkg/client/deployments/get_deployment_parameters.go @@ -79,6 +79,12 @@ GetDeploymentParams contains all the parameters to send to the API endpoint */ type GetDeploymentParams struct { + /* ClearTransient. + + If set (defaults to false) then removes the transient section from all child resources, making it safe to reapply via an update + */ + ClearTransient *bool + /* ConvertLegacyPlans. If showing plans, whether to leave pre-2.0.0 plans in their legacy format (the default), or whether to update them to 2.0.x+ format (if 'true') @@ -190,6 +196,8 @@ func (o *GetDeploymentParams) WithDefaults() *GetDeploymentParams { // All values with no default are reset to their zero value. func (o *GetDeploymentParams) SetDefaults() { var ( + clearTransientDefault = bool(false) + convertLegacyPlansDefault = bool(false) enrichWithTemplateDefault = bool(true) @@ -216,6 +224,7 @@ func (o *GetDeploymentParams) SetDefaults() { ) val := GetDeploymentParams{ + ClearTransient: &clearTransientDefault, ConvertLegacyPlans: &convertLegacyPlansDefault, EnrichWithTemplate: &enrichWithTemplateDefault, ForceAllPlanHistory: &forceAllPlanHistoryDefault, @@ -269,6 +278,17 @@ func (o *GetDeploymentParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithClearTransient adds the clearTransient to the get deployment params +func (o *GetDeploymentParams) WithClearTransient(clearTransient *bool) *GetDeploymentParams { + o.SetClearTransient(clearTransient) + return o +} + +// SetClearTransient adds the clearTransient to the get deployment params +func (o *GetDeploymentParams) SetClearTransient(clearTransient *bool) { + o.ClearTransient = clearTransient +} + // WithConvertLegacyPlans adds the convertLegacyPlans to the get deployment params func (o *GetDeploymentParams) WithConvertLegacyPlans(convertLegacyPlans *bool) *GetDeploymentParams { o.SetConvertLegacyPlans(convertLegacyPlans) @@ -420,6 +440,23 @@ func (o *GetDeploymentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } var res []error + if o.ClearTransient != nil { + + // query param clear_transient + var qrClearTransient bool + + if o.ClearTransient != nil { + qrClearTransient = *o.ClearTransient + } + qClearTransient := swag.FormatBool(qrClearTransient) + if qClearTransient != "" { + + if err := r.SetQueryParam("clear_transient", qClearTransient); err != nil { + return err + } + } + } + if o.ConvertLegacyPlans != nil { // query param convert_legacy_plans diff --git a/pkg/client/deployments/move_deployment_elasticsearch_resource_instances_parameters.go b/pkg/client/deployments/move_deployment_elasticsearch_resource_instances_parameters.go index 312979ac..bd48b4e3 100644 --- a/pkg/client/deployments/move_deployment_elasticsearch_resource_instances_parameters.go +++ b/pkg/client/deployments/move_deployment_elasticsearch_resource_instances_parameters.go @@ -126,6 +126,8 @@ type MoveDeploymentElasticsearchResourceInstancesParams struct { /* MoveOnly. When `true`, moves the specified instances and ignores the changes for the cluster state. + + Default: true */ MoveOnly *bool @@ -167,7 +169,7 @@ func (o *MoveDeploymentElasticsearchResourceInstancesParams) SetDefaults() { instancesDownDefault = bool(false) - moveOnlyDefault = bool(false) + moveOnlyDefault = bool(true) validateOnlyDefault = bool(false) ) diff --git a/pkg/client/deployments/set_deployment_es_resource_remote_clusters_parameters.go b/pkg/client/deployments/set_deployment_es_resource_remote_clusters_parameters.go index e6f83093..be9c507f 100644 --- a/pkg/client/deployments/set_deployment_es_resource_remote_clusters_parameters.go +++ b/pkg/client/deployments/set_deployment_es_resource_remote_clusters_parameters.go @@ -82,7 +82,7 @@ type SetDeploymentEsResourceRemoteClustersParams struct { /* Body. - List of remote clusters for the resource + List of certificate based remote clusters for the resource */ Body *models.RemoteResources diff --git a/pkg/models/discrete_sizes.go b/pkg/models/discrete_sizes.go index 5b29cd83..c9676484 100644 --- a/pkg/models/discrete_sizes.go +++ b/pkg/models/discrete_sizes.go @@ -38,13 +38,11 @@ import ( type DiscreteSizes struct { // The default size - // Required: true - DefaultSize *int32 `json:"default_size"` + DefaultSize int32 `json:"default_size,omitempty"` - // The unit that each size represents - // Required: true + // The unit that each size represents. If not specified, it will default to 'memory'. // Enum: [memory storage] - Resource *string `json:"resource"` + Resource string `json:"resource,omitempty"` // List of supported sizes // Required: true @@ -55,10 +53,6 @@ type DiscreteSizes struct { func (m *DiscreteSizes) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateDefaultSize(formats); err != nil { - res = append(res, err) - } - if err := m.validateResource(formats); err != nil { res = append(res, err) } @@ -73,15 +67,6 @@ func (m *DiscreteSizes) Validate(formats strfmt.Registry) error { return nil } -func (m *DiscreteSizes) validateDefaultSize(formats strfmt.Registry) error { - - if err := validate.Required("default_size", "body", m.DefaultSize); err != nil { - return err - } - - return nil -} - var discreteSizesTypeResourcePropEnum []interface{} func init() { @@ -112,13 +97,12 @@ func (m *DiscreteSizes) validateResourceEnum(path, location string, value string } func (m *DiscreteSizes) validateResource(formats strfmt.Registry) error { - - if err := validate.Required("resource", "body", m.Resource); err != nil { - return err + if swag.IsZero(m.Resource) { // not required + return nil } // value enum - if err := m.validateResourceEnum("resource", "body", *m.Resource); err != nil { + if err := m.validateResourceEnum("resource", "body", m.Resource); err != nil { return err } diff --git a/pkg/models/instance_configuration.go b/pkg/models/instance_configuration.go index bbf8d2eb..931422df 100644 --- a/pkg/models/instance_configuration.go +++ b/pkg/models/instance_configuration.go @@ -60,10 +60,9 @@ type InstanceConfiguration struct { // Unique identifier for the instance configuration ID string `json:"id,omitempty"` - // The type of instance - // Required: true + // The type of instance. For instance configurations where the type is specified in the 'id', the default value of 'instance_type' will be automatically inferred. // Enum: [elasticsearch kibana apm integrations_server appsearch enterprise_search] - InstanceType *string `json:"instance_type"` + InstanceType string `json:"instance_type,omitempty"` // The maximum number of availability zones in which this instance configuration has allocators. This field will be missing unless explicitly requested with the show_max_zones parameter. // Read Only: true @@ -76,7 +75,7 @@ type InstanceConfiguration struct { // Required: true Name *string `json:"name"` - // Node types (master, data) for the instance + // Node types (master, data) for the instance. For instance configurations where the type (and tier) is specified in the 'id', the default value of 'node_types' will be automatically inferred. NodeTypes []string `json:"node_types,omitempty"` // Settings for the instance storage multiplier @@ -209,13 +208,12 @@ func (m *InstanceConfiguration) validateInstanceTypeEnum(path, location string, } func (m *InstanceConfiguration) validateInstanceType(formats strfmt.Registry) error { - - if err := validate.Required("instance_type", "body", m.InstanceType); err != nil { - return err + if swag.IsZero(m.InstanceType) { // not required + return nil } // value enum - if err := m.validateInstanceTypeEnum("instance_type", "body", *m.InstanceType); err != nil { + if err := m.validateInstanceTypeEnum("instance_type", "body", m.InstanceType); err != nil { return err } diff --git a/pkg/models/instance_configuration_info.go b/pkg/models/instance_configuration_info.go index 090da550..21ad929e 100644 --- a/pkg/models/instance_configuration_info.go +++ b/pkg/models/instance_configuration_info.go @@ -53,10 +53,9 @@ type InstanceConfigurationInfo struct { // Unique identifier for the instance configuration ID string `json:"id,omitempty"` - // The type of instance - // Required: true + // The type of instance. For instance configurations where the type is specified in the 'id', the default value of 'instance_type' will be automatically inferred. // Enum: [elasticsearch kibana apm integrations_server appsearch enterprise_search] - InstanceType *string `json:"instance_type"` + InstanceType string `json:"instance_type,omitempty"` // The maximum number of availability zones in which this instance configuration has allocators. This field will be missing unless explicitly requested with the show_max_zones parameter. // Read Only: true @@ -69,7 +68,7 @@ type InstanceConfigurationInfo struct { // Required: true Name *string `json:"name"` - // Node types (master, data) for the instance + // Node types (master, data) for the instance. For instance configurations where the type (and tier) is specified in the 'id', the default value of 'node_types' will be automatically inferred. NodeTypes []string `json:"node_types"` // Settings for the instance storage multiplier @@ -160,13 +159,12 @@ func (m *InstanceConfigurationInfo) validateInstanceTypeEnum(path, location stri } func (m *InstanceConfigurationInfo) validateInstanceType(formats strfmt.Registry) error { - - if err := validate.Required("instance_type", "body", m.InstanceType); err != nil { - return err + if swag.IsZero(m.InstanceType) { // not required + return nil } // value enum - if err := m.validateInstanceTypeEnum("instance_type", "body", *m.InstanceType); err != nil { + if err := m.validateInstanceTypeEnum("instance_type", "body", m.InstanceType); err != nil { return err } diff --git a/pkg/models/instance_move_request.go b/pkg/models/instance_move_request.go index b02ff884..f569452f 100644 --- a/pkg/models/instance_move_request.go +++ b/pkg/models/instance_move_request.go @@ -31,7 +31,7 @@ import ( "github.com/go-openapi/validate" ) -// InstanceMoveRequest The request that specifies the Elasticsearch instances, Kibana instances, and APM Servers to move to allocators as part of the upgrade plan. +// InstanceMoveRequest The request that specifies the Elasticsearch or stateless (eg Kibana) instances to move to allocators as part of the upgrade plan. When used in conjunction with '\_\_all\_\_' (roll all instances as a single unit) strategy, these instances are not restarted, which can sometimes enable recovery plans when these instances are boot-looping. // // swagger:model InstanceMoveRequest type InstanceMoveRequest struct { diff --git a/pkg/models/integrations_server_info.go b/pkg/models/integrations_server_info.go index 5add6dd8..d846d59b 100644 --- a/pkg/models/integrations_server_info.go +++ b/pkg/models/integrations_server_info.go @@ -39,7 +39,7 @@ import ( type IntegrationsServerInfo struct { // The mode APM is operating in. - // Enum: [Standalone Managed] + // Enum: [standalone managed] ApmServerMode string `json:"apm_server_mode,omitempty"` // The id of the deployment that this Integrations Server belongs to. @@ -154,7 +154,7 @@ var integrationsServerInfoTypeApmServerModePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["Standalone","Managed"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["standalone","managed"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -164,11 +164,11 @@ func init() { const ( - // IntegrationsServerInfoApmServerModeStandalone captures enum value "Standalone" - IntegrationsServerInfoApmServerModeStandalone string = "Standalone" + // IntegrationsServerInfoApmServerModeStandalone captures enum value "standalone" + IntegrationsServerInfoApmServerModeStandalone string = "standalone" - // IntegrationsServerInfoApmServerModeManaged captures enum value "Managed" - IntegrationsServerInfoApmServerModeManaged string = "Managed" + // IntegrationsServerInfoApmServerModeManaged captures enum value "managed" + IntegrationsServerInfoApmServerModeManaged string = "managed" ) // prop value enum diff --git a/pkg/models/snapshot_dependencies.go b/pkg/models/snapshot_dependencies.go new file mode 100644 index 00000000..e264ad74 --- /dev/null +++ b/pkg/models/snapshot_dependencies.go @@ -0,0 +1,136 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SnapshotDependencies The additional resource of Elasticsearch cluster. +// +// swagger:model SnapshotDependencies +type SnapshotDependencies struct { + + // Client name that use to access additional resource + // Required: true + Resources []*SnapshotDependency `json:"resources"` +} + +// Validate validates this snapshot dependencies +func (m *SnapshotDependencies) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResources(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SnapshotDependencies) validateResources(formats strfmt.Registry) error { + + if err := validate.Required("resources", "body", m.Resources); err != nil { + return err + } + + for i := 0; i < len(m.Resources); i++ { + if swag.IsZero(m.Resources[i]) { // not required + continue + } + + if m.Resources[i] != nil { + if err := m.Resources[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this snapshot dependencies based on the context it is used +func (m *SnapshotDependencies) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResources(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SnapshotDependencies) contextValidateResources(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Resources); i++ { + + if m.Resources[i] != nil { + if err := m.Resources[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("resources" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("resources" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SnapshotDependencies) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SnapshotDependencies) UnmarshalBinary(b []byte) error { + var res SnapshotDependencies + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/models/snapshot_dependency.go b/pkg/models/snapshot_dependency.go new file mode 100644 index 00000000..30e10742 --- /dev/null +++ b/pkg/models/snapshot_dependency.go @@ -0,0 +1,105 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SnapshotDependency The additional resource of Elasticsearch cluster. +// +// swagger:model SnapshotDependency +type SnapshotDependency struct { + + // Client name that use to access additional resource + // Required: true + ClientName *string `json:"client_name"` + + // Resource (Elasticsearch cluster) id + // Required: true + ResourceID *string `json:"resource_id"` +} + +// Validate validates this snapshot dependency +func (m *SnapshotDependency) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClientName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResourceID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SnapshotDependency) validateClientName(formats strfmt.Registry) error { + + if err := validate.Required("client_name", "body", m.ClientName); err != nil { + return err + } + + return nil +} + +func (m *SnapshotDependency) validateResourceID(formats strfmt.Registry) error { + + if err := validate.Required("resource_id", "body", m.ResourceID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this snapshot dependency based on context it is used +func (m *SnapshotDependency) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SnapshotDependency) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SnapshotDependency) UnmarshalBinary(b []byte) error { + var res SnapshotDependency + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/models/token_response.go b/pkg/models/token_response.go index 39ee0011..b86c5dee 100644 --- a/pkg/models/token_response.go +++ b/pkg/models/token_response.go @@ -36,6 +36,11 @@ import ( // swagger:model TokenResponse type TokenResponse struct { + // The time that the session token will expire + // Required: true + // Format: date-time + SessionExpirationTime *strfmt.DateTime `json:"session_expiration_time"` + // The authorization bearer token that you use in subsequent requests // Required: true Token *string `json:"token"` @@ -45,6 +50,10 @@ type TokenResponse struct { func (m *TokenResponse) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateSessionExpirationTime(formats); err != nil { + res = append(res, err) + } + if err := m.validateToken(formats); err != nil { res = append(res, err) } @@ -55,6 +64,19 @@ func (m *TokenResponse) Validate(formats strfmt.Registry) error { return nil } +func (m *TokenResponse) validateSessionExpirationTime(formats strfmt.Registry) error { + + if err := validate.Required("session_expiration_time", "body", m.SessionExpirationTime); err != nil { + return err + } + + if err := validate.FormatOf("session_expiration_time", "body", "date-time", m.SessionExpirationTime.String(), formats); err != nil { + return err + } + + return nil +} + func (m *TokenResponse) validateToken(formats strfmt.Registry) error { if err := validate.Required("token", "body", m.Token); err != nil {