From a30cf41359d2c689886bfaec9e1aafbf1e1e607d Mon Sep 17 00:00:00 2001 From: Simon Croome Date: Tue, 20 Apr 2021 15:36:24 +0100 Subject: [PATCH] Update for v2.4.0 --- v2/.openapi-generator/FILES | 9 +- v2/Makefile | 2 +- v2/README.md | 10 +- v2/api/openapi.yaml | 308 +++++++++++++++-- v2/api_default.go | 318 +++++++++++++++++- v2/client.go | 4 +- v2/configuration.go | 4 +- v2/docs/DefaultApi.md | 89 ++++- v2/docs/FailureModeIntent.md | 10 + v2/docs/SetFailureModeIntentRequestData.md | 12 + v2/docs/SetFailureModeRequest.md | 13 + v2/docs/SetFailureThresholdRequestData.md | 12 + v2/go.mod | 4 +- v2/model__policies__id__specs.go | 2 +- v2/model__policies_specs.go | 2 +- v2/model_accepted_message.go | 2 +- v2/model_attach_nfs_volume_data.go | 2 +- v2/model_attach_type.go | 2 +- v2/model_attach_volume_data.go | 2 +- v2/model_auth_user_data.go | 2 +- v2/model_capacity_stats.go | 2 +- v2/model_cluster.go | 2 +- v2/model_create_namespace_data.go | 2 +- v2/model_create_policy_group_data.go | 2 +- v2/model_create_user_data.go | 2 +- v2/model_create_volume_data.go | 2 +- v2/model_deployment_info.go | 2 +- v2/model_error.go | 2 +- v2/model_failure_mode_intent.go | 20 ++ v2/model_fs_type.go | 2 +- v2/model_licence.go | 2 +- v2/model_log_format.go | 2 +- v2/model_log_level.go | 2 +- v2/model_master_deployment_info.go | 2 +- v2/model_master_deployment_info_all_of.go | 2 +- v2/model_master_health.go | 2 +- v2/model_namespace.go | 7 +- v2/model_nfs_acl.go | 2 +- v2/model_nfs_acl_identity.go | 2 +- v2/model_nfs_acl_squash_config.go | 2 +- v2/model_nfs_config.go | 2 +- v2/model_nfs_export_config.go | 2 +- v2/model_nfs_volume_exports.go | 2 +- v2/model_nfs_volume_mount_endpoint.go | 2 +- v2/model_node.go | 10 +- v2/model_node_health.go | 2 +- v2/model_policy_group.go | 2 +- v2/model_policy_group_users.go | 2 +- v2/model_replica_deployment_info.go | 2 +- v2/model_replica_deployment_info_all_of.go | 2 +- v2/model_replica_health.go | 2 +- v2/model_resize_volume_request.go | 2 +- v2/model_set_compute_only_node_data.go | 2 +- ...el_set_failure_mode_intent_request_data.go | 17 + v2/model_set_failure_mode_request.go | 19 ++ ...odel_set_failure_threshold_request_data.go | 18 + v2/model_set_replicas_request.go | 2 +- v2/model_sync_progress.go | 2 +- v2/model_update_authenticated_user_data.go | 2 +- v2/model_update_cluster_data.go | 2 +- v2/model_update_licence.go | 2 +- v2/model_update_namespace_data.go | 2 +- v2/model_update_node_data.go | 2 +- v2/model_update_policy_group_data.go | 2 +- v2/model_update_user_data.go | 2 +- v2/model_update_volume_data.go | 2 +- v2/model_user.go | 2 +- v2/model_user_session.go | 2 +- v2/model_user_session_all_of.go | 2 +- v2/model_user_session_all_of_session.go | 2 +- v2/model_volume.go | 10 +- v2/openapi.yaml | 227 ++++++++++++- v2/response.go | 2 +- v2/templates/namespace/model.mustache | 5 + v2/templates/node/model.mustache | 8 + v2/templates/volume/model.mustache | 8 + 76 files changed, 1140 insertions(+), 108 deletions(-) create mode 100644 v2/docs/FailureModeIntent.md create mode 100644 v2/docs/SetFailureModeIntentRequestData.md create mode 100644 v2/docs/SetFailureModeRequest.md create mode 100644 v2/docs/SetFailureThresholdRequestData.md create mode 100644 v2/model_failure_mode_intent.go create mode 100644 v2/model_set_failure_mode_intent_request_data.go create mode 100644 v2/model_set_failure_mode_request.go create mode 100644 v2/model_set_failure_threshold_request_data.go diff --git a/v2/.openapi-generator/FILES b/v2/.openapi-generator/FILES index 5b1c8b0..f5bf10f 100644 --- a/v2/.openapi-generator/FILES +++ b/v2/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml @@ -20,6 +19,7 @@ docs/CreateVolumeData.md docs/DefaultApi.md docs/DeploymentInfo.md docs/Error.md +docs/FailureModeIntent.md docs/FsType.md docs/Licence.md docs/LogFormat.md @@ -46,6 +46,9 @@ docs/ReplicaDeploymentInfoAllOf.md docs/ReplicaHealth.md docs/ResizeVolumeRequest.md docs/SetComputeOnlyNodeData.md +docs/SetFailureModeIntentRequestData.md +docs/SetFailureModeRequest.md +docs/SetFailureThresholdRequestData.md docs/SetReplicasRequest.md docs/SyncProgress.md docs/UpdateAuthenticatedUserData.md @@ -79,6 +82,7 @@ model_create_user_data.go model_create_volume_data.go model_deployment_info.go model_error.go +model_failure_mode_intent.go model_fs_type.go model_licence.go model_log_format.go @@ -103,6 +107,9 @@ model_replica_deployment_info_all_of.go model_replica_health.go model_resize_volume_request.go model_set_compute_only_node_data.go +model_set_failure_mode_intent_request_data.go +model_set_failure_mode_request.go +model_set_failure_threshold_request_data.go model_set_replicas_request.go model_sync_progress.go model_update_authenticated_user_data.go diff --git a/v2/Makefile b/v2/Makefile index 760f5aa..c07253d 100644 --- a/v2/Makefile +++ b/v2/Makefile @@ -1,4 +1,4 @@ -VERSION ?= 2.2.0 +VERSION ?= 2.4.0 GIT_USER_ID ?= storageos GIT_REPO_ID ?= go-api diff --git a/v2/README.md b/v2/README.md index f33b0d8..c709c23 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.4.0-alpha -- Package version: 2.2.0 +- API version: 2.4.0 +- Package version: 2.4.0 - Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit [https://storageos.com](https://storageos.com) @@ -56,6 +56,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**GetNamespace**](docs/DefaultApi.md#getnamespace) | **Get** /namespaces/{id} | Fetch a namespace *DefaultApi* | [**GetNode**](docs/DefaultApi.md#getnode) | **Get** /nodes/{id} | Fetch a node *DefaultApi* | [**GetPolicyGroup**](docs/DefaultApi.md#getpolicygroup) | **Get** /policies/{id} | Fetch a policy group +*DefaultApi* | [**GetSingleNodeDiagnostics**](docs/DefaultApi.md#getsinglenodediagnostics) | **Get** /diagnostics/{id} | Retrieves a single node diagnostics bundle from the target node *DefaultApi* | [**GetUser**](docs/DefaultApi.md#getuser) | **Get** /users/{id} | Fetch a user *DefaultApi* | [**GetVolume**](docs/DefaultApi.md#getvolume) | **Get** /namespaces/{namespaceID}/volumes/{id} | Fetch a volume *DefaultApi* | [**ListNamespaces**](docs/DefaultApi.md#listnamespaces) | **Get** /namespaces | Fetch the list of namespaces @@ -66,6 +67,7 @@ Class | Method | HTTP request | Description *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* | [**SetComputeOnly**](docs/DefaultApi.md#setcomputeonly) | **Put** /nodes/{id}/compute-only | Modify the computeonly behaviour state for a node +*DefaultApi* | [**SetFailureMode**](docs/DefaultApi.md#setfailuremode) | **Put** /namespaces/{namespaceID}/volumes/{id}/failure-mode | Set the failure mode of the 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 @@ -95,6 +97,7 @@ Class | Method | HTTP request | Description - [CreateVolumeData](docs/CreateVolumeData.md) - [DeploymentInfo](docs/DeploymentInfo.md) - [Error](docs/Error.md) + - [FailureModeIntent](docs/FailureModeIntent.md) - [FsType](docs/FsType.md) - [Licence](docs/Licence.md) - [LogFormat](docs/LogFormat.md) @@ -121,6 +124,9 @@ Class | Method | HTTP request | Description - [ReplicaHealth](docs/ReplicaHealth.md) - [ResizeVolumeRequest](docs/ResizeVolumeRequest.md) - [SetComputeOnlyNodeData](docs/SetComputeOnlyNodeData.md) + - [SetFailureModeIntentRequestData](docs/SetFailureModeIntentRequestData.md) + - [SetFailureModeRequest](docs/SetFailureModeRequest.md) + - [SetFailureThresholdRequestData](docs/SetFailureThresholdRequestData.md) - [SetReplicasRequest](docs/SetReplicasRequest.md) - [SyncProgress](docs/SyncProgress.md) - [UpdateAuthenticatedUserData](docs/UpdateAuthenticatedUserData.md) diff --git a/v2/api/openapi.yaml b/v2/api/openapi.yaml index 49ea672..4197bf7 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.4.0-alpha + version: 2.4.0 externalDocs: description: The latest StorageOS user documentation url: https://docs.storageos.com/ @@ -1124,7 +1124,7 @@ paths: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object title: CreateNamespaceData type: object @@ -1416,7 +1416,7 @@ paths: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object version: description: | @@ -1790,7 +1790,7 @@ paths: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object version: description: | @@ -2580,7 +2580,7 @@ paths: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object name: description: | @@ -3010,7 +3010,7 @@ paths: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object description: example: This volume contains the data for my app @@ -3927,6 +3927,138 @@ paths: security: - jwt: [] summary: Set the number of replicas to maintain for the volume. + /namespaces/{namespaceID}/volumes/{id}/failure-mode: + put: + description: | + Set the behaviour of the volume identified by id when responding to observed replica failure. This modifies the protected StorageOS system label "storageos.com/failure-mode". + This request may either specify a precise failure threshold or a more flexible intent-based failure mode operating with respect to the volume's current replication target. + A request will be denied if the current state of the volume does not satisfy the requested failure behaviour. + operationId: setFailureMode + 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: + content: + application/json: + schema: + $ref: '#/components/schemas/SetFailureModeRequest' + description: Failure mode to use + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Volume' + description: The updated volume information. + "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. + "409": + content: + application/json: + example: + error: label \"a\" with value \"b\" conflicts with label \"c\" with + value \"d\" + schema: + $ref: '#/components/schemas/Error' + description: | + The requested configuration change for the referenced entity cannot be made as it would result in a conflict which invalidates the resultant config. + "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 failure mode of the volume. /namespaces/{namespaceID}/volumes/{id}/size: put: description: | @@ -4414,15 +4546,19 @@ paths: summary: Update the licence global configuration settings /diagnostics: get: - description: | - Requests that the target node gathers detailed information about the state of the cluster, using it to then build and return a bundle which can be used for troubleshooting. - The request will only be served when the authenticated user is an administrator. - The node will attempt to gather information about its local state, cluster-wide state and local state of other nodes in the cluster. If the cluster is unhealthy this may cause a slower response. + description: "Requests that the recipient node gathers information about the\ + \ global state of the cluster and detailed information about the local state\ + \ of each node in the cluster, using it to then build and return a bundle\ + \ which can be used for troubleshooting. For clusters in an unhealthy state\ + \ this may result in a slower, incomplete response. \nIf the cluster has many\ + \ nodes, it is recommended to use the single node diagnostic collection endpoint\ + \ to target the desired nodes in turn.\nThe request will only be served when\ + \ the authenticated user is an administrator.\n" operationId: getDiagnostics responses: "200": content: - application/gzip: + application/octet-stream: schema: format: binary type: string @@ -4457,9 +4593,10 @@ paths: Check the health of the node/cluster and if the error persists, contact support. "502": content: - application/json: + application/octet-stream: schema: - $ref: '#/components/schemas/Error' + format: binary + type: string description: | The server is returning an incomplete diagnostic bundle. A bundle may contain partial information if one or more nodes failed to respond, or some other error occured during the collection process. @@ -4475,6 +4612,78 @@ paths: security: - jwt: [] summary: Retrieves a diagnostics bundle from the target node + /diagnostics/{id}: + get: + description: | + Requests that the recipient node gathers information about the global state of the cluster and detailed information about the target node, using it to then build and return a bundle which can be used for troubleshooting. If the target node is in an unhealthy state then the response may be slower and incomplete. + The request will only be served when the authenticated user is an administrator. + operationId: getSingleNodeDiagnostics + parameters: + - description: ID of a node + explode: false + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/NodeID' + style: simple + responses: + "200": + content: + application/octet-stream: + schema: + format: binary + type: string + description: | + A diagnostics bundle was successfully built and returned for just the target node. + "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. + "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. + "502": + content: + application/octet-stream: + schema: + format: binary + type: string + description: | + The server is returning an incomplete diagnostic bundle. + A single-node bundle may contain partial information if the target node failed to respond, or did not gather all available diagnostics during the collection process. + The returned bundle may still contain useful data and should be sent to StorageOS. + "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: Retrieves a single node diagnostics bundle from the target node /openapi: get: description: Serves this openapi spec file @@ -4769,6 +4978,16 @@ components: $ref: '#/components/schemas/Error' description: | A referenced entity is currently in use. + InvalidResult: + content: + application/json: + example: + error: label \"a\" with value \"b\" conflicts with label \"c\" with value + \"d\" + schema: + $ref: '#/components/schemas/Error' + description: | + The requested configuration change for the referenced entity cannot be made as it would result in a conflict which invalidates the resultant config. Locked: content: application/json: @@ -4867,6 +5086,16 @@ components: example: host readOnly: true type: string + FailureModeIntent: + description: "The intent-based failure mode behaviour of a volume. The default\ + \ behaviour for a volume is \"hard\", in the absence of a directly configured\ + \ intent or numerical failure threshold. \n" + enum: + - hard + - soft + - alwayson + example: hard + type: string NodeHealth: description: | The operational health of a node entity @@ -5080,7 +5309,7 @@ components: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object LogLevel: default: info @@ -5375,7 +5604,7 @@ components: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object fsType: $ref: '#/components/schemas/FsType' @@ -5527,7 +5756,7 @@ components: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object createdAt: description: | @@ -5587,7 +5816,7 @@ components: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object createdAt: description: | @@ -5799,6 +6028,41 @@ components: items: $ref: '#/components/schemas/Volume' type: array + SetFailureThresholdRequestData: + properties: + failureThreshold: + description: | + The minimum number of replicas required to be online and receiving writes in order for the volume to remain read-writable. This value replaces any previously set failure threshold or intent-based failure mode. + 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 + type: object + SetFailureModeIntentRequestData: + properties: + mode: + $ref: '#/components/schemas/FailureModeIntent' + 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 + type: object + SetFailureModeRequest: + oneOf: + - $ref: '#/components/schemas/SetFailureThresholdRequestData' + - $ref: '#/components/schemas/SetFailureModeIntentRequestData' AuthUserData: example: username: admin @@ -5946,7 +6210,7 @@ components: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object title: CreateNamespaceData type: object @@ -5966,7 +6230,7 @@ components: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object version: description: | @@ -5994,7 +6258,7 @@ components: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object version: description: | @@ -6164,7 +6428,7 @@ components: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object name: description: | @@ -6207,7 +6471,7 @@ components: env: prod rack: db-1 externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels type: object description: example: This volume contains the data for my app diff --git a/v2/api_default.go b/v2/api_default.go index 0e3dddc..722d286 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.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ @@ -2724,7 +2724,7 @@ func (a *DefaultApiService) GetCluster(ctx _context.Context) (Cluster, *_nethttp /* GetDiagnostics Retrieves a diagnostics bundle from the target node -Requests that the target node gathers detailed information about the state of the cluster, using it to then build and return a bundle which can be used for troubleshooting. The request will only be served when the authenticated user is an administrator. The node will attempt to gather information about its local state, cluster-wide state and local state of other nodes in the cluster. If the cluster is unhealthy this may cause a slower response. +Requests that the recipient node gathers information about the global state of the cluster and detailed information about the local state of each node in the cluster, using it to then build and return a bundle which can be used for troubleshooting. For clusters in an unhealthy state this may result in a slower, incomplete response. If the cluster has many nodes, it is recommended to use the single node diagnostic collection endpoint to target the desired nodes in turn. The request will only be served when the authenticated user is an administrator. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return *os.File */ @@ -2754,7 +2754,7 @@ func (a *DefaultApiService) GetDiagnostics(ctx _context.Context) (*os.File, *_ne } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/gzip", "application/json"} + localVarHTTPHeaderAccepts := []string{"application/octet-stream", "application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -2813,7 +2813,7 @@ func (a *DefaultApiService) GetDiagnostics(ctx _context.Context) (*os.File, *_ne return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 502 { - var v Error + var v *os.File err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -3361,6 +3361,133 @@ func (a *DefaultApiService) GetPolicyGroup(ctx _context.Context, id string) (Pol return localVarReturnValue, localVarHTTPResponse, nil } +/* +GetSingleNodeDiagnostics Retrieves a single node diagnostics bundle from the target node +Requests that the recipient node gathers information about the global state of the cluster and detailed information about the target node, using it to then build and return a bundle which can be used for troubleshooting. If the target node is in an unhealthy state then the response may be slower and incomplete. The request will only be served when the authenticated user is an administrator. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ID of a node +@return *os.File +*/ +func (a *DefaultApiService) GetSingleNodeDiagnostics(ctx _context.Context, id string) (*os.File, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *os.File + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/diagnostics/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.PathEscape(parameterToString(id, "")) , -1) + + 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{"application/octet-stream", "application/json"} + + // 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, + } + 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 == 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 == 502 { + var v *os.File + 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 +} + /* GetUser Fetch a user Fetch the user identified by id. @@ -4643,6 +4770,189 @@ func (a *DefaultApiService) SetComputeOnly(ctx _context.Context, id string, setC return localVarReturnValue, localVarHTTPResponse, nil } +// SetFailureModeOpts Optional parameters for the method 'SetFailureMode' +type SetFailureModeOpts struct { + IgnoreVersion optional.Bool +} + +/* +SetFailureMode Set the failure mode of the volume. +Set the behaviour of the volume identified by id when responding to observed replica failure. This modifies the protected StorageOS system label \"storageos.com/failure-mode\". This request may either specify a precise failure threshold or a more flexible intent-based failure mode operating with respect to the volume's current replication target. A request will be denied if the current state of the volume does not satisfy the requested failure behaviour. + * @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 setFailureModeRequest Failure mode to use + * @param optional nil or *SetFailureModeOpts - 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 Volume +*/ +func (a *DefaultApiService) SetFailureMode(ctx _context.Context, namespaceID string, id string, setFailureModeRequest SetFailureModeRequest, localVarOptionals *SetFailureModeOpts) (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}/failure-mode" + 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"} + + // 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 = &setFailureModeRequest + 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 == 409 { + 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 == 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")) + 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 +} + // SetReplicasOpts Optional parameters for the method 'SetReplicas' type SetReplicasOpts struct { IgnoreVersion optional.Bool diff --git a/v2/client.go b/v2/client.go index e7a1076..227c931 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.4.0-alpha + * API version: 2.4.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.4.0-alpha +// APIClient manages communication with the StorageOS API API v2.4.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 96d20cb..71c91c4 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.4.0-alpha + * API version: 2.4.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.2.0/go", + UserAgent: "OpenAPI-Generator/2.4.0/go", Debug: false, Servers: []ServerConfiguration{ { diff --git a/v2/docs/DefaultApi.md b/v2/docs/DefaultApi.md index 6306ab5..89753c7 100644 --- a/v2/docs/DefaultApi.md +++ b/v2/docs/DefaultApi.md @@ -27,6 +27,7 @@ Method | HTTP request | Description [**GetNamespace**](DefaultApi.md#GetNamespace) | **Get** /namespaces/{id} | Fetch a namespace [**GetNode**](DefaultApi.md#GetNode) | **Get** /nodes/{id} | Fetch a node [**GetPolicyGroup**](DefaultApi.md#GetPolicyGroup) | **Get** /policies/{id} | Fetch a policy group +[**GetSingleNodeDiagnostics**](DefaultApi.md#GetSingleNodeDiagnostics) | **Get** /diagnostics/{id} | Retrieves a single node diagnostics bundle from the target node [**GetUser**](DefaultApi.md#GetUser) | **Get** /users/{id} | Fetch a user [**GetVolume**](DefaultApi.md#GetVolume) | **Get** /namespaces/{namespaceID}/volumes/{id} | Fetch a volume [**ListNamespaces**](DefaultApi.md#ListNamespaces) | **Get** /namespaces | Fetch the list of namespaces @@ -37,6 +38,7 @@ Method | HTTP request | Description [**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. [**SetComputeOnly**](DefaultApi.md#SetComputeOnly) | **Put** /nodes/{id}/compute-only | Modify the computeonly behaviour state for a node +[**SetFailureMode**](DefaultApi.md#SetFailureMode) | **Put** /namespaces/{namespaceID}/volumes/{id}/failure-mode | Set the failure mode of the 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 @@ -786,7 +788,7 @@ This endpoint does not need any parameter. Retrieves a diagnostics bundle from the target node -Requests that the target node gathers detailed information about the state of the cluster, using it to then build and return a bundle which can be used for troubleshooting. The request will only be served when the authenticated user is an administrator. The node will attempt to gather information about its local state, cluster-wide state and local state of other nodes in the cluster. If the cluster is unhealthy this may cause a slower response. +Requests that the recipient node gathers information about the global state of the cluster and detailed information about the local state of each node in the cluster, using it to then build and return a bundle which can be used for troubleshooting. For clusters in an unhealthy state this may result in a slower, incomplete response. If the cluster has many nodes, it is recommended to use the single node diagnostic collection endpoint to target the desired nodes in turn. The request will only be served when the authenticated user is an administrator. ### Required Parameters @@ -803,7 +805,7 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/gzip, application/json +- **Accept**: application/octet-stream, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -942,6 +944,40 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## GetSingleNodeDiagnostics + +> *os.File GetSingleNodeDiagnostics(ctx, id) + +Retrieves a single node diagnostics bundle from the target node + +Requests that the recipient node gathers information about the global state of the cluster and detailed information about the target node, using it to then build and return a bundle which can be used for troubleshooting. If the target node is in an unhealthy state then the response may be slower and incomplete. The request will only be served when the authenticated user is an administrator. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string**| ID of a node | + +### Return type + +[***os.File**](*os.File.md) + +### Authorization + +[jwt](../README.md#jwt) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream, 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) + + ## GetUser > User GetUser(ctx, id) @@ -1292,6 +1328,55 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## SetFailureMode + +> Volume SetFailureMode(ctx, namespaceID, id, setFailureModeRequest, optional) + +Set the failure mode of the volume. + +Set the behaviour of the volume identified by id when responding to observed replica failure. This modifies the protected StorageOS system label \"storageos.com/failure-mode\". This request may either specify a precise failure threshold or a more flexible intent-based failure mode operating with respect to the volume's current replication target. A request will be denied if the current state of the volume does not satisfy the requested failure behaviour. + +### 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 | +**setFailureModeRequest** | [**SetFailureModeRequest**](SetFailureModeRequest.md)| Failure mode to use | + **optional** | ***SetFailureModeOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a SetFailureModeOpts 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 + +[**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) diff --git a/v2/docs/FailureModeIntent.md b/v2/docs/FailureModeIntent.md new file mode 100644 index 0000000..2c7466f --- /dev/null +++ b/v2/docs/FailureModeIntent.md @@ -0,0 +1,10 @@ +# FailureModeIntent + +## 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/SetFailureModeIntentRequestData.md b/v2/docs/SetFailureModeIntentRequestData.md new file mode 100644 index 0000000..11c6399 --- /dev/null +++ b/v2/docs/SetFailureModeIntentRequestData.md @@ -0,0 +1,12 @@ +# SetFailureModeIntentRequestData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Mode** | [**FailureModeIntent**](FailureModeIntent.md) | | [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/SetFailureModeRequest.md b/v2/docs/SetFailureModeRequest.md new file mode 100644 index 0000000..b06fa4b --- /dev/null +++ b/v2/docs/SetFailureModeRequest.md @@ -0,0 +1,13 @@ +# SetFailureModeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FailureThreshold** | **uint64** | The minimum number of replicas required to be online and receiving writes in order for the volume to remain read-writable. This value replaces any previously set failure threshold or intent-based failure mode. | [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] +**Mode** | [**FailureModeIntent**](FailureModeIntent.md) | | [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/SetFailureThresholdRequestData.md b/v2/docs/SetFailureThresholdRequestData.md new file mode 100644 index 0000000..229b573 --- /dev/null +++ b/v2/docs/SetFailureThresholdRequestData.md @@ -0,0 +1,12 @@ +# SetFailureThresholdRequestData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FailureThreshold** | **uint64** | The minimum number of replicas required to be online and receiving writes in order for the volume to remain read-writable. This value replaces any previously set failure threshold or intent-based failure mode. | [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/go.mod b/v2/go.mod index 7db58a9..3e8903e 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -1,9 +1,7 @@ module github.com/storageos/go-api/v2 -go 1.15 - require ( github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 - + ) diff --git a/v2/model__policies__id__specs.go b/v2/model__policies__id__specs.go index c5168cb..3f2dab7 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.4.0-alpha + * API version: 2.4.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 b91b300..72ecb31 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.4.0-alpha + * API version: 2.4.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 df77aa0..398bcab 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.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_attach_nfs_volume_data.go b/v2/model_attach_nfs_volume_data.go index 2e95827..9d42839 100644 --- a/v2/model_attach_nfs_volume_data.go +++ b/v2/model_attach_nfs_volume_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_attach_type.go b/v2/model_attach_type.go index 756d949..3e26f9b 100644 --- a/v2/model_attach_type.go +++ b/v2/model_attach_type.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.4.0-alpha + * API version: 2.4.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 d7c39c9..8a7b1a1 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.4.0-alpha + * API version: 2.4.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 8db66bc..4c3ffad 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.4.0-alpha + * API version: 2.4.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 f481e74..cee017e 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.4.0-alpha + * API version: 2.4.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 6f573f1..42ac288 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.4.0-alpha + * API version: 2.4.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 59ccd75..605f26d 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.4.0-alpha + * API version: 2.4.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 12de0e0..c070563 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.4.0-alpha + * API version: 2.4.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 a77bdb3..81c6e8c 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.4.0-alpha + * API version: 2.4.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 6114eea..77e1d42 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.4.0-alpha + * API version: 2.4.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 a3332cb..dac81f6 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.4.0-alpha + * API version: 2.4.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 7f5e2b4..805bcbe 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.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_failure_mode_intent.go b/v2/model_failure_mode_intent.go new file mode 100644 index 0000000..639f3ee --- /dev/null +++ b/v2/model_failure_mode_intent.go @@ -0,0 +1,20 @@ +/* + * StorageOS API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 2.4.0 + * Contact: info@storageos.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package api +// FailureModeIntent The intent-based failure mode behaviour of a volume. The default behaviour for a volume is \"hard\", in the absence of a directly configured intent or numerical failure threshold. +type FailureModeIntent string + +// List of FailureModeIntent +const ( + FAILUREMODEINTENT_HARD FailureModeIntent = "hard" + FAILUREMODEINTENT_SOFT FailureModeIntent = "soft" + FAILUREMODEINTENT_ALWAYSON FailureModeIntent = "alwayson" +) diff --git a/v2/model_fs_type.go b/v2/model_fs_type.go index dd6bf17..88713d7 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.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_licence.go b/v2/model_licence.go index e0503dd..3eb6cce 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.4.0-alpha + * API version: 2.4.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 7d88505..3cca4d4 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.4.0-alpha + * API version: 2.4.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 7de89fe..a64d182 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.4.0-alpha + * API version: 2.4.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 3ba90bf..dc5d501 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.4.0-alpha + * API version: 2.4.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 7ef56b3..24ed9ca 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.4.0-alpha + * API version: 2.4.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 6adddf2..0a597ec 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.4.0-alpha + * API version: 2.4.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 f1ec52d..27b858b 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.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ @@ -46,3 +46,8 @@ func (t Namespace) GetNamespace() string { func (t Namespace) GetLabels() map[string]string { return t.Labels } + +// IsHealthy always returns true for namespaces. +func (t Namespace) IsHealthy() bool { + return true +} diff --git a/v2/model_nfs_acl.go b/v2/model_nfs_acl.go index b554d26..e3722e3 100644 --- a/v2/model_nfs_acl.go +++ b/v2/model_nfs_acl.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_nfs_acl_identity.go b/v2/model_nfs_acl_identity.go index 080462b..3bbfd0e 100644 --- a/v2/model_nfs_acl_identity.go +++ b/v2/model_nfs_acl_identity.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_nfs_acl_squash_config.go b/v2/model_nfs_acl_squash_config.go index 4382337..aa6accf 100644 --- a/v2/model_nfs_acl_squash_config.go +++ b/v2/model_nfs_acl_squash_config.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_nfs_config.go b/v2/model_nfs_config.go index e74ab10..830fd19 100644 --- a/v2/model_nfs_config.go +++ b/v2/model_nfs_config.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_nfs_export_config.go b/v2/model_nfs_export_config.go index 84c04ec..0636a3d 100644 --- a/v2/model_nfs_export_config.go +++ b/v2/model_nfs_export_config.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_nfs_volume_exports.go b/v2/model_nfs_volume_exports.go index b25af55..bfe6a00 100644 --- a/v2/model_nfs_volume_exports.go +++ b/v2/model_nfs_volume_exports.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_nfs_volume_mount_endpoint.go b/v2/model_nfs_volume_mount_endpoint.go index afa4cfd..0ccb4ec 100644 --- a/v2/model_nfs_volume_mount_endpoint.go +++ b/v2/model_nfs_volume_mount_endpoint.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.4.0-alpha + * API version: 2.4.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 b6073b0..92689a4 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.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ @@ -57,3 +57,11 @@ func (t Node) GetNamespace() string { func (t Node) GetLabels() map[string]string { return t.Labels } + +// IsHealthy returns true if the node is healthy. +func (t Node) IsHealthy() bool { + if t.Health == NODEHEALTH_ONLINE { + return true + } + return false +} diff --git a/v2/model_node_health.go b/v2/model_node_health.go index f58382c..03194fe 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.4.0-alpha + * API version: 2.4.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 6884a5e..b3d53a8 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.4.0-alpha + * API version: 2.4.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 bced21d..264a9b2 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.4.0-alpha + * API version: 2.4.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 9c59b85..51a645f 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.4.0-alpha + * API version: 2.4.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 48f85a2..7152b7e 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.4.0-alpha + * API version: 2.4.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 bac1b9e..34b97ef 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.4.0-alpha + * API version: 2.4.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 index b0af075..f83160d 100644 --- a/v2/model_resize_volume_request.go +++ b/v2/model_resize_volume_request.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_set_compute_only_node_data.go b/v2/model_set_compute_only_node_data.go index 256bc62..0f2c185 100644 --- a/v2/model_set_compute_only_node_data.go +++ b/v2/model_set_compute_only_node_data.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_set_failure_mode_intent_request_data.go b/v2/model_set_failure_mode_intent_request_data.go new file mode 100644 index 0000000..31b1ced --- /dev/null +++ b/v2/model_set_failure_mode_intent_request_data.go @@ -0,0 +1,17 @@ +/* + * StorageOS API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 2.4.0 + * Contact: info@storageos.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package api +// SetFailureModeIntentRequestData struct for SetFailureModeIntentRequestData +type SetFailureModeIntentRequestData struct { + Mode FailureModeIntent `json:"mode,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_failure_mode_request.go b/v2/model_set_failure_mode_request.go new file mode 100644 index 0000000..d97fde3 --- /dev/null +++ b/v2/model_set_failure_mode_request.go @@ -0,0 +1,19 @@ +/* + * StorageOS API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 2.4.0 + * Contact: info@storageos.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package api +// SetFailureModeRequest struct for SetFailureModeRequest +type SetFailureModeRequest struct { + // The minimum number of replicas required to be online and receiving writes in order for the volume to remain read-writable. This value replaces any previously set failure threshold or intent-based failure mode. + FailureThreshold uint64 `json:"failureThreshold,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"` + Mode FailureModeIntent `json:"mode,omitempty"` +} diff --git a/v2/model_set_failure_threshold_request_data.go b/v2/model_set_failure_threshold_request_data.go new file mode 100644 index 0000000..506573d --- /dev/null +++ b/v2/model_set_failure_threshold_request_data.go @@ -0,0 +1,18 @@ +/* + * StorageOS API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 2.4.0 + * Contact: info@storageos.com + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package api +// SetFailureThresholdRequestData struct for SetFailureThresholdRequestData +type SetFailureThresholdRequestData struct { + // The minimum number of replicas required to be online and receiving writes in order for the volume to remain read-writable. This value replaces any previously set failure threshold or intent-based failure mode. + FailureThreshold uint64 `json:"failureThreshold,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 index 72bd2b5..31fdb50 100644 --- a/v2/model_set_replicas_request.go +++ b/v2/model_set_replicas_request.go @@ -3,7 +3,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * API version: 2.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_sync_progress.go b/v2/model_sync_progress.go index 113dfec..d5b0893 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.4.0-alpha + * API version: 2.4.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 12dde96..c9e1e61 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.4.0-alpha + * API version: 2.4.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 e315bbc..cff9d0c 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.4.0-alpha + * API version: 2.4.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 e790986..e087144 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.4.0-alpha + * API version: 2.4.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 89ffcd5..186cdc9 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.4.0-alpha + * API version: 2.4.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 77467cb..9baabd9 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.4.0-alpha + * API version: 2.4.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 891ccde..b6db463 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.4.0-alpha + * API version: 2.4.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 0ee8b15..5d0a212 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.4.0-alpha + * API version: 2.4.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 62dde01..6354fc6 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.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/model_user.go b/v2/model_user.go index d55f20f..cf678d1 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.4.0-alpha + * API version: 2.4.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 01630f7..2c05662 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.4.0-alpha + * API version: 2.4.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 4112238..565e8a1 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.4.0-alpha + * API version: 2.4.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 853c1b2..5f90ee2 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.4.0-alpha + * API version: 2.4.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 4316efc..03431f2 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.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ @@ -56,3 +56,11 @@ func (t Volume) GetNamespace() string { func (t Volume) GetLabels() map[string]string { return t.Labels } + +// IsHealthy returns true if the volume is healthy. +func (t Volume) IsHealthy() bool { + if t.Master.Health == MASTERHEALTH_ONLINE { + return true + } + return false +} diff --git a/v2/openapi.yaml b/v2/openapi.yaml index 5a60d23..931c159 100644 --- a/v2/openapi.yaml +++ b/v2/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.2" info: title: "StorageOS API" - version: "2.4.0-alpha" + version: "2.4.0" contact: name: StorageOS url: https://storageos.com @@ -141,6 +141,18 @@ components: volume is consumed by the node it is attached to. example: "host" + FailureModeIntent: + type: string + enum: + - "hard" + - "soft" + - "alwayson" + description: > + The intent-based failure mode behaviour of a volume. The default + behaviour for a volume is "hard", in the absence of a directly + configured intent or numerical failure threshold. + example: "hard" + NodeHealth: type: string readOnly: true @@ -352,7 +364,7 @@ components: description: > A set of arbitrary key value labels to apply to the entity. externalDocs: - url: https://docs.storageos.com/v2/openapi-help/labels + url: https://docs.storageos.com/docs/reference/labels additionalProperties: type: string example: @@ -875,6 +887,43 @@ components: items: $ref: "#/components/schemas/Volume" + # ------------------------------------------------------------------------------ + # request schemas + # + # encapsulated request schemas for use cases where inline definition is not + # supported by the openapi codegenerator. this is a bit of a workaround for + # bugs when using certain spec description features. + # ------------------------------------------------------------------------------ + SetFailureThresholdRequestData: + type: object + properties: + failureThreshold: + type: uint64 + default: 0 + minimum: 0 + maximum: 5 + description: > + The minimum number of replicas required to be online and + receiving writes in order for the volume to remain + read-writable. This value replaces any previously set + failure threshold or intent-based failure mode. + example: 2 + version: + $ref: "#/components/schemas/Version" + + SetFailureModeIntentRequestData: + type: object + properties: + mode: + $ref: "#/components/schemas/FailureModeIntent" + version: + $ref: "#/components/schemas/Version" + + SetFailureModeRequest: + oneOf: + - $ref: "#/components/schemas/SetFailureThresholdRequestData" + - $ref: "#/components/schemas/SetFailureModeIntentRequestData" + parameters: ObjectVersion: name: version @@ -1077,6 +1126,18 @@ components: example: error: in use + InvalidResult: + description: > + The requested configuration change for the referenced entity + cannot be made as it would result in a conflict which + invalidates the resultant config. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + example: + error: label \"a\" with value \"b\" conflicts with label \"c\" with value \"d\" + Locked: description: > A lock is held for the target entity, preventing the operation @@ -3043,6 +3104,80 @@ paths: "503": $ref: "#/components/responses/StoreError" + + /namespaces/{namespaceID}/volumes/{id}/failure-mode: + 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 failure mode of the volume. + operationId: setFailureMode + description: > + Set the behaviour of the volume identified by id when responding + to observed replica failure. This modifies the protected + StorageOS system label "storageos.com/failure-mode". + + This request may either specify a precise failure threshold or a + more flexible intent-based failure mode operating with respect + to the volume's current replication target. + + A request will be denied if the current state of the volume does + not satisfy the requested failure behaviour. + security: + - jwt: [] + parameters: + - $ref: "#/components/parameters/IgnoreVersion" + requestBody: + description: Failure mode to use + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/SetFailureModeRequest" + responses: + "200": + description: The updated volume information. + 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" + + "409": + $ref: "#/components/responses/InvalidResult" + + "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: @@ -3312,17 +3447,19 @@ paths: summary: Retrieves a diagnostics bundle from the target node operationId: getDiagnostics description: > - Requests that the target node gathers detailed information - about the state of the cluster, using it to then build and - return a bundle which can be used for troubleshooting. + Requests that the recipient node gathers information + about the global state of the cluster and detailed information + about the local state of each node in the cluster, using it to + then build and return a bundle which can be used for + troubleshooting. For clusters in an unhealthy state this may + result in a slower, incomplete response. + + If the cluster has many nodes, it is recommended to use the + single node diagnostic collection endpoint to target the desired + nodes in turn. The request will only be served when the authenticated user is an administrator. - - The node will attempt to gather information about its local - state, cluster-wide state and local state of other nodes - in the cluster. If the cluster is unhealthy this may cause - a slower response. security: - jwt: [] responses: @@ -3331,7 +3468,7 @@ paths: A diagnostics bundle was successfully built and returned. content: - application/gzip: + application/octet-stream: schema: type: string format: binary @@ -3356,9 +3493,71 @@ paths: The returned bundle is still valid and should be sent to StorageOS. content: - application/json: + application/octet-stream: + schema: + type: string + format: binary + + "503": + $ref: "#/components/responses/StoreError" + /diagnostics/{id}: + parameters: + - name: id + in: path + description: ID of a node + required: true + schema: + $ref: "#/components/schemas/NodeID" + get: + summary: Retrieves a single node diagnostics bundle from the target node + operationId: getSingleNodeDiagnostics + description: > + Requests that the recipient node gathers information about the + global state of the cluster and detailed information about the + target node, using it to then build and return a bundle + which can be used for troubleshooting. If the target node is + in an unhealthy state then the response may be slower and + incomplete. + + The request will only be served when the authenticated user + is an administrator. + security: + - jwt: [] + responses: + "200": + description: > + A diagnostics bundle was successfully built and + returned for just the target node. + content: + application/octet-stream: + schema: + type: string + format: binary + + "401": + $ref: "#/components/responses/Unauthorised" + + "403": + $ref: "#/components/responses/Forbidden" + + "500": + $ref: "#/components/responses/ServerError" + + "502": + description: > + The server is returning an incomplete diagnostic bundle. + + A single-node bundle may contain partial information if + the target node failed to respond, or did not gather all + available diagnostics during the collection process. + + The returned bundle may still contain useful data and + should be sent to StorageOS. + content: + application/octet-stream: schema: - $ref: "#/components/schemas/Error" + type: string + format: binary "503": $ref: "#/components/responses/StoreError" @@ -3374,4 +3573,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 37f265b..0181995 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.4.0-alpha + * API version: 2.4.0 * Contact: info@storageos.com * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/v2/templates/namespace/model.mustache b/v2/templates/namespace/model.mustache index df7c1bd..a3e42e7 100644 --- a/v2/templates/namespace/model.mustache +++ b/v2/templates/namespace/model.mustache @@ -58,6 +58,11 @@ func (t {{classname}}) GetNamespace() string { func (t {{classname}}) GetLabels() map[string]string { return t.Labels } + +// IsHealthy always returns true for namespaces. +func (t {{classname}}) IsHealthy() bool { + return true +} {{/isEnum}} {{/model}} {{/models}} diff --git a/v2/templates/node/model.mustache b/v2/templates/node/model.mustache index 1a61a9d..1eb5de2 100644 --- a/v2/templates/node/model.mustache +++ b/v2/templates/node/model.mustache @@ -58,6 +58,14 @@ func (t {{classname}}) GetNamespace() string { func (t {{classname}}) GetLabels() map[string]string { return t.Labels } + +// IsHealthy returns true if the node is healthy. +func (t {{classname}}) IsHealthy() bool { + if t.Health == NODEHEALTH_ONLINE { + return true + } + return false +} {{/isEnum}} {{/model}} {{/models}} diff --git a/v2/templates/volume/model.mustache b/v2/templates/volume/model.mustache index f8c373b..5b6df27 100644 --- a/v2/templates/volume/model.mustache +++ b/v2/templates/volume/model.mustache @@ -58,6 +58,14 @@ func (t {{classname}}) GetNamespace() string { func (t {{classname}}) GetLabels() map[string]string { return t.Labels } + +// IsHealthy returns true if the volume is healthy. +func (t {{classname}}) IsHealthy() bool { + if t.Master.Health == MASTERHEALTH_ONLINE { + return true + } + return false +} {{/isEnum}} {{/model}} {{/models}}