diff --git a/v2/.openapi-generator/FILES b/v2/.openapi-generator/FILES new file mode 100644 index 0000000..a40cf11 --- /dev/null +++ b/v2/.openapi-generator/FILES @@ -0,0 +1,101 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +docs/AcceptedMessage.md +docs/AttachVolumeData.md +docs/AuthUserData.md +docs/CapacityStats.md +docs/Cluster.md +docs/CreateNamespaceData.md +docs/CreatePolicyGroupData.md +docs/CreateUserData.md +docs/CreateVolumeData.md +docs/DefaultApi.md +docs/DeploymentInfo.md +docs/Error.md +docs/FsType.md +docs/Licence.md +docs/LogFormat.md +docs/LogLevel.md +docs/MasterDeploymentInfo.md +docs/MasterDeploymentInfoAllOf.md +docs/MasterHealth.md +docs/Namespace.md +docs/Node.md +docs/NodeHealth.md +docs/PoliciesIdSpecs.md +docs/PoliciesSpecs.md +docs/PolicyGroup.md +docs/PolicyGroupUsers.md +docs/ReplicaDeploymentInfo.md +docs/ReplicaDeploymentInfoAllOf.md +docs/ReplicaHealth.md +docs/ResizeVolumeRequest.md +docs/SetReplicasRequest.md +docs/SyncProgress.md +docs/UpdateAuthenticatedUserData.md +docs/UpdateClusterData.md +docs/UpdateLicence.md +docs/UpdateNamespaceData.md +docs/UpdateNodeData.md +docs/UpdatePolicyGroupData.md +docs/UpdateUserData.md +docs/UpdateVolumeData.md +docs/User.md +docs/UserSession.md +docs/UserSessionAllOf.md +docs/UserSessionAllOfSession.md +docs/Volume.md +git_push.sh +go.mod +go.sum +model__policies__id__specs.go +model__policies_specs.go +model_accepted_message.go +model_attach_volume_data.go +model_auth_user_data.go +model_capacity_stats.go +model_cluster.go +model_create_namespace_data.go +model_create_policy_group_data.go +model_create_user_data.go +model_create_volume_data.go +model_deployment_info.go +model_error.go +model_fs_type.go +model_licence.go +model_log_format.go +model_log_level.go +model_master_deployment_info.go +model_master_deployment_info_all_of.go +model_master_health.go +model_namespace.go +model_node.go +model_node_health.go +model_policy_group.go +model_policy_group_users.go +model_replica_deployment_info.go +model_replica_deployment_info_all_of.go +model_replica_health.go +model_resize_volume_request.go +model_set_replicas_request.go +model_sync_progress.go +model_update_authenticated_user_data.go +model_update_cluster_data.go +model_update_licence.go +model_update_namespace_data.go +model_update_node_data.go +model_update_policy_group_data.go +model_update_user_data.go +model_update_volume_data.go +model_user.go +model_user_session.go +model_user_session_all_of.go +model_user_session_all_of_session.go +model_volume.go +response.go diff --git a/v2/Makefile b/v2/Makefile index 0c73e88..8575619 100644 --- a/v2/Makefile +++ b/v2/Makefile @@ -1,4 +1,4 @@ -VERSION ?= 2.0.0-rc1 +VERSION ?= 2.1.0 GIT_USER_ID ?= storageos GIT_REPO_ID ?= go-api diff --git a/v2/README.md b/v2/README.md index 19f3dad..29c3c40 100644 --- a/v2/README.md +++ b/v2/README.md @@ -5,8 +5,8 @@ No description provided (generated by Openapi Generator https://github.com/opena ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 2.0.0 -- Package version: 2.0.0-rc1 +- API version: 2.1.0 +- Package version: 2.1.0 - Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit [https://storageos.com](https://storageos.com) @@ -63,6 +63,8 @@ Class | Method | HTTP request | Description *DefaultApi* | [**ListUsers**](docs/DefaultApi.md#listusers) | **Get** /users | Fetch the list of users *DefaultApi* | [**ListVolumes**](docs/DefaultApi.md#listvolumes) | **Get** /namespaces/{namespaceID}/volumes | Fetch the list of volumes in the given namespace *DefaultApi* | [**RefreshJwt**](docs/DefaultApi.md#refreshjwt) | **Post** /auth/refresh | Refresh the JWT +*DefaultApi* | [**ResizeVolume**](docs/DefaultApi.md#resizevolume) | **Put** /namespaces/{namespaceID}/volumes/{id}/size | Increase the size of a volume. +*DefaultApi* | [**SetReplicas**](docs/DefaultApi.md#setreplicas) | **Put** /namespaces/{namespaceID}/volumes/{id}/replicas | Set the number of replicas to maintain for the volume. *DefaultApi* | [**Spec**](docs/DefaultApi.md#spec) | **Get** /openapi | Serves this openapi spec file *DefaultApi* | [**UpdateAuthenticatedUser**](docs/DefaultApi.md#updateauthenticateduser) | **Put** /users/self | Update the authenticated user's information *DefaultApi* | [**UpdateCluster**](docs/DefaultApi.md#updatecluster) | **Put** /cluster | Update the cluster's global configuration settings @@ -71,6 +73,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**UpdateNode**](docs/DefaultApi.md#updatenode) | **Put** /nodes/{id} | Update a node *DefaultApi* | [**UpdatePolicyGroup**](docs/DefaultApi.md#updatepolicygroup) | **Put** /policies/{id} | Update a policy group *DefaultApi* | [**UpdateUser**](docs/DefaultApi.md#updateuser) | **Put** /users/{id} | Update a user +*DefaultApi* | [**UpdateVolume**](docs/DefaultApi.md#updatevolume) | **Put** /namespaces/{namespaceID}/volumes/{id} | Update a volume ## Documentation For Models @@ -103,6 +106,8 @@ Class | Method | HTTP request | Description - [ReplicaDeploymentInfo](docs/ReplicaDeploymentInfo.md) - [ReplicaDeploymentInfoAllOf](docs/ReplicaDeploymentInfoAllOf.md) - [ReplicaHealth](docs/ReplicaHealth.md) + - [ResizeVolumeRequest](docs/ResizeVolumeRequest.md) + - [SetReplicasRequest](docs/SetReplicasRequest.md) - [SyncProgress](docs/SyncProgress.md) - [UpdateAuthenticatedUserData](docs/UpdateAuthenticatedUserData.md) - [UpdateClusterData](docs/UpdateClusterData.md) @@ -111,6 +116,7 @@ Class | Method | HTTP request | Description - [UpdateNodeData](docs/UpdateNodeData.md) - [UpdatePolicyGroupData](docs/UpdatePolicyGroupData.md) - [UpdateUserData](docs/UpdateUserData.md) + - [UpdateVolumeData](docs/UpdateVolumeData.md) - [User](docs/User.md) - [UserSession](docs/UserSession.md) - [UserSessionAllOf](docs/UserSessionAllOf.md) diff --git a/v2/api/openapi.yaml b/v2/api/openapi.yaml index 78f84ac..f743c6c 100644 --- a/v2/api/openapi.yaml +++ b/v2/api/openapi.yaml @@ -5,7 +5,7 @@ info: name: StorageOS url: https://storageos.com title: StorageOS API - version: 2.0.0 + version: 2.1.0 externalDocs: description: The latest StorageOS user documentation url: https://docs.storageos.com/ @@ -200,8 +200,8 @@ paths: - jwt: [] summary: Fetch the list of users post: - description: Create a new user in the cluster - only administrators can create - new users. + description: | + Create a new user in the cluster - only administrators can create new users. operationId: createUser requestBody: $ref: '#/components/requestBodies/CreateUserData' @@ -330,7 +330,7 @@ paths: $ref: '#/components/schemas/UserID' style: simple - description: | - This value is used to perform a conditional delete of the entity. + This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. explode: true in: query @@ -496,6 +496,15 @@ paths: schema: $ref: '#/components/schemas/UserID' style: simple + - description: | + If set to true this value indicates that the user wants to ignore entity version constraints, thereby "forcing" the operation. + explode: true + in: query + name: ignore-version + required: false + schema: + $ref: '#/components/schemas/IgnoreVersion' + style: form requestBody: $ref: '#/components/requestBodies/UpdateUserData' content: @@ -708,7 +717,7 @@ paths: operationId: deleteAuthenticatedUser parameters: - description: | - This value is used to perform a conditional delete of the entity. + This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. explode: true in: query @@ -854,6 +863,16 @@ paths: put: description: Update the authenticated user. operationId: updateAuthenticatedUser + parameters: + - description: | + If set to true this value indicates that the user wants to ignore entity version constraints, thereby "forcing" the operation. + explode: true + in: query + name: ignore-version + required: false + schema: + $ref: '#/components/schemas/IgnoreVersion' + style: form requestBody: $ref: '#/components/requestBodies/UpdateAuthenticatedUserData' content: @@ -1076,8 +1095,8 @@ paths: - jwt: [] summary: Fetch the list of namespaces post: - description: Create a new namespace in the cluster - only administrators can - create new namespaces. + description: | + Create a new namespace in the cluster - only administrators can create new namespaces. operationId: createNamespace requestBody: $ref: '#/components/requestBodies/CreateNamespaceData' @@ -1187,7 +1206,7 @@ paths: $ref: '#/components/schemas/NamespaceID' style: simple - description: | - This value is used to perform a conditional delete of the entity. + This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. explode: true in: query @@ -1368,6 +1387,15 @@ paths: schema: $ref: '#/components/schemas/NamespaceID' style: simple + - description: | + If set to true this value indicates that the user wants to ignore entity version constraints, thereby "forcing" the operation. + explode: true + in: query + name: ignore-version + required: false + schema: + $ref: '#/components/schemas/IgnoreVersion' + style: form requestBody: $ref: '#/components/requestBodies/UpdateNamespaceData' content: @@ -1527,7 +1555,7 @@ paths: delete: description: | Remove the node identified by id. - A node can only be deleted if it is currently offline. + A node can only be deleted if it is currently offline and does not host any master deployments. operationId: deleteNode parameters: - description: ID of a node @@ -1539,7 +1567,7 @@ paths: $ref: '#/components/schemas/NodeID' style: simple - description: | - This value is used to perform a conditional delete of the entity. + This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. explode: true in: query @@ -1620,11 +1648,11 @@ paths: content: application/json: example: - error: node not offline + error: in use schema: $ref: '#/components/schemas/Error' description: | - The request attempted to delete a node that is not currently offline. + A referenced entity is currently in use. "412": content: application/json: @@ -1635,6 +1663,15 @@ paths: description: | The entity to be wrote has been concurrently updated by another request - the submitted entity data has been replaced. The caller should fetch the entity again, check the actions are still required and resubmit the request with the new entity version field. + "423": + content: + application/json: + example: + error: entity locked + schema: + $ref: '#/components/schemas/Error' + description: | + A lock is held for the target entity, preventing the operation to be carried out safely. "500": content: application/json: @@ -1732,6 +1769,15 @@ paths: schema: $ref: '#/components/schemas/NodeID' style: simple + - description: | + If set to true this value indicates that the user wants to ignore entity version constraints, thereby "forcing" the operation. + explode: true + in: query + name: ignore-version + required: false + schema: + $ref: '#/components/schemas/IgnoreVersion' + style: form requestBody: $ref: '#/components/requestBodies/UpdateNodeData' content: @@ -2004,7 +2050,7 @@ paths: $ref: '#/components/schemas/PolicyGroupID' style: simple - description: | - This value is used to perform a conditional delete of the entity. + This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. explode: true in: query @@ -2185,6 +2231,15 @@ paths: schema: $ref: '#/components/schemas/PolicyGroupID' style: simple + - description: | + If set to true this value indicates that the user wants to ignore entity version constraints, thereby "forcing" the operation. + explode: true + in: query + name: ignore-version + required: false + schema: + $ref: '#/components/schemas/IgnoreVersion' + style: form requestBody: $ref: '#/components/requestBodies/UpdatePolicyGroupData' content: @@ -2549,7 +2604,7 @@ paths: $ref: '#/components/schemas/VolumeID' style: simple - description: | - This value is used to perform a conditional delete of the entity. + This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. explode: true in: query @@ -2580,6 +2635,18 @@ paths: schema: type: string style: form + - description: | + If set to true, enables deletion of a volume when all deployments are offline, bypassing the host nodes which cannot be reached. + An offline delete request will be rejected when either a) there are online deployments for the target volume or b) there is evidence that an unreachable node still has the volume master + explode: true + in: query + name: offline-delete + required: false + schema: + default: false + example: true + type: boolean + style: form responses: "200": description: The volume was successfully deleted. @@ -2655,6 +2722,15 @@ paths: description: | An action was requested that cannot be performed on the entity in it's current state. As an example, this error might be returned when trying to delete a currently mounted volume. + "423": + content: + application/json: + example: + error: entity locked + schema: + $ref: '#/components/schemas/Error' + description: | + A lock is held for the target entity, preventing the operation to be carried out safely. "500": content: application/json: @@ -2756,6 +2832,170 @@ paths: security: - jwt: [] summary: Fetch a volume + put: + description: | + Update the description and non-storageos labels configured for the volume identified by id. + operationId: updateVolume + parameters: + - description: ID of a Namespace + explode: false + in: path + name: namespaceID + required: true + schema: + $ref: '#/components/schemas/NamespaceID' + style: simple + - description: ID of a Volume + explode: false + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/VolumeID' + style: simple + - description: | + If set to true this value indicates that the user wants to ignore entity version constraints, thereby "forcing" the operation. + explode: true + in: query + name: ignore-version + required: false + schema: + $ref: '#/components/schemas/IgnoreVersion' + style: form + - description: | + Optional parameter which will make the api request asynchronous. The operation will not be cancelled even if the client disconnect. + The URL parameter value overrides the "async-max" header value, if any. + The value of this header defines the timeout duration for the request, it must be set to a valid duration string. + A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". + We reject negative or nil duration values. + explode: true + in: query + name: async-max + required: false + schema: + type: string + style: form + requestBody: + $ref: '#/components/requestBodies/UpdateVolumeData' + content: + application/json: + schema: + example: + description: This volume contains the data for my app + version: NDI0MjQyNDI0MjQyNDI0MjQy + labels: + env: prod + rack: db-1 + properties: + labels: + additionalProperties: + type: string + description: | + A set of arbitrary key value labels to apply to the entity. + example: + env: prod + rack: db-1 + externalDocs: + url: https://docs.storageos.com/v2/openapi-help/labels + type: object + description: + example: This volume contains the data for my app + type: string + version: + description: | + An opaque representation of an entity version at the time it was obtained from the API. + All operations that mutate the entity must include this version field in the request unchanged. + The format of this type is undefined and may change but the defined properties will not change. + example: NDI0MjQyNDI0MjQyNDI0MjQy + maxLength: 30 + type: string + title: UpdateVolumeData + type: object + description: | + Update the volume description and label configuration to the desired state. Alterations of StorageOS labels are rejected. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Volume' + description: The volume was successfully updated + "400": + content: + application/json: + example: + error: a short description of the validation failure + schema: + $ref: '#/components/schemas/Error' + description: The request does not conform to the API specification. + "401": + content: + application/json: + example: + error: authentication required + schema: + $ref: '#/components/schemas/Error' + description: | + The requested endpoint requires authentication - you must log in first. + If attempting to log in, your credentials were not recognised. + "403": + content: + application/json: + example: + error: unauthorised + schema: + $ref: '#/components/schemas/Error' + description: | + The authenticated user does not have permission to perform the requested action. + "404": + content: + application/json: + example: + error: not found + schema: + $ref: '#/components/schemas/Error' + description: | + A referenced resource does not exist. + "412": + content: + application/json: + example: + error: attempting to write stale object + schema: + $ref: '#/components/schemas/Error' + description: | + The entity to be wrote has been concurrently updated by another request - the submitted entity data has been replaced. + The caller should fetch the entity again, check the actions are still required and resubmit the request with the new entity version field. + "451": + content: + application/json: + example: + error: insufficient allowed capacity (bytes) (used 53687091200, allowed + 53687091200, requested 5000000) + schema: + $ref: '#/components/schemas/Error' + description: | + The requested operation failed because your storageOS licence does not allow it, either create an account for a free licence or buy a professional licence. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: | + The request caused an internal server error and should be retried. + Check the health of the node/cluster and if the error persists, contact support. + "503": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: | + The server is currently unable to handle the request due to a temporary store failure. + Check the health of the node/cluster and if the error persists, contact support. + security: + - jwt: [] + summary: Update a volume /namespaces/{namespaceID}/volumes/{id}/attach: delete: description: Detach the volume identified by id. @@ -2778,7 +3018,7 @@ paths: $ref: '#/components/schemas/VolumeID' style: simple - description: | - This value is used to perform a conditional delete of the entity. + This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. explode: true in: query @@ -2796,6 +3036,19 @@ paths: schema: $ref: '#/components/schemas/IgnoreVersion' style: form + - description: | + Optional parameter which will make the api request asynchronous. The operation will not be cancelled even if the client disconnect. + The URL parameter value overrides the "async-max" header value, if any. + The value of this header defines the timeout duration for the request, it must be set to a valid duration string. + A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". + We reject negative or nil duration values. + explode: true + in: query + name: async-max + required: false + schema: + type: string + style: form responses: "200": description: The volume was successfully detached. @@ -2884,8 +3137,8 @@ paths: - jwt: [] summary: Detach the given volume post: - description: Attach the volume identified by id to the node identified in the - request's body. + description: | + Attach the volume identified by id to the node identified in the request's body. operationId: attachVolume parameters: - description: ID of a Namespace @@ -2991,22 +3244,325 @@ paths: security: - jwt: [] summary: Attach a volume to the given node - /cluster: - get: - description: Retrieves the current global configuration settings in use by the - cluster. - operationId: getCluster - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Cluster' - description: The cluster-wide configuration information. - "401": - content: - application/json: - example: + /namespaces/{namespaceID}/volumes/{id}/replicas: + put: + description: | + Set the number of replicas for the volume identified by id to the number specified in the request's body. This modifies the protected StorageOS system label "storageos.com/replicas". + This request changes the desired replica count, and returns an error if changing the desired replica count failed. StorageOS satisfies the new replica configuration asynchronously. + operationId: setReplicas + parameters: + - description: ID of a Namespace + explode: false + in: path + name: namespaceID + required: true + schema: + $ref: '#/components/schemas/NamespaceID' + style: simple + - description: ID of a Volume + explode: false + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/VolumeID' + style: simple + - description: | + If set to true this value indicates that the user wants to ignore entity version constraints, thereby "forcing" the operation. + explode: true + in: query + name: ignore-version + required: false + schema: + $ref: '#/components/schemas/IgnoreVersion' + style: form + requestBody: + $ref: '#/components/requestBodies/SetReplicasRequest' + content: + application/json: + schema: + example: + replicas: 2 + version: NDI0MjQyNDI0MjQyNDI0MjQy + properties: + replicas: + description: | + The number of replicas desired. + example: 2 + maximum: 5 + minimum: 0 + type: uint64 + version: + description: | + An opaque representation of an entity version at the time it was obtained from the API. + All operations that mutate the entity must include this version field in the request unchanged. + The format of this type is undefined and may change but the defined properties will not change. + example: NDI0MjQyNDI0MjQyNDI0MjQy + maxLength: 30 + type: string + title: SetReplicasRequest + type: object + description: Number of replicas + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/AcceptedMessage' + description: | + An aynchronous request has been accepted + "400": + content: + application/json: + example: + error: a short description of the validation failure + schema: + $ref: '#/components/schemas/Error' + description: The request does not conform to the API specification. + "401": + content: + application/json: + example: + error: authentication required + schema: + $ref: '#/components/schemas/Error' + description: | + The requested endpoint requires authentication - you must log in first. + If attempting to log in, your credentials were not recognised. + "403": + content: + application/json: + example: + error: unauthorised + schema: + $ref: '#/components/schemas/Error' + description: | + The authenticated user does not have permission to perform the requested action. + "404": + content: + application/json: + example: + error: not found + schema: + $ref: '#/components/schemas/Error' + description: | + A referenced resource does not exist. + "412": + content: + application/json: + example: + error: attempting to write stale object + schema: + $ref: '#/components/schemas/Error' + description: | + The entity to be wrote has been concurrently updated by another request - the submitted entity data has been replaced. + The caller should fetch the entity again, check the actions are still required and resubmit the request with the new entity version field. + "422": + content: + application/json: + example: + error: invalid state for operation (currently "deleted") + schema: + $ref: '#/components/schemas/Error' + description: | + An action was requested that cannot be performed on the entity in it's current state. + As an example, this error might be returned when trying to delete a currently mounted volume. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: | + The request caused an internal server error and should be retried. + Check the health of the node/cluster and if the error persists, contact support. + "503": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: | + The server is currently unable to handle the request due to a temporary store failure. + Check the health of the node/cluster and if the error persists, contact support. + security: + - jwt: [] + summary: Set the number of replicas to maintain for the volume. + /namespaces/{namespaceID}/volumes/{id}/size: + put: + description: | + Resize the volume identified by id in the namespace identified by namespaceID. A volume's size cannot be reduced. + operationId: resizeVolume + parameters: + - description: ID of a Namespace + explode: false + in: path + name: namespaceID + required: true + schema: + $ref: '#/components/schemas/NamespaceID' + style: simple + - description: ID of a Volume + explode: false + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/VolumeID' + style: simple + - description: | + Optional parameter which will make the api request asynchronous. The operation will not be cancelled even if the client disconnect. + The URL parameter value overrides the "async-max" header value, if any. + The value of this header defines the timeout duration for the request, it must be set to a valid duration string. + A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". + We reject negative or nil duration values. + explode: true + in: query + name: async-max + required: false + schema: + type: string + style: form + - description: | + If set to true this value indicates that the user wants to ignore entity version constraints, thereby "forcing" the operation. + explode: true + in: query + name: ignore-version + required: false + schema: + $ref: '#/components/schemas/IgnoreVersion' + style: form + requestBody: + $ref: '#/components/requestBodies/ResizeVolumeRequest' + content: + application/json: + schema: + example: + version: NDI0MjQyNDI0MjQyNDI0MjQy + sizeBytes: 5368709000 + properties: + sizeBytes: + description: | + The desired new size for the volume in bytes. This value cannot be less than the current size of the volume. + example: 5368709000 + minimum: 1073742000 + type: uint64 + version: + description: | + An opaque representation of an entity version at the time it was obtained from the API. + All operations that mutate the entity must include this version field in the request unchanged. + The format of this type is undefined and may change but the defined properties will not change. + example: NDI0MjQyNDI0MjQyNDI0MjQy + maxLength: 30 + type: string + title: ResizeVolumeRequest + type: object + description: The new size to give the volume + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Volume' + description: The volume was resized successfully. + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/AcceptedMessage' + description: | + An aynchronous request has been accepted + "400": + content: + application/json: + example: + error: a short description of the validation failure + schema: + $ref: '#/components/schemas/Error' + description: The request does not conform to the API specification. + "401": + content: + application/json: + example: + error: authentication required + schema: + $ref: '#/components/schemas/Error' + description: | + The requested endpoint requires authentication - you must log in first. + If attempting to log in, your credentials were not recognised. + "403": + content: + application/json: + example: + error: unauthorised + schema: + $ref: '#/components/schemas/Error' + description: | + The authenticated user does not have permission to perform the requested action. + "404": + content: + application/json: + example: + error: not found + schema: + $ref: '#/components/schemas/Error' + description: | + A referenced resource does not exist. + "412": + content: + application/json: + example: + error: attempting to write stale object + schema: + $ref: '#/components/schemas/Error' + description: | + The entity to be wrote has been concurrently updated by another request - the submitted entity data has been replaced. + The caller should fetch the entity again, check the actions are still required and resubmit the request with the new entity version field. + "422": + content: + application/json: + example: + error: invalid state for operation (currently "deleted") + schema: + $ref: '#/components/schemas/Error' + description: | + An action was requested that cannot be performed on the entity in it's current state. + As an example, this error might be returned when trying to delete a currently mounted volume. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: | + The request caused an internal server error and should be retried. + Check the health of the node/cluster and if the error persists, contact support. + "503": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: | + The server is currently unable to handle the request due to a temporary store failure. + Check the health of the node/cluster and if the error persists, contact support. + security: + - jwt: [] + summary: Increase the size of a volume. + /cluster: + get: + description: | + Retrieves the current global configuration settings in use by the cluster. + operationId: getCluster + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Cluster' + description: The cluster-wide configuration information. + "401": + content: + application/json: + example: error: authentication required schema: $ref: '#/components/schemas/Error' @@ -3044,6 +3600,16 @@ paths: put: description: Update the global configuration settings to use for the cluster. operationId: updateCluster + parameters: + - description: | + If set to true this value indicates that the user wants to ignore entity version constraints, thereby "forcing" the operation. + explode: true + in: query + name: ignore-version + required: false + schema: + $ref: '#/components/schemas/IgnoreVersion' + style: form requestBody: $ref: '#/components/requestBodies/UpdateClusterData' content: @@ -3207,6 +3773,16 @@ paths: put: description: Update the cluster's licence. operationId: updateLicence + parameters: + - description: | + If set to true this value indicates that the user wants to ignore entity version constraints, thereby "forcing" the operation. + explode: true + in: query + name: ignore-version + required: false + schema: + $ref: '#/components/schemas/IgnoreVersion' + style: form requestBody: $ref: '#/components/requestBodies/UpdateLicence' content: @@ -3366,7 +3942,7 @@ components: parameters: ObjectVersion: description: | - This value is used to perform a conditional delete of the entity. + This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. explode: true in: query @@ -3420,6 +3996,12 @@ components: schema: $ref: '#/components/schemas/CreateVolumeData' required: true + UpdateVolumeData: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateVolumeData' + required: true UpdateUserData: content: application/json: @@ -3432,6 +4014,12 @@ components: schema: $ref: '#/components/schemas/CreateUserData' required: true + ResizeVolumeRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/ResizeVolumeRequest' + required: true UpdateLicence: content: application/json: @@ -3450,6 +4038,12 @@ components: schema: $ref: '#/components/schemas/UpdatePolicyGroupData' required: true + SetReplicasRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/SetReplicasRequest' + required: true UpdateAuthenticatedUserData: content: application/json: @@ -3602,6 +4196,15 @@ components: $ref: '#/components/schemas/Error' description: | A referenced entity is currently in use. + Locked: + content: + application/json: + example: + error: entity locked + schema: + $ref: '#/components/schemas/Error' + description: | + A lock is held for the target entity, preventing the operation to be carried out safely. Accepted: content: application/json: @@ -3979,7 +4582,7 @@ components: env: prod rack: db-1 master: "" - sizeBytes: 5000 + sizeBytes: 5368709000 attachedOn: "" createdAt: 2019-03-10T13:42:42Z namespaceID: "" @@ -4033,8 +4636,8 @@ components: sizeBytes: description: | A volume's size in bytes - example: 5000 - minimum: 0 + example: 5368709000 + minimum: 1073742000 type: uint64 createdAt: description: | @@ -4798,6 +5401,38 @@ components: - sizeBytes title: CreateVolumeData type: object + UpdateVolumeData: + example: + description: This volume contains the data for my app + version: NDI0MjQyNDI0MjQyNDI0MjQy + labels: + env: prod + rack: db-1 + properties: + labels: + additionalProperties: + type: string + description: | + A set of arbitrary key value labels to apply to the entity. + example: + env: prod + rack: db-1 + externalDocs: + url: https://docs.storageos.com/v2/openapi-help/labels + type: object + description: + example: This volume contains the data for my app + type: string + version: + description: | + An opaque representation of an entity version at the time it was obtained from the API. + All operations that mutate the entity must include this version field in the request unchanged. + The format of this type is undefined and may change but the defined properties will not change. + example: NDI0MjQyNDI0MjQyNDI0MjQy + maxLength: 30 + type: string + title: UpdateVolumeData + type: object AttachVolumeData: example: nodeID: c5666b58-b805-4215-ab4a-cb094948ccc6 @@ -4810,6 +5445,49 @@ components: type: string title: AttachVolumeData type: object + SetReplicasRequest: + example: + replicas: 2 + version: NDI0MjQyNDI0MjQyNDI0MjQy + properties: + replicas: + description: | + The number of replicas desired. + example: 2 + maximum: 5 + minimum: 0 + type: uint64 + version: + description: | + An opaque representation of an entity version at the time it was obtained from the API. + All operations that mutate the entity must include this version field in the request unchanged. + The format of this type is undefined and may change but the defined properties will not change. + example: NDI0MjQyNDI0MjQyNDI0MjQy + maxLength: 30 + type: string + title: SetReplicasRequest + type: object + ResizeVolumeRequest: + example: + version: NDI0MjQyNDI0MjQyNDI0MjQy + sizeBytes: 5368709000 + properties: + sizeBytes: + description: | + The desired new size for the volume in bytes. This value cannot be less than the current size of the volume. + example: 5368709000 + minimum: 1073742000 + type: uint64 + version: + description: | + An opaque representation of an entity version at the time it was obtained from the API. + All operations that mutate the entity must include this version field in the request unchanged. + The format of this type is undefined and may change but the defined properties will not change. + example: NDI0MjQyNDI0MjQyNDI0MjQy + maxLength: 30 + type: string + title: ResizeVolumeRequest + type: object UpdateClusterData: example: disableVersionCheck: false diff --git a/v2/api_default.go b/v2/api_default.go index 4403f1f..fc92551 100644 --- a/v2/api_default.go +++ b/v2/api_default.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ @@ -30,7 +30,7 @@ type DefaultApiService service /* AttachVolume Attach a volume to the given node -Attach the volume identified by id to the node identified in the request's body. +Attach the volume identified by id to the node identified in the request's body. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param namespaceID ID of a Namespace * @param id ID of a Volume @@ -47,9 +47,9 @@ func (a *DefaultApiService) AttachVolume(ctx _context.Context, namespaceID strin // create path and map variables localVarPath := a.client.cfg.BasePath + "/namespaces/{namespaceID}/volumes/{id}/attach" - localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.QueryEscape(parameterToString(namespaceID, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.PathEscape(parameterToString(namespaceID, "")) , -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -289,7 +289,7 @@ func (a *DefaultApiService) AuthenticateUser(ctx _context.Context, authUserData /* CreateNamespace Create a new namespace -Create a new namespace in the cluster - only administrators can create new namespaces. +Create a new namespace in the cluster - only administrators can create new namespaces. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param createNamespaceData @return Namespace @@ -563,7 +563,7 @@ func (a *DefaultApiService) CreatePolicyGroup(ctx _context.Context, createPolicy /* CreateUser Create a new user -Create a new user in the cluster - only administrators can create new users. +Create a new user in the cluster - only administrators can create new users. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param createUserData @return User @@ -725,7 +725,7 @@ func (a *DefaultApiService) CreateVolume(ctx _context.Context, namespaceID strin // create path and map variables localVarPath := a.client.cfg.BasePath + "/namespaces/{namespaceID}/volumes" - localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.QueryEscape(parameterToString(namespaceID, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.PathEscape(parameterToString(namespaceID, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -877,7 +877,7 @@ type DeleteAuthenticatedUserOpts struct { DeleteAuthenticatedUser Delete the authenticated user Remove the authenticated user from the cluster. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param version This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. + * @param version This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. * @param optional nil or *DeleteAuthenticatedUserOpts - Optional Parameters: * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. */ @@ -1159,7 +1159,7 @@ DeleteNamespace Delete a namespace Remove the namespace identified by id. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id ID of a namespace - * @param version This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. + * @param version This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. * @param optional nil or *DeleteNamespaceOpts - Optional Parameters: * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. */ @@ -1174,7 +1174,7 @@ func (a *DefaultApiService) DeleteNamespace(ctx _context.Context, id string, ver // create path and map variables localVarPath := a.client.cfg.BasePath + "/namespaces/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1318,10 +1318,10 @@ type DeleteNodeOpts struct { /* DeleteNode Delete a node -Remove the node identified by id. A node can only be deleted if it is currently offline. +Remove the node identified by id. A node can only be deleted if it is currently offline and does not host any master deployments. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id ID of a node - * @param version This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. + * @param version This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. * @param optional nil or *DeleteNodeOpts - Optional Parameters: * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. * @param "AsyncMax" (optional.String) - Optional parameter which will make the api request asynchronous. The operation will not be cancelled even if the client disconnect. The URL parameter value overrides the \"async-max\" header value, if any. The value of this header defines the timeout duration for the request, it must be set to a valid duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as \"300ms\", or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\". We reject negative or nil duration values. @@ -1337,7 +1337,7 @@ func (a *DefaultApiService) DeleteNode(ctx _context.Context, id string, version // create path and map variables localVarPath := a.client.cfg.BasePath + "/nodes/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1451,6 +1451,16 @@ func (a *DefaultApiService) DeleteNode(ctx _context.Context, id string, version newErr.model = v return localVarHTTPResponse, newErr } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1486,7 +1496,7 @@ DeletePolicyGroup Delete a policy group Remove the policy group identified by id. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id ID of a policy group - * @param version This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. + * @param version This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. * @param optional nil or *DeletePolicyGroupOpts - Optional Parameters: * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. */ @@ -1501,7 +1511,7 @@ func (a *DefaultApiService) DeletePolicyGroup(ctx _context.Context, id string, v // create path and map variables localVarPath := a.client.cfg.BasePath + "/policies/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1654,7 +1664,7 @@ func (a *DefaultApiService) DeleteSessions(ctx _context.Context, id string) (*_n // create path and map variables localVarPath := a.client.cfg.BasePath + "/users/{id}/sessions" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1783,7 +1793,7 @@ DeleteUser Delete a user Remove the user identified by id. This request will not succeed if the target account is the currently authenticated account. Use the separate users/self endpoint for this purpose. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id ID of a user - * @param version This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. + * @param version This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. * @param optional nil or *DeleteUserOpts - Optional Parameters: * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. */ @@ -1798,7 +1808,7 @@ func (a *DefaultApiService) DeleteUser(ctx _context.Context, id string, version // create path and map variables localVarPath := a.client.cfg.BasePath + "/users/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1928,6 +1938,7 @@ func (a *DefaultApiService) DeleteUser(ctx _context.Context, id string, version type DeleteVolumeOpts struct { IgnoreVersion optional.Bool AsyncMax optional.String + OfflineDelete optional.Bool } /* @@ -1936,10 +1947,11 @@ Remove the volume identified by id. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param namespaceID ID of a Namespace * @param id ID of a Volume - * @param version This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. + * @param version This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. * @param optional nil or *DeleteVolumeOpts - Optional Parameters: * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. * @param "AsyncMax" (optional.String) - Optional parameter which will make the api request asynchronous. The operation will not be cancelled even if the client disconnect. The URL parameter value overrides the \"async-max\" header value, if any. The value of this header defines the timeout duration for the request, it must be set to a valid duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as \"300ms\", or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\". We reject negative or nil duration values. + * @param "OfflineDelete" (optional.Bool) - If set to true, enables deletion of a volume when all deployments are offline, bypassing the host nodes which cannot be reached. An offline delete request will be rejected when either a) there are online deployments for the target volume or b) there is evidence that an unreachable node still has the volume master */ func (a *DefaultApiService) DeleteVolume(ctx _context.Context, namespaceID string, id string, version string, localVarOptionals *DeleteVolumeOpts) (*_nethttp.Response, error) { var ( @@ -1952,9 +1964,9 @@ func (a *DefaultApiService) DeleteVolume(ctx _context.Context, namespaceID strin // create path and map variables localVarPath := a.client.cfg.BasePath + "/namespaces/{namespaceID}/volumes/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.QueryEscape(parameterToString(namespaceID, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.PathEscape(parameterToString(namespaceID, "")) , -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1970,6 +1982,9 @@ func (a *DefaultApiService) DeleteVolume(ctx _context.Context, namespaceID strin if localVarOptionals != nil && localVarOptionals.AsyncMax.IsSet() { localVarQueryParams.Add("async-max", parameterToString(localVarOptionals.AsyncMax.Value(), "")) } + if localVarOptionals != nil && localVarOptionals.OfflineDelete.IsSet() { + localVarQueryParams.Add("offline-delete", parameterToString(localVarOptionals.OfflineDelete.Value(), "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2078,6 +2093,16 @@ func (a *DefaultApiService) DeleteVolume(ctx _context.Context, namespaceID strin newErr.model = v return localVarHTTPResponse, newErr } + if localVarHTTPResponse.StatusCode == 423 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -2106,6 +2131,7 @@ func (a *DefaultApiService) DeleteVolume(ctx _context.Context, namespaceID strin // DetachVolumeOpts Optional parameters for the method 'DetachVolume' type DetachVolumeOpts struct { IgnoreVersion optional.Bool + AsyncMax optional.String } /* @@ -2114,9 +2140,10 @@ Detach the volume identified by id. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param namespaceID ID of a Namespace * @param id ID of a Volume - * @param version This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. + * @param version This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. * @param optional nil or *DetachVolumeOpts - Optional Parameters: * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. + * @param "AsyncMax" (optional.String) - Optional parameter which will make the api request asynchronous. The operation will not be cancelled even if the client disconnect. The URL parameter value overrides the \"async-max\" header value, if any. The value of this header defines the timeout duration for the request, it must be set to a valid duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as \"300ms\", or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\". We reject negative or nil duration values. */ func (a *DefaultApiService) DetachVolume(ctx _context.Context, namespaceID string, id string, version string, localVarOptionals *DetachVolumeOpts) (*_nethttp.Response, error) { var ( @@ -2129,9 +2156,9 @@ func (a *DefaultApiService) DetachVolume(ctx _context.Context, namespaceID strin // create path and map variables localVarPath := a.client.cfg.BasePath + "/namespaces/{namespaceID}/volumes/{id}/attach" - localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.QueryEscape(parameterToString(namespaceID, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.PathEscape(parameterToString(namespaceID, "")) , -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2144,6 +2171,9 @@ func (a *DefaultApiService) DetachVolume(ctx _context.Context, namespaceID strin if localVarOptionals != nil && localVarOptionals.IgnoreVersion.IsSet() { localVarQueryParams.Add("ignore-version", parameterToString(localVarOptionals.IgnoreVersion.Value(), "")) } + if localVarOptionals != nil && localVarOptionals.AsyncMax.IsSet() { + localVarQueryParams.Add("async-max", parameterToString(localVarOptionals.AsyncMax.Value(), "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2403,7 +2433,7 @@ func (a *DefaultApiService) GetAuthenticatedUser(ctx _context.Context) (User, *_ /* GetCluster Retrieves the cluster's global configuration settings -Retrieves the current global configuration settings in use by the cluster. +Retrieves the current global configuration settings in use by the cluster. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Cluster */ @@ -2762,7 +2792,7 @@ func (a *DefaultApiService) GetNamespace(ctx _context.Context, id string) (Names // create path and map variables localVarPath := a.client.cfg.BasePath + "/namespaces/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -2899,7 +2929,7 @@ func (a *DefaultApiService) GetNode(ctx _context.Context, id string) (Node, *_ne // create path and map variables localVarPath := a.client.cfg.BasePath + "/nodes/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -3026,7 +3056,7 @@ func (a *DefaultApiService) GetPolicyGroup(ctx _context.Context, id string) (Pol // create path and map variables localVarPath := a.client.cfg.BasePath + "/policies/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -3163,7 +3193,7 @@ func (a *DefaultApiService) GetUser(ctx _context.Context, id string) (User, *_ne // create path and map variables localVarPath := a.client.cfg.BasePath + "/users/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -3291,9 +3321,9 @@ func (a *DefaultApiService) GetVolume(ctx _context.Context, namespaceID string, // create path and map variables localVarPath := a.client.cfg.BasePath + "/namespaces/{namespaceID}/volumes/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.QueryEscape(parameterToString(namespaceID, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.PathEscape(parameterToString(namespaceID, "")) , -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -3886,7 +3916,7 @@ func (a *DefaultApiService) ListVolumes(ctx _context.Context, namespaceID string // create path and map variables localVarPath := a.client.cfg.BasePath + "/namespaces/{namespaceID}/volumes" - localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.QueryEscape(parameterToString(namespaceID, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.PathEscape(parameterToString(namespaceID, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -4088,104 +4118,50 @@ func (a *DefaultApiService) RefreshJwt(ctx _context.Context) (UserSession, *_net return localVarReturnValue, localVarHTTPResponse, nil } -/* -Spec Serves this openapi spec file -Serves this openapi spec file - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return string -*/ -func (a *DefaultApiService) Spec(ctx _context.Context) (string, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue string - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/openapi" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"text/yaml"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil +// ResizeVolumeOpts Optional parameters for the method 'ResizeVolume' +type ResizeVolumeOpts struct { + AsyncMax optional.String + IgnoreVersion optional.Bool } /* -UpdateAuthenticatedUser Update the authenticated user's information -Update the authenticated user. +ResizeVolume Increase the size of a volume. +Resize the volume identified by id in the namespace identified by namespaceID. A volume's size cannot be reduced. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param updateAuthenticatedUserData -@return User + * @param namespaceID ID of a Namespace + * @param id ID of a Volume + * @param resizeVolumeRequest + * @param optional nil or *ResizeVolumeOpts - Optional Parameters: + * @param "AsyncMax" (optional.String) - Optional parameter which will make the api request asynchronous. The operation will not be cancelled even if the client disconnect. The URL parameter value overrides the \"async-max\" header value, if any. The value of this header defines the timeout duration for the request, it must be set to a valid duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as \"300ms\", or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\". We reject negative or nil duration values. + * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. +@return Volume */ -func (a *DefaultApiService) UpdateAuthenticatedUser(ctx _context.Context, updateAuthenticatedUserData UpdateAuthenticatedUserData) (User, *_nethttp.Response, error) { +func (a *DefaultApiService) ResizeVolume(ctx _context.Context, namespaceID string, id string, resizeVolumeRequest ResizeVolumeRequest, localVarOptionals *ResizeVolumeOpts) (Volume, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue User + localVarReturnValue Volume ) // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/self" + localVarPath := a.client.cfg.BasePath + "/namespaces/{namespaceID}/volumes/{id}/size" + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.PathEscape(parameterToString(namespaceID, "")) , -1) + + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if localVarOptionals != nil && localVarOptionals.AsyncMax.IsSet() { + localVarQueryParams.Add("async-max", parameterToString(localVarOptionals.AsyncMax.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.IgnoreVersion.IsSet() { + localVarQueryParams.Add("ignore-version", parameterToString(localVarOptionals.IgnoreVersion.Value(), "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -4204,7 +4180,7 @@ func (a *DefaultApiService) UpdateAuthenticatedUser(ctx _context.Context, update localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &updateAuthenticatedUserData + localVarPostBody = &resizeVolumeRequest r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err @@ -4276,6 +4252,16 @@ func (a *DefaultApiService) UpdateAuthenticatedUser(ctx _context.Context, update newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4310,29 +4296,45 @@ func (a *DefaultApiService) UpdateAuthenticatedUser(ctx _context.Context, update return localVarReturnValue, localVarHTTPResponse, nil } +// SetReplicasOpts Optional parameters for the method 'SetReplicas' +type SetReplicasOpts struct { + IgnoreVersion optional.Bool +} + /* -UpdateCluster Update the cluster's global configuration settings -Update the global configuration settings to use for the cluster. +SetReplicas Set the number of replicas to maintain for the volume. +Set the number of replicas for the volume identified by id to the number specified in the request's body. This modifies the protected StorageOS system label \"storageos.com/replicas\". This request changes the desired replica count, and returns an error if changing the desired replica count failed. StorageOS satisfies the new replica configuration asynchronously. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param updateClusterData -@return Cluster + * @param namespaceID ID of a Namespace + * @param id ID of a Volume + * @param setReplicasRequest + * @param optional nil or *SetReplicasOpts - Optional Parameters: + * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. +@return AcceptedMessage */ -func (a *DefaultApiService) UpdateCluster(ctx _context.Context, updateClusterData UpdateClusterData) (Cluster, *_nethttp.Response, error) { +func (a *DefaultApiService) SetReplicas(ctx _context.Context, namespaceID string, id string, setReplicasRequest SetReplicasRequest, localVarOptionals *SetReplicasOpts) (AcceptedMessage, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue Cluster + localVarReturnValue AcceptedMessage ) // create path and map variables - localVarPath := a.client.cfg.BasePath + "/cluster" + localVarPath := a.client.cfg.BasePath + "/namespaces/{namespaceID}/volumes/{id}/replicas" + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.PathEscape(parameterToString(namespaceID, "")) , -1) + + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if localVarOptionals != nil && localVarOptionals.IgnoreVersion.IsSet() { + localVarQueryParams.Add("ignore-version", parameterToString(localVarOptionals.IgnoreVersion.Value(), "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -4351,7 +4353,7 @@ func (a *DefaultApiService) UpdateCluster(ctx _context.Context, updateClusterDat localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &updateClusterData + localVarPostBody = &setReplicasRequest r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err @@ -4403,6 +4405,16 @@ func (a *DefaultApiService) UpdateCluster(ctx _context.Context, updateClusterDat newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 412 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4413,6 +4425,16 @@ func (a *DefaultApiService) UpdateCluster(ctx _context.Context, updateClusterDat newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4448,30 +4470,29 @@ func (a *DefaultApiService) UpdateCluster(ctx _context.Context, updateClusterDat } /* -UpdateLicence Update the licence global configuration settings -Update the cluster's licence. +Spec Serves this openapi spec file +Serves this openapi spec file * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param updateLicence -@return Licence +@return string */ -func (a *DefaultApiService) UpdateLicence(ctx _context.Context, updateLicence UpdateLicence) (Licence, *_nethttp.Response, error) { +func (a *DefaultApiService) Spec(ctx _context.Context) (string, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPut + localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue Licence + localVarReturnValue string ) // create path and map variables - localVarPath := a.client.cfg.BasePath + "/cluster/licence" + localVarPath := a.client.cfg.BasePath + "/openapi" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -4480,15 +4501,13 @@ func (a *DefaultApiService) UpdateLicence(ctx _context.Context, updateLicence Up } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{"text/yaml"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = &updateLicence r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err @@ -4510,65 +4529,6 @@ func (a *DefaultApiService) UpdateLicence(ctx _context.Context, updateLicence Up body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 412 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 503 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -4584,15 +4544,473 @@ func (a *DefaultApiService) UpdateLicence(ctx _context.Context, updateLicence Up return localVarReturnValue, localVarHTTPResponse, nil } +// UpdateAuthenticatedUserOpts Optional parameters for the method 'UpdateAuthenticatedUser' +type UpdateAuthenticatedUserOpts struct { + IgnoreVersion optional.Bool +} + /* -UpdateNamespace Update a namespace -Update the namespace identified by id. +UpdateAuthenticatedUser Update the authenticated user's information +Update the authenticated user. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param id ID of a namespace - * @param updateNamespaceData + * @param updateAuthenticatedUserData + * @param optional nil or *UpdateAuthenticatedUserOpts - Optional Parameters: + * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. +@return User +*/ +func (a *DefaultApiService) UpdateAuthenticatedUser(ctx _context.Context, updateAuthenticatedUserData UpdateAuthenticatedUserData, localVarOptionals *UpdateAuthenticatedUserOpts) (User, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue User + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/self" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if localVarOptionals != nil && localVarOptionals.IgnoreVersion.IsSet() { + localVarQueryParams.Add("ignore-version", parameterToString(localVarOptionals.IgnoreVersion.Value(), "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &updateAuthenticatedUserData + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UpdateClusterOpts Optional parameters for the method 'UpdateCluster' +type UpdateClusterOpts struct { + IgnoreVersion optional.Bool +} + +/* +UpdateCluster Update the cluster's global configuration settings +Update the global configuration settings to use for the cluster. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param updateClusterData + * @param optional nil or *UpdateClusterOpts - Optional Parameters: + * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. +@return Cluster +*/ +func (a *DefaultApiService) UpdateCluster(ctx _context.Context, updateClusterData UpdateClusterData, localVarOptionals *UpdateClusterOpts) (Cluster, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Cluster + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/cluster" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if localVarOptionals != nil && localVarOptionals.IgnoreVersion.IsSet() { + localVarQueryParams.Add("ignore-version", parameterToString(localVarOptionals.IgnoreVersion.Value(), "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &updateClusterData + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UpdateLicenceOpts Optional parameters for the method 'UpdateLicence' +type UpdateLicenceOpts struct { + IgnoreVersion optional.Bool +} + +/* +UpdateLicence Update the licence global configuration settings +Update the cluster's licence. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param updateLicence + * @param optional nil or *UpdateLicenceOpts - Optional Parameters: + * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. +@return Licence +*/ +func (a *DefaultApiService) UpdateLicence(ctx _context.Context, updateLicence UpdateLicence, localVarOptionals *UpdateLicenceOpts) (Licence, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Licence + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/cluster/licence" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if localVarOptionals != nil && localVarOptionals.IgnoreVersion.IsSet() { + localVarQueryParams.Add("ignore-version", parameterToString(localVarOptionals.IgnoreVersion.Value(), "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &updateLicence + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UpdateNamespaceOpts Optional parameters for the method 'UpdateNamespace' +type UpdateNamespaceOpts struct { + IgnoreVersion optional.Bool +} + +/* +UpdateNamespace Update a namespace +Update the namespace identified by id. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ID of a namespace + * @param updateNamespaceData + * @param optional nil or *UpdateNamespaceOpts - Optional Parameters: + * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. @return Namespace */ -func (a *DefaultApiService) UpdateNamespace(ctx _context.Context, id string, updateNamespaceData UpdateNamespaceData) (Namespace, *_nethttp.Response, error) { +func (a *DefaultApiService) UpdateNamespace(ctx _context.Context, id string, updateNamespaceData UpdateNamespaceData, localVarOptionals *UpdateNamespaceOpts) (Namespace, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -4604,12 +5022,15 @@ func (a *DefaultApiService) UpdateNamespace(ctx _context.Context, id string, upd // create path and map variables localVarPath := a.client.cfg.BasePath + "/namespaces/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if localVarOptionals != nil && localVarOptionals.IgnoreVersion.IsSet() { + localVarQueryParams.Add("ignore-version", parameterToString(localVarOptionals.IgnoreVersion.Value(), "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -4734,15 +5155,22 @@ func (a *DefaultApiService) UpdateNamespace(ctx _context.Context, id string, upd return localVarReturnValue, localVarHTTPResponse, nil } +// UpdateNodeOpts Optional parameters for the method 'UpdateNode' +type UpdateNodeOpts struct { + IgnoreVersion optional.Bool +} + /* UpdateNode Update a node Update the node identified by id. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id ID of a node * @param updateNodeData + * @param optional nil or *UpdateNodeOpts - Optional Parameters: + * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. @return Node */ -func (a *DefaultApiService) UpdateNode(ctx _context.Context, id string, updateNodeData UpdateNodeData) (Node, *_nethttp.Response, error) { +func (a *DefaultApiService) UpdateNode(ctx _context.Context, id string, updateNodeData UpdateNodeData, localVarOptionals *UpdateNodeOpts) (Node, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -4754,12 +5182,15 @@ func (a *DefaultApiService) UpdateNode(ctx _context.Context, id string, updateNo // create path and map variables localVarPath := a.client.cfg.BasePath + "/nodes/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if localVarOptionals != nil && localVarOptionals.IgnoreVersion.IsSet() { + localVarQueryParams.Add("ignore-version", parameterToString(localVarOptionals.IgnoreVersion.Value(), "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -4884,15 +5315,22 @@ func (a *DefaultApiService) UpdateNode(ctx _context.Context, id string, updateNo return localVarReturnValue, localVarHTTPResponse, nil } +// UpdatePolicyGroupOpts Optional parameters for the method 'UpdatePolicyGroup' +type UpdatePolicyGroupOpts struct { + IgnoreVersion optional.Bool +} + /* UpdatePolicyGroup Update a policy group Update the policy group identified by id. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id ID of a policy group * @param updatePolicyGroupData + * @param optional nil or *UpdatePolicyGroupOpts - Optional Parameters: + * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. @return PolicyGroup */ -func (a *DefaultApiService) UpdatePolicyGroup(ctx _context.Context, id string, updatePolicyGroupData UpdatePolicyGroupData) (PolicyGroup, *_nethttp.Response, error) { +func (a *DefaultApiService) UpdatePolicyGroup(ctx _context.Context, id string, updatePolicyGroupData UpdatePolicyGroupData, localVarOptionals *UpdatePolicyGroupOpts) (PolicyGroup, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -4904,12 +5342,15 @@ func (a *DefaultApiService) UpdatePolicyGroup(ctx _context.Context, id string, u // create path and map variables localVarPath := a.client.cfg.BasePath + "/policies/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if localVarOptionals != nil && localVarOptionals.IgnoreVersion.IsSet() { + localVarQueryParams.Add("ignore-version", parameterToString(localVarOptionals.IgnoreVersion.Value(), "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -5034,15 +5475,22 @@ func (a *DefaultApiService) UpdatePolicyGroup(ctx _context.Context, id string, u return localVarReturnValue, localVarHTTPResponse, nil } +// UpdateUserOpts Optional parameters for the method 'UpdateUser' +type UpdateUserOpts struct { + IgnoreVersion optional.Bool +} + /* UpdateUser Update a user Update the user identified by id. This request will not succeed if the target account is the currently authenticated account. Use the separate users/self endpoint for this purpose. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id ID of a user * @param updateUserData + * @param optional nil or *UpdateUserOpts - Optional Parameters: + * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. @return User */ -func (a *DefaultApiService) UpdateUser(ctx _context.Context, id string, updateUserData UpdateUserData) (User, *_nethttp.Response, error) { +func (a *DefaultApiService) UpdateUser(ctx _context.Context, id string, updateUserData UpdateUserData, localVarOptionals *UpdateUserOpts) (User, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -5054,12 +5502,15 @@ func (a *DefaultApiService) UpdateUser(ctx _context.Context, id string, updateUs // create path and map variables localVarPath := a.client.cfg.BasePath + "/users/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if localVarOptionals != nil && localVarOptionals.IgnoreVersion.IsSet() { + localVarQueryParams.Add("ignore-version", parameterToString(localVarOptionals.IgnoreVersion.Value(), "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -5183,3 +5634,181 @@ func (a *DefaultApiService) UpdateUser(ctx _context.Context, id string, updateUs return localVarReturnValue, localVarHTTPResponse, nil } + +// UpdateVolumeOpts Optional parameters for the method 'UpdateVolume' +type UpdateVolumeOpts struct { + IgnoreVersion optional.Bool + AsyncMax optional.String +} + +/* +UpdateVolume Update a volume +Update the description and non-storageos labels configured for the volume identified by id. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param namespaceID ID of a Namespace + * @param id ID of a Volume + * @param updateVolumeData + * @param optional nil or *UpdateVolumeOpts - Optional Parameters: + * @param "IgnoreVersion" (optional.Bool) - If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. + * @param "AsyncMax" (optional.String) - Optional parameter which will make the api request asynchronous. The operation will not be cancelled even if the client disconnect. The URL parameter value overrides the \"async-max\" header value, if any. The value of this header defines the timeout duration for the request, it must be set to a valid duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as \"300ms\", or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\". We reject negative or nil duration values. +@return Volume +*/ +func (a *DefaultApiService) UpdateVolume(ctx _context.Context, namespaceID string, id string, updateVolumeData UpdateVolumeData, localVarOptionals *UpdateVolumeOpts) (Volume, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Volume + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/namespaces/{namespaceID}/volumes/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"namespaceID"+"}", _neturl.PathEscape(parameterToString(namespaceID, "")) , -1) + + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if localVarOptionals != nil && localVarOptionals.IgnoreVersion.IsSet() { + localVarQueryParams.Add("ignore-version", parameterToString(localVarOptionals.IgnoreVersion.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.AsyncMax.IsSet() { + localVarQueryParams.Add("async-max", parameterToString(localVarOptionals.AsyncMax.Value(), "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &updateVolumeData + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 412 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 451 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/v2/client.go b/v2/client.go index 7d02762..1986f03 100644 --- a/v2/client.go +++ b/v2/client.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ @@ -41,7 +41,7 @@ var ( xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) -// APIClient manages communication with the StorageOS API API v2.0.0 +// APIClient manages communication with the StorageOS API API v2.1.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration diff --git a/v2/configuration.go b/v2/configuration.go index 707090c..6963d8c 100644 --- a/v2/configuration.go +++ b/v2/configuration.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ @@ -85,7 +85,7 @@ func NewConfiguration() *Configuration { cfg := &Configuration{ BasePath: "http://localhost/v2", DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/2.0.0-rc1/go", + UserAgent: "OpenAPI-Generator/2.1.0/go", Debug: false, Servers: []ServerConfiguration{ { diff --git a/v2/docs/DefaultApi.md b/v2/docs/DefaultApi.md index 03262aa..234c46d 100644 --- a/v2/docs/DefaultApi.md +++ b/v2/docs/DefaultApi.md @@ -34,6 +34,8 @@ Method | HTTP request | Description [**ListUsers**](DefaultApi.md#ListUsers) | **Get** /users | Fetch the list of users [**ListVolumes**](DefaultApi.md#ListVolumes) | **Get** /namespaces/{namespaceID}/volumes | Fetch the list of volumes in the given namespace [**RefreshJwt**](DefaultApi.md#RefreshJwt) | **Post** /auth/refresh | Refresh the JWT +[**ResizeVolume**](DefaultApi.md#ResizeVolume) | **Put** /namespaces/{namespaceID}/volumes/{id}/size | Increase the size of a volume. +[**SetReplicas**](DefaultApi.md#SetReplicas) | **Put** /namespaces/{namespaceID}/volumes/{id}/replicas | Set the number of replicas to maintain for the volume. [**Spec**](DefaultApi.md#Spec) | **Get** /openapi | Serves this openapi spec file [**UpdateAuthenticatedUser**](DefaultApi.md#UpdateAuthenticatedUser) | **Put** /users/self | Update the authenticated user's information [**UpdateCluster**](DefaultApi.md#UpdateCluster) | **Put** /cluster | Update the cluster's global configuration settings @@ -42,6 +44,7 @@ Method | HTTP request | Description [**UpdateNode**](DefaultApi.md#UpdateNode) | **Put** /nodes/{id} | Update a node [**UpdatePolicyGroup**](DefaultApi.md#UpdatePolicyGroup) | **Put** /policies/{id} | Update a policy group [**UpdateUser**](DefaultApi.md#UpdateUser) | **Put** /users/{id} | Update a user +[**UpdateVolume**](DefaultApi.md#UpdateVolume) | **Put** /namespaces/{namespaceID}/volumes/{id} | Update a volume @@ -51,7 +54,7 @@ Method | HTTP request | Description Attach a volume to the given node -Attach the volume identified by id to the node identified in the request's body. +Attach the volume identified by id to the node identified in the request's body. ### Required Parameters @@ -121,7 +124,7 @@ No authorization required Create a new namespace -Create a new namespace in the cluster - only administrators can create new namespaces. +Create a new namespace in the cluster - only administrators can create new namespaces. ### Required Parameters @@ -189,7 +192,7 @@ Name | Type | Description | Notes Create a new user -Create a new user in the cluster - only administrators can create new users. +Create a new user in the cluster - only administrators can create new users. ### Required Parameters @@ -278,7 +281,7 @@ Remove the authenticated user from the cluster. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**version** | **string**| This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | +**version** | **string**| This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | **optional** | ***DeleteAuthenticatedUserOpts** | optional parameters | nil if no parameters ### Optional Parameters @@ -354,7 +357,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| ID of a namespace | -**version** | **string**| This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | +**version** | **string**| This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | **optional** | ***DeleteNamespaceOpts** | optional parameters | nil if no parameters ### Optional Parameters @@ -392,7 +395,7 @@ Name | Type | Description | Notes Delete a node -Remove the node identified by id. A node can only be deleted if it is currently offline. +Remove the node identified by id. A node can only be deleted if it is currently offline and does not host any master deployments. ### Required Parameters @@ -401,7 +404,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| ID of a node | -**version** | **string**| This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | +**version** | **string**| This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | **optional** | ***DeleteNodeOpts** | optional parameters | nil if no parameters ### Optional Parameters @@ -449,7 +452,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| ID of a policy group | -**version** | **string**| This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | +**version** | **string**| This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | **optional** | ***DeletePolicyGroupOpts** | optional parameters | nil if no parameters ### Optional Parameters @@ -530,7 +533,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| ID of a user | -**version** | **string**| This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | +**version** | **string**| This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | **optional** | ***DeleteUserOpts** | optional parameters | nil if no parameters ### Optional Parameters @@ -578,7 +581,7 @@ Name | Type | Description | Notes **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **namespaceID** | **string**| ID of a Namespace | **id** | **string**| ID of a Volume | -**version** | **string**| This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | +**version** | **string**| This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | **optional** | ***DeleteVolumeOpts** | optional parameters | nil if no parameters ### Optional Parameters @@ -593,6 +596,7 @@ Name | Type | Description | Notes **ignoreVersion** | **optional.Bool**| If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. | [default to false] **asyncMax** | **optional.String**| Optional parameter which will make the api request asynchronous. The operation will not be cancelled even if the client disconnect. The URL parameter value overrides the \"async-max\" header value, if any. The value of this header defines the timeout duration for the request, it must be set to a valid duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as \"300ms\", or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\". We reject negative or nil duration values. | + **offlineDelete** | **optional.Bool**| If set to true, enables deletion of a volume when all deployments are offline, bypassing the host nodes which cannot be reached. An offline delete request will be rejected when either a) there are online deployments for the target volume or b) there is evidence that an unreachable node still has the volume master | [default to false] ### Return type @@ -628,7 +632,7 @@ Name | Type | Description | Notes **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **namespaceID** | **string**| ID of a Namespace | **id** | **string**| ID of a Volume | -**version** | **string**| This value is used to perform a conditional delete of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | +**version** | **string**| This value is used to perform a conditional delete or update of the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. | **optional** | ***DetachVolumeOpts** | optional parameters | nil if no parameters ### Optional Parameters @@ -642,6 +646,7 @@ Name | Type | Description | Notes **ignoreVersion** | **optional.Bool**| If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. | [default to false] + **asyncMax** | **optional.String**| Optional parameter which will make the api request asynchronous. The operation will not be cancelled even if the client disconnect. The URL parameter value overrides the \"async-max\" header value, if any. The value of this header defines the timeout duration for the request, it must be set to a valid duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as \"300ms\", or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\". We reject negative or nil duration values. | ### Return type @@ -697,7 +702,7 @@ This endpoint does not need any parameter. Retrieves the cluster's global configuration settings -Retrieves the current global configuration settings in use by the cluster. +Retrieves the current global configuration settings in use by the cluster. ### Required Parameters @@ -1136,6 +1141,105 @@ This endpoint does not need any parameter. [[Back to README]](../README.md) +## ResizeVolume + +> Volume ResizeVolume(ctx, namespaceID, id, resizeVolumeRequest, optional) + +Increase the size of a volume. + +Resize the volume identified by id in the namespace identified by namespaceID. A volume's size cannot be reduced. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**namespaceID** | **string**| ID of a Namespace | +**id** | **string**| ID of a Volume | +**resizeVolumeRequest** | [**ResizeVolumeRequest**](ResizeVolumeRequest.md)| | + **optional** | ***ResizeVolumeOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a ResizeVolumeOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **asyncMax** | **optional.String**| Optional parameter which will make the api request asynchronous. The operation will not be cancelled even if the client disconnect. The URL parameter value overrides the \"async-max\" header value, if any. The value of this header defines the timeout duration for the request, it must be set to a valid duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as \"300ms\", or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\". We reject negative or nil duration values. | + **ignoreVersion** | **optional.Bool**| If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. | [default to false] + +### Return type + +[**Volume**](Volume.md) + +### Authorization + +[jwt](../README.md#jwt) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## SetReplicas + +> AcceptedMessage SetReplicas(ctx, namespaceID, id, setReplicasRequest, optional) + +Set the number of replicas to maintain for the volume. + +Set the number of replicas for the volume identified by id to the number specified in the request's body. This modifies the protected StorageOS system label \"storageos.com/replicas\". This request changes the desired replica count, and returns an error if changing the desired replica count failed. StorageOS satisfies the new replica configuration asynchronously. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**namespaceID** | **string**| ID of a Namespace | +**id** | **string**| ID of a Volume | +**setReplicasRequest** | [**SetReplicasRequest**](SetReplicasRequest.md)| | + **optional** | ***SetReplicasOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a SetReplicasOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **ignoreVersion** | **optional.Bool**| If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. | [default to false] + +### Return type + +[**AcceptedMessage**](AcceptedMessage.md) + +### Authorization + +[jwt](../README.md#jwt) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## Spec > string Spec(ctx, ) @@ -1168,7 +1272,7 @@ No authorization required ## UpdateAuthenticatedUser -> User UpdateAuthenticatedUser(ctx, updateAuthenticatedUserData) +> User UpdateAuthenticatedUser(ctx, updateAuthenticatedUserData, optional) Update the authenticated user's information @@ -1181,6 +1285,17 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **updateAuthenticatedUserData** | [**UpdateAuthenticatedUserData**](UpdateAuthenticatedUserData.md)| | + **optional** | ***UpdateAuthenticatedUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UpdateAuthenticatedUserOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **ignoreVersion** | **optional.Bool**| If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. | [default to false] ### Return type @@ -1202,7 +1317,7 @@ Name | Type | Description | Notes ## UpdateCluster -> Cluster UpdateCluster(ctx, updateClusterData) +> Cluster UpdateCluster(ctx, updateClusterData, optional) Update the cluster's global configuration settings @@ -1215,6 +1330,17 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **updateClusterData** | [**UpdateClusterData**](UpdateClusterData.md)| | + **optional** | ***UpdateClusterOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UpdateClusterOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **ignoreVersion** | **optional.Bool**| If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. | [default to false] ### Return type @@ -1236,7 +1362,7 @@ Name | Type | Description | Notes ## UpdateLicence -> Licence UpdateLicence(ctx, updateLicence) +> Licence UpdateLicence(ctx, updateLicence, optional) Update the licence global configuration settings @@ -1249,6 +1375,17 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **updateLicence** | [**UpdateLicence**](UpdateLicence.md)| | + **optional** | ***UpdateLicenceOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UpdateLicenceOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **ignoreVersion** | **optional.Bool**| If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. | [default to false] ### Return type @@ -1270,7 +1407,7 @@ Name | Type | Description | Notes ## UpdateNamespace -> Namespace UpdateNamespace(ctx, id, updateNamespaceData) +> Namespace UpdateNamespace(ctx, id, updateNamespaceData, optional) Update a namespace @@ -1284,6 +1421,18 @@ Name | Type | Description | Notes **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| ID of a namespace | **updateNamespaceData** | [**UpdateNamespaceData**](UpdateNamespaceData.md)| | + **optional** | ***UpdateNamespaceOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UpdateNamespaceOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **ignoreVersion** | **optional.Bool**| If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. | [default to false] ### Return type @@ -1305,7 +1454,7 @@ Name | Type | Description | Notes ## UpdateNode -> Node UpdateNode(ctx, id, updateNodeData) +> Node UpdateNode(ctx, id, updateNodeData, optional) Update a node @@ -1319,6 +1468,18 @@ Name | Type | Description | Notes **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| ID of a node | **updateNodeData** | [**UpdateNodeData**](UpdateNodeData.md)| | + **optional** | ***UpdateNodeOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UpdateNodeOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **ignoreVersion** | **optional.Bool**| If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. | [default to false] ### Return type @@ -1340,7 +1501,7 @@ Name | Type | Description | Notes ## UpdatePolicyGroup -> PolicyGroup UpdatePolicyGroup(ctx, id, updatePolicyGroupData) +> PolicyGroup UpdatePolicyGroup(ctx, id, updatePolicyGroupData, optional) Update a policy group @@ -1354,6 +1515,18 @@ Name | Type | Description | Notes **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| ID of a policy group | **updatePolicyGroupData** | [**UpdatePolicyGroupData**](UpdatePolicyGroupData.md)| | + **optional** | ***UpdatePolicyGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UpdatePolicyGroupOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **ignoreVersion** | **optional.Bool**| If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. | [default to false] ### Return type @@ -1375,7 +1548,7 @@ Name | Type | Description | Notes ## UpdateUser -> User UpdateUser(ctx, id, updateUserData) +> User UpdateUser(ctx, id, updateUserData, optional) Update a user @@ -1389,6 +1562,18 @@ Name | Type | Description | Notes **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **id** | **string**| ID of a user | **updateUserData** | [**UpdateUserData**](UpdateUserData.md)| | + **optional** | ***UpdateUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UpdateUserOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **ignoreVersion** | **optional.Bool**| If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. | [default to false] ### Return type @@ -1407,3 +1592,53 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## UpdateVolume + +> Volume UpdateVolume(ctx, namespaceID, id, updateVolumeData, optional) + +Update a volume + +Update the description and non-storageos labels configured for the volume identified by id. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**namespaceID** | **string**| ID of a Namespace | +**id** | **string**| ID of a Volume | +**updateVolumeData** | [**UpdateVolumeData**](UpdateVolumeData.md)| | + **optional** | ***UpdateVolumeOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UpdateVolumeOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **ignoreVersion** | **optional.Bool**| If set to true this value indicates that the user wants to ignore entity version constraints, thereby \"forcing\" the operation. | [default to false] + **asyncMax** | **optional.String**| Optional parameter which will make the api request asynchronous. The operation will not be cancelled even if the client disconnect. The URL parameter value overrides the \"async-max\" header value, if any. The value of this header defines the timeout duration for the request, it must be set to a valid duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as \"300ms\", or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\". We reject negative or nil duration values. | + +### Return type + +[**Volume**](Volume.md) + +### Authorization + +[jwt](../README.md#jwt) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/v2/docs/Health.md b/v2/docs/Health.md deleted file mode 100644 index 265c7f5..0000000 --- a/v2/docs/Health.md +++ /dev/null @@ -1,10 +0,0 @@ -# Health - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/ResizeVolumeRequest.md b/v2/docs/ResizeVolumeRequest.md new file mode 100644 index 0000000..50f8047 --- /dev/null +++ b/v2/docs/ResizeVolumeRequest.md @@ -0,0 +1,12 @@ +# ResizeVolumeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SizeBytes** | **uint64** | The desired new size for the volume in bytes. This value cannot be less than the current size of the volume. | [optional] +**Version** | **string** | An opaque representation of an entity version at the time it was obtained from the API. All operations that mutate the entity must include this version field in the request unchanged. The format of this type is undefined and may change but the defined properties will not change. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v2/docs/SetReplicasRequest.md b/v2/docs/SetReplicasRequest.md new file mode 100644 index 0000000..99a09ba --- /dev/null +++ b/v2/docs/SetReplicasRequest.md @@ -0,0 +1,12 @@ +# SetReplicasRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Replicas** | **uint64** | The number of replicas desired. | [optional] +**Version** | **string** | An opaque representation of an entity version at the time it was obtained from the API. All operations that mutate the entity must include this version field in the request unchanged. The format of this type is undefined and may change but the defined properties will not change. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v2/docs/UpdateVolumeData.md b/v2/docs/UpdateVolumeData.md index 64012ba..18aea59 100644 --- a/v2/docs/UpdateVolumeData.md +++ b/v2/docs/UpdateVolumeData.md @@ -4,7 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | desired new volume name | [optional] **Labels** | **map[string]string** | A set of arbitrary key value labels to apply to the entity. | [optional] **Description** | **string** | | [optional] **Version** | **string** | An opaque representation of an entity version at the time it was obtained from the API. All operations that mutate the entity must include this version field in the request unchanged. The format of this type is undefined and may change but the defined properties will not change. | [optional] diff --git a/v2/model__policies__id__specs.go b/v2/model__policies__id__specs.go index c46561d..5c78f7c 100644 --- a/v2/model__policies__id__specs.go +++ b/v2/model__policies__id__specs.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model__policies_specs.go b/v2/model__policies_specs.go index 7c277d9..96ba885 100644 --- a/v2/model__policies_specs.go +++ b/v2/model__policies_specs.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_accepted_message.go b/v2/model_accepted_message.go index 5c8746d..61b6c07 100644 --- a/v2/model_accepted_message.go +++ b/v2/model_accepted_message.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_attach_volume_data.go b/v2/model_attach_volume_data.go index 4c9f48e..7cc2976 100644 --- a/v2/model_attach_volume_data.go +++ b/v2/model_attach_volume_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_auth_user_data.go b/v2/model_auth_user_data.go index 18a49f0..12bf959 100644 --- a/v2/model_auth_user_data.go +++ b/v2/model_auth_user_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_capacity_stats.go b/v2/model_capacity_stats.go index 86e86eb..721aae0 100644 --- a/v2/model_capacity_stats.go +++ b/v2/model_capacity_stats.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_cluster.go b/v2/model_cluster.go index 97487a0..3950f1e 100644 --- a/v2/model_cluster.go +++ b/v2/model_cluster.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_create_namespace_data.go b/v2/model_create_namespace_data.go index c3cbd4e..fcd2040 100644 --- a/v2/model_create_namespace_data.go +++ b/v2/model_create_namespace_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_create_policy_group_data.go b/v2/model_create_policy_group_data.go index 51ef42c..8f23db4 100644 --- a/v2/model_create_policy_group_data.go +++ b/v2/model_create_policy_group_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_create_user_data.go b/v2/model_create_user_data.go index 1fe933f..89de78e 100644 --- a/v2/model_create_user_data.go +++ b/v2/model_create_user_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_create_volume_data.go b/v2/model_create_volume_data.go index 36abf4e..606536b 100644 --- a/v2/model_create_volume_data.go +++ b/v2/model_create_volume_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_deployment_info.go b/v2/model_deployment_info.go index 993adea..7c7e1c9 100644 --- a/v2/model_deployment_info.go +++ b/v2/model_deployment_info.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_error.go b/v2/model_error.go index aa143be..0f741b5 100644 --- a/v2/model_error.go +++ b/v2/model_error.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_fs_type.go b/v2/model_fs_type.go index 19b20f9..a4d52f3 100644 --- a/v2/model_fs_type.go +++ b/v2/model_fs_type.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_health.go b/v2/model_health.go deleted file mode 100644 index cdc830b..0000000 --- a/v2/model_health.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - * StorageOS API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * API version: 2.0.0 - * Contact: info@storageos.com - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package api -// Health The operational health of an entity -type Health string - -// List of Health -const ( - HEALTH_ONLINE Health = "online" - HEALTH_OFFLINE Health = "offline" - HEALTH_UNKNOWN Health = "unknown" -) diff --git a/v2/model_licence.go b/v2/model_licence.go index 4901a4e..d901662 100644 --- a/v2/model_licence.go +++ b/v2/model_licence.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_log_format.go b/v2/model_log_format.go index a34a2d5..bc83ecf 100644 --- a/v2/model_log_format.go +++ b/v2/model_log_format.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_log_level.go b/v2/model_log_level.go index 3b1f607..98c52b5 100644 --- a/v2/model_log_level.go +++ b/v2/model_log_level.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_master_deployment_info.go b/v2/model_master_deployment_info.go index 7778fa4..77e89bb 100644 --- a/v2/model_master_deployment_info.go +++ b/v2/model_master_deployment_info.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_master_deployment_info_all_of.go b/v2/model_master_deployment_info_all_of.go index 4e05a33..b0a10c7 100644 --- a/v2/model_master_deployment_info_all_of.go +++ b/v2/model_master_deployment_info_all_of.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_master_health.go b/v2/model_master_health.go index b622731..bae5ce9 100644 --- a/v2/model_master_health.go +++ b/v2/model_master_health.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_namespace.go b/v2/model_namespace.go index f8fd5d2..da579b8 100644 --- a/v2/model_namespace.go +++ b/v2/model_namespace.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_node.go b/v2/model_node.go index 0ef41f4..4633964 100644 --- a/v2/model_node.go +++ b/v2/model_node.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_node_health.go b/v2/model_node_health.go index 9c48019..2f74e0f 100644 --- a/v2/model_node_health.go +++ b/v2/model_node_health.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_policy_group.go b/v2/model_policy_group.go index 325a117..7f162cf 100644 --- a/v2/model_policy_group.go +++ b/v2/model_policy_group.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_policy_group_users.go b/v2/model_policy_group_users.go index 1d20446..2bffe1a 100644 --- a/v2/model_policy_group_users.go +++ b/v2/model_policy_group_users.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_replica_deployment_info.go b/v2/model_replica_deployment_info.go index f6fa3b4..8a1b744 100644 --- a/v2/model_replica_deployment_info.go +++ b/v2/model_replica_deployment_info.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_replica_deployment_info_all_of.go b/v2/model_replica_deployment_info_all_of.go index 87e6864..0ae7c0f 100644 --- a/v2/model_replica_deployment_info_all_of.go +++ b/v2/model_replica_deployment_info_all_of.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_replica_health.go b/v2/model_replica_health.go index 271ffe5..3840513 100644 --- a/v2/model_replica_health.go +++ b/v2/model_replica_health.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_resize_volume_request.go b/v2/model_resize_volume_request.go new file mode 100644 index 0000000..849d475 --- /dev/null +++ b/v2/model_resize_volume_request.go @@ -0,0 +1,18 @@ +/* + * StorageOS API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 2.1.0 + * Contact: info@storageos.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package api +// ResizeVolumeRequest struct for ResizeVolumeRequest +type ResizeVolumeRequest struct { + // The desired new size for the volume in bytes. This value cannot be less than the current size of the volume. + SizeBytes uint64 `json:"sizeBytes,omitempty"` + // An opaque representation of an entity version at the time it was obtained from the API. All operations that mutate the entity must include this version field in the request unchanged. The format of this type is undefined and may change but the defined properties will not change. + Version string `json:"version,omitempty"` +} diff --git a/v2/model_set_replicas_request.go b/v2/model_set_replicas_request.go new file mode 100644 index 0000000..2f06152 --- /dev/null +++ b/v2/model_set_replicas_request.go @@ -0,0 +1,18 @@ +/* + * StorageOS API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 2.1.0 + * Contact: info@storageos.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package api +// SetReplicasRequest struct for SetReplicasRequest +type SetReplicasRequest struct { + // The number of replicas desired. + Replicas uint64 `json:"replicas,omitempty"` + // An opaque representation of an entity version at the time it was obtained from the API. All operations that mutate the entity must include this version field in the request unchanged. The format of this type is undefined and may change but the defined properties will not change. + Version string `json:"version,omitempty"` +} diff --git a/v2/model_sync_progress.go b/v2/model_sync_progress.go index 98eec9d..a38c870 100644 --- a/v2/model_sync_progress.go +++ b/v2/model_sync_progress.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_update_authenticated_user_data.go b/v2/model_update_authenticated_user_data.go index 999b5c6..a5ac6a0 100644 --- a/v2/model_update_authenticated_user_data.go +++ b/v2/model_update_authenticated_user_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_update_cluster_data.go b/v2/model_update_cluster_data.go index ad882c7..37db4d2 100644 --- a/v2/model_update_cluster_data.go +++ b/v2/model_update_cluster_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_update_licence.go b/v2/model_update_licence.go index 24a8094..81af925 100644 --- a/v2/model_update_licence.go +++ b/v2/model_update_licence.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_update_namespace_data.go b/v2/model_update_namespace_data.go index d338513..d63602d 100644 --- a/v2/model_update_namespace_data.go +++ b/v2/model_update_namespace_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_update_node_data.go b/v2/model_update_node_data.go index 3bfdbfb..0882114 100644 --- a/v2/model_update_node_data.go +++ b/v2/model_update_node_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_update_policy_group_data.go b/v2/model_update_policy_group_data.go index 1192628..226fd35 100644 --- a/v2/model_update_policy_group_data.go +++ b/v2/model_update_policy_group_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_update_user_data.go b/v2/model_update_user_data.go index d27982d..a778039 100644 --- a/v2/model_update_user_data.go +++ b/v2/model_update_user_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_update_volume_data.go b/v2/model_update_volume_data.go index 8febd28..f2b3d96 100644 --- a/v2/model_update_volume_data.go +++ b/v2/model_update_volume_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ @@ -11,8 +11,6 @@ package api // UpdateVolumeData struct for UpdateVolumeData type UpdateVolumeData struct { - // desired new volume name - Name string `json:"name,omitempty"` // A set of arbitrary key value labels to apply to the entity. Labels map[string]string `json:"labels,omitempty"` Description string `json:"description,omitempty"` diff --git a/v2/model_user.go b/v2/model_user.go index 2157f1d..b8615d9 100644 --- a/v2/model_user.go +++ b/v2/model_user.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_user_session.go b/v2/model_user_session.go index 30a0447..21ef6d6 100644 --- a/v2/model_user_session.go +++ b/v2/model_user_session.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_user_session_all_of.go b/v2/model_user_session_all_of.go index 9419a78..83bedbc 100644 --- a/v2/model_user_session_all_of.go +++ b/v2/model_user_session_all_of.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_user_session_all_of_session.go b/v2/model_user_session_all_of_session.go index daef8e3..d1d7c6c 100644 --- a/v2/model_user_session_all_of_session.go +++ b/v2/model_user_session_all_of_session.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_volume.go b/v2/model_volume.go index 470c4f8..810c195 100644 --- a/v2/model_volume.go +++ b/v2/model_volume.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/openapi.yaml b/v2/openapi.yaml index ee84b88..56133f9 100644 --- a/v2/openapi.yaml +++ b/v2/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.2" info: title: "StorageOS API" - version: "2.0.0" + version: "2.1.0" contact: name: StorageOS url: https://storageos.com @@ -466,8 +466,8 @@ components: type: uint64 description: > A volume's size in bytes - minimum: 0 - example: 5000 + minimum: 1073742000 + example: 5368709000 createdAt: $ref: "#/components/schemas/CreatedAt" updatedAt: @@ -735,8 +735,8 @@ components: name: version in: query description: > - This value is used to perform a conditional delete of the - entity. + This value is used to perform a conditional delete or update of + the entity. If the entity has been modified since the version token was obtained, the request will fail with a HTTP 409 Conflict. @@ -931,6 +931,17 @@ components: example: error: in use + Locked: + description: > + A lock is held for the target entity, preventing the operation + to be carried out safely. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + example: + error: entity locked + Accepted: description: > An aynchronous request has been accepted @@ -1042,7 +1053,9 @@ paths: post: summary: Create a new user operationId: createUser - description: Create a new user in the cluster - only administrators can create new users. + description: > + Create a new user in the cluster - only administrators can + create new users. security: - jwt: [] requestBody: @@ -1195,6 +1208,8 @@ paths: endpoint for this purpose. security: - jwt: [] + parameters: + - $ref: "#/components/parameters/IgnoreVersion" requestBody: description: The new User data to store. required: true @@ -1389,6 +1404,8 @@ paths: description: Update the authenticated user. security: - jwt: [] + parameters: + - $ref: "#/components/parameters/IgnoreVersion" requestBody: description: The new authenticated user's data. required: true @@ -1506,7 +1523,9 @@ paths: post: summary: Create a new namespace operationId: createNamespace - description: Create a new namespace in the cluster - only administrators can create new namespaces. + description: > + Create a new namespace in the cluster - only administrators can + create new namespaces. security: - jwt: [] requestBody: @@ -1625,6 +1644,8 @@ paths: description: Update the namespace identified by id. security: - jwt: [] + parameters: + - $ref: "#/components/parameters/IgnoreVersion" requestBody: description: The new namespace data to store. required: true @@ -1776,6 +1797,8 @@ paths: description: Update the node identified by id. security: - jwt: [] + parameters: + - $ref: "#/components/parameters/IgnoreVersion" requestBody: description: The new node data to store. required: true @@ -1824,7 +1847,8 @@ paths: description: > Remove the node identified by id. - A node can only be deleted if it is currently offline. + A node can only be deleted if it is currently offline and does + not host any master deployments. security: - jwt: [] parameters: @@ -1853,19 +1877,14 @@ paths: $ref: "#/components/responses/NotFound" "409": - description: > - The request attempted to delete a node that is not - currently offline. - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - example: - error: node not offline + $ref: "#/components/responses/InUse" "412": $ref: "#/components/responses/StaleWrite" + "423": + $ref: "#/components/responses/Locked" + "500": $ref: "#/components/responses/ServerError" @@ -2029,6 +2048,8 @@ paths: description: Update the policy group identified by id. security: - jwt: [] + parameters: + - $ref: "#/components/parameters/IgnoreVersion" requestBody: description: The new policy group data to store. required: true @@ -2296,6 +2317,67 @@ paths: "503": $ref: "#/components/responses/StoreError" + put: + summary: Update a volume + operationId: updateVolume + description: > + Update the description and non-storageos labels configured for + the volume identified by id. + security: + - jwt: [] + parameters: + - $ref: "#/components/parameters/IgnoreVersion" + - $ref: "#/components/parameters/AsyncHeader" + - $ref: "#/components/parameters/AsyncParam" + requestBody: + description: > + Update the volume description and label configuration to the + desired state. Alterations of StorageOS labels are rejected. + required: true + content: + application/json: + schema: + type: object + title: UpdateVolumeData + properties: + labels: + $ref: "#/components/schemas/Labels" + description: + type: string + example: "This volume contains the data for my app" + version: + $ref: "#/components/schemas/Version" + responses: + "200": + description: The volume was successfully updated + content: + application/json: + schema: + $ref: "#/components/schemas/Volume" + "400": + $ref: "#/components/responses/BadRequest" + + "401": + $ref: "#/components/responses/Unauthorised" + + "403": + $ref: "#/components/responses/Forbidden" + + "404": + $ref: "#/components/responses/NotFound" + + "412": + $ref: "#/components/responses/StaleWrite" + + "451": + $ref: "#/components/responses/LicenceRestricted" + + "500": + $ref: "#/components/responses/ServerError" + + "503": + $ref: "#/components/responses/StoreError" + delete: summary: Delete a volume @@ -2309,6 +2391,24 @@ paths: - $ref: "#/components/parameters/AsyncHeader" - $ref: "#/components/parameters/AsyncParam" + + - name: offline-delete + in: query + description: > + If set to true, enables deletion of a volume when all + deployments are offline, bypassing the host nodes which + cannot be reached. + + An offline delete request will be rejected when either + a) there are online deployments for the target volume or + b) there is evidence that an unreachable node still has + the volume master + required: false + schema: + type: boolean + default: false + example: true + responses: "200": description: The volume was successfully deleted. @@ -2337,6 +2437,9 @@ paths: "422": $ref: "#/components/responses/InvalidStateTransition" + "423": + $ref: "#/components/responses/Locked" + "500": $ref: "#/components/responses/ServerError" @@ -2360,7 +2463,9 @@ paths: post: summary: Attach a volume to the given node operationId: attachVolume - description: Attach the volume identified by id to the node identified in the request's body. + description: > + Attach the volume identified by id to the node identified in the + request's body. security: - jwt: [] requestBody: @@ -2407,6 +2512,8 @@ paths: parameters: - $ref: "#/components/parameters/ObjectVersion" - $ref: "#/components/parameters/IgnoreVersion" + - $ref: "#/components/parameters/AsyncHeader" + - $ref: "#/components/parameters/AsyncParam" responses: "200": description: The volume was successfully detached. @@ -2438,11 +2545,169 @@ paths: "503": $ref: "#/components/responses/StoreError" + /namespaces/{namespaceID}/volumes/{id}/replicas: + parameters: + - name: namespaceID + in: path + description: ID of a Namespace + required: true + schema: + $ref: "#/components/schemas/NamespaceID" + - name: id + in: path + description: ID of a Volume + required: true + schema: + $ref: "#/components/schemas/VolumeID" + put: + summary: Set the number of replicas to maintain for the volume. + operationId: setReplicas + description: > + Set the number of replicas for the volume identified by id to + the number specified in the request's body. This modifies the + protected StorageOS system label "storageos.com/replicas". + + This request changes the desired replica count, and returns an + error if changing the desired replica count failed. StorageOS + satisfies the new replica configuration asynchronously. + security: + - jwt: [] + parameters: + - $ref: "#/components/parameters/IgnoreVersion" + requestBody: + description: Number of replicas + required: true + content: + application/json: + schema: + type: object + title: SetReplicasRequest + properties: + replicas: + type: uint64 + default: 0 + minimum: 0 + maximum: 5 + description: > + The number of replicas desired. + example: 2 + version: + $ref: "#/components/schemas/Version" + responses: + "202": + $ref: "#/components/responses/Accepted" + + "400": + $ref: "#/components/responses/BadRequest" + + "401": + $ref: "#/components/responses/Unauthorised" + + "403": + $ref: "#/components/responses/Forbidden" + + "404": + $ref: "#/components/responses/NotFound" + + "412": + $ref: "#/components/responses/StaleWrite" + + "422": + $ref: "#/components/responses/InvalidStateTransition" + + "500": + $ref: "#/components/responses/ServerError" + + "503": + $ref: "#/components/responses/StoreError" + + /namespaces/{namespaceID}/volumes/{id}/size: + parameters: + - name: namespaceID + in: path + description: ID of a Namespace + required: true + schema: + $ref: "#/components/schemas/NamespaceID" + - name: id + in: path + description: ID of a Volume + required: true + schema: + $ref: "#/components/schemas/VolumeID" + + put: + summary: Increase the size of a volume. + operationId: resizeVolume + description: > + Resize the volume identified by id in the namespace identified + by namespaceID. A volume's size cannot be reduced. + security: + - jwt: [] + parameters: + - $ref: "#/components/parameters/AsyncHeader" + - $ref: "#/components/parameters/AsyncParam" + - $ref: "#/components/parameters/IgnoreVersion" + requestBody: + description: The new size to give the volume + required: true + content: + application/json: + schema: + type: object + title: ResizeVolumeRequest + properties: + sizeBytes: + type: uint64 + description: > + The desired new size for the volume in + bytes. This value cannot be less than + the current size of the volume. + minimum: 1073742000 + example: 5368709000 + version: + $ref: "#/components/schemas/Version" + responses: + "200": + description: The volume was resized successfully. + content: + application/json: + schema: + $ref: "#/components/schemas/Volume" + "202": + $ref: "#/components/responses/Accepted" + + "400": + $ref: "#/components/responses/BadRequest" + + "401": + $ref: "#/components/responses/Unauthorised" + + "403": + $ref: "#/components/responses/Forbidden" + + "404": + $ref: "#/components/responses/NotFound" + + "412": + $ref: "#/components/responses/StaleWrite" + + "422": + $ref: "#/components/responses/InvalidStateTransition" + + "500": + $ref: "#/components/responses/ServerError" + + "503": + $ref: "#/components/responses/StoreError" + /cluster: get: summary: Retrieves the cluster's global configuration settings operationId: getCluster - description: Retrieves the current global configuration settings in use by the cluster. + description: > + Retrieves the current global configuration settings in use by + the cluster. security: - jwt: [] responses: @@ -2471,6 +2736,8 @@ paths: description: Update the global configuration settings to use for the cluster. security: - jwt: [] + parameters: + - $ref: "#/components/parameters/IgnoreVersion" requestBody: description: The new cluster-wide configuration settings to apply. required: true @@ -2568,6 +2835,8 @@ paths: description: Update the cluster's licence. security: - jwt: [] + parameters: + - $ref: "#/components/parameters/IgnoreVersion" requestBody: description: > A StorageOS product licence key, used to @@ -2667,4 +2936,4 @@ paths: content: text/yaml: schema: - $ref: "#/components/schemas/OpenAPISpec" + $ref: "#/components/schemas/OpenAPISpec" \ No newline at end of file diff --git a/v2/response.go b/v2/response.go index b600293..e27de23 100644 --- a/v2/response.go +++ b/v2/response.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.0.0 + * API version: 2.1.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */