Skip to content

Commit

Permalink
Regenerate client sdk as per the latest spec
Browse files Browse the repository at this point in the history
  • Loading branch information
gohilankit committed May 11, 2023
1 parent f29001a commit 903131a
Show file tree
Hide file tree
Showing 13 changed files with 145 additions and 49 deletions.
38 changes: 23 additions & 15 deletions client-sdk/go/client/api_datastore_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -34,10 +34,11 @@ type DatastoreOperationsApiService service

/*
DatastoreOperationsApiService Get volumes(CNS & non-CNS) and virtual machines on a datastore.
This API returns all the volumes(container volumes and non-CNS) as well as the virtual machines on a particular datastore. It is particularly useful to get this information while decommissioning a datastore. The fcd ids outputted from this API can then be used as an input parameter in MigrateVolumes API.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param datacenter Datacenter name where the datastore is located. This input is case-sensitive.
* @param datastore Name of the datastore on which container volumes need to be queried. This input is case-sensitive.
This API returns all the volumes(container volumes and non-CNS) as well as the virtual machines on a particular datastore. It is particularly useful to get this information while decommissioning a datastore. The fcd ids outputted from this API can then be used as an input parameter in MigrateVolumes API.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param datacenter Datacenter name where the datastore is located. This input is case-sensitive.
- @param datastore Name of the datastore on which container volumes need to be queried. This input is case-sensitive.
@return DatastoreResourcesResult
*/
func (a *DatastoreOperationsApiService) GetDatastoreResources(ctx context.Context, datacenter string, datastore string) (DatastoreResourcesResult, *http.Response, error) {
Expand Down Expand Up @@ -132,21 +133,23 @@ func (a *DatastoreOperationsApiService) GetDatastoreResources(ctx context.Contex

/*
DatastoreOperationsApiService Migrate volumes from source datastore to target datastore.
Volumes may need to be moved between the different datastores due to various reasons like retiring older datastores, replacing or disruptive upgrades to existing datastores, saving volumes from failing datastores and so on. This API supports storage vMotion for PVs between different datastores (of same or different types). It returns a job id, the status of which can be retrieved using `jobStatus` API.
Volumes may need to be moved between the different datastores due to various reasons like retiring older datastores, replacing or disruptive upgrades to existing datastores, saving volumes from failing datastores and so on. This API supports storage vMotion for PVs between different datastores (of same or different types). It returns a job id, the status of which can be retrieved using `jobStatus` API.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param datacenter Datacenter name where source and target datastores are located.
* @param targetDatastore Name of the target datastore.
* @param optional nil or *DatastoreOperationsApiMigrateVolumesOpts - Optional Parameters:
* @param "SourceDatastore" (optional.String) - (Optional) Name of the source datastore. Specify only if all volumes from source datastore need to be migrated to destination datastore, and don't specify fcd Ids in that case. If specific list of fcd Ids is provided, then source datastore field will be ignored.
* @param "FcdIdsToMigrate" (optional.Interface of []string) - (Optional) Array of FCD ids to migrate. If not specified, all volumes from source datastore will be migrated to destination datastore.
* @param "SkipPolicyCheck" (optional.Bool) - (Optional) A flag to skip validation of volume policy with target datastore. Set to \"true\" to skip the policy check and force migrate a volume.
* @param "SkipVolumeAccessibilityCheck" (optional.Bool) - (Optional) If this flag is set to 'true', it will force migrate the volumes without checking if they will be accessible on target datastore from all cluster nodes(or topology-matching nodes in a topology-aware environment). This may affect the application availability if it gets scheduled on a cluster node that can't access the target datastore. So it's NOT recommended to set this flag to true.
@return MigrateVolumesResult
*/

type DatastoreOperationsApiMigrateVolumesOpts struct {
SourceDatastore optional.String
FcdIdsToMigrate optional.Interface
SkipPolicyCheck optional.Bool
SourceDatastore optional.String
FcdIdsToMigrate optional.Interface
SkipPolicyCheck optional.Bool
SkipVolumeAccessibilityCheck optional.Bool
}

func (a *DatastoreOperationsApiService) MigrateVolumes(ctx context.Context, datacenter string, targetDatastore string, localVarOptionals *DatastoreOperationsApiMigrateVolumesOpts) (MigrateVolumesResult, *http.Response, error) {
Expand Down Expand Up @@ -176,6 +179,9 @@ func (a *DatastoreOperationsApiService) MigrateVolumes(ctx context.Context, data
if localVarOptionals != nil && localVarOptionals.SkipPolicyCheck.IsSet() {
localVarQueryParams.Add("skipPolicyCheck", parameterToString(localVarOptionals.SkipPolicyCheck.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.SkipVolumeAccessibilityCheck.IsSet() {
localVarQueryParams.Add("skipVolumeAccessibilityCheck", parameterToString(localVarOptionals.SkipVolumeAccessibilityCheck.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}

Expand Down Expand Up @@ -251,9 +257,10 @@ func (a *DatastoreOperationsApiService) MigrateVolumes(ctx context.Context, data
/*
DatastoreOperationsApiService Resume Create Volume operation on datastore.
This API will unblock creation of new File and Block volumes on the specified datastore. To block volume provisioning, invoke SuspendVolumeProvisioning API.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param datacenter Datacenter name where the datastore is located. This input is case-sensitive.
* @param datastore Name of the datastore where creation of new volumes has to be resumed. This input is case-sensitive.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param datacenter Datacenter name where the datastore is located. This input is case-sensitive.
- @param datastore Name of the datastore where creation of new volumes has to be resumed. This input is case-sensitive.
@return ResumeVolumeProvisioningResult
*/
func (a *DatastoreOperationsApiService) ResumeVolumeProvisioning(ctx context.Context, datacenter string, datastore string) (ResumeVolumeProvisioningResult, *http.Response, error) {
Expand Down Expand Up @@ -349,9 +356,10 @@ func (a *DatastoreOperationsApiService) ResumeVolumeProvisioning(ctx context.Con
/*
DatastoreOperationsApiService Suspend Create Volume operation on datastore.
This API will block creation of new File and Block volumes on the specified datastore. To unblock volume provisioning, invoke ResumeVolumeProvisioning API. Other volume operations like attach, detach, delete etc. will not get affected for existing volumes.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param datacenter Datacenter name where the datastore is located. This input is case-sensitive.
* @param datastore Name of the datastore where creation of new volumes has to be blocked. This input is case-sensitive.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param datacenter Datacenter name where the datastore is located. This input is case-sensitive.
- @param datastore Name of the datastore where creation of new volumes has to be blocked. This input is case-sensitive.
@return SuspendVolumeProvisioningResult
*/
func (a *DatastoreOperationsApiService) SuspendVolumeProvisioning(ctx context.Context, datacenter string, datastore string) (SuspendVolumeProvisioningResult, *http.Response, error) {
Expand Down
26 changes: 9 additions & 17 deletions client-sdk/go/client/api_job_details.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -32,9 +32,10 @@ type JobDetailsApiService service

/*
JobDetailsApiService Get status of an asynchronous job.
There are a few functionalities offered through this tool that are long-running and may be running in background. This API helps to fetch the status of a job that's submitted, in progress or completed. A job can be in one of the following status: Queued - Job has been created but hasn't started processing. Running - Job is currently executing. Success - Job has completed successfully with all tasks succeeding. Error - Job ran but some or all of its tasks failed.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param jobId Job Id for which the details need to be fetched.
There are a few functionalities offered through this tool that are long-running and may be running in background. This API helps to fetch the status of a job that's submitted, in progress or completed. A job can be in one of the following status: Queued - Job has been created but hasn't started processing. Running - Job is currently executing. Success - Job has completed successfully with all tasks succeeding. Error - Job ran but some or all of its tasks failed.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param jobId Job Id for which the details need to be fetched.
@return JobResult
*/
func (a *JobDetailsApiService) GetJobStatus(ctx context.Context, jobId string) (JobResult, *http.Response, error) {
Expand Down Expand Up @@ -100,7 +101,7 @@ func (a *JobDetailsApiService) GetJobStatus(ctx context.Context, jobId string) (
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 202 {
if localVarHttpResponse.StatusCode == 200 {
var v JobResult
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
Expand Down Expand Up @@ -129,8 +130,9 @@ func (a *JobDetailsApiService) GetJobStatus(ctx context.Context, jobId string) (
/*
JobDetailsApiService Wait until a job is successful or failed.
This is a blocking API that waits for job to get successful or fail. Unlike `getJobStatus` API which fetches the current status of the job, this will wait for the job to finish before returning the job result response.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param jobId Job Id for which to wait to complete.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param jobId Job Id for which to wait to complete.
@return JobResult
*/
func (a *JobDetailsApiService) WaitForJob(ctx context.Context, jobId string) (JobResult, *http.Response, error) {
Expand Down Expand Up @@ -206,16 +208,6 @@ func (a *JobDetailsApiService) WaitForJob(ctx context.Context, jobId string) (Jo
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 0 {
var v ModelError
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
}
return localVarReturnValue, localVarHttpResponse, newErr
}

Expand Down
8 changes: 4 additions & 4 deletions client-sdk/go/client/api_orphan_volume.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 VMware, Inc.
Copyright 2022 VMware, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,9 +37,9 @@ type OrphanVolumeApiService service
OrphanVolumeApiService Delete orphan volumes.
Delete the orphan volumes for the given criteria.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param deleteAttachedOrphans Set to `true` to delete attached orphans. When set to `true`, the API will detach the orphan volume from the VM before deleting it.
* @param deleteAttachedOrphans Set to `true` to delete attached orphans. When set to `true`, the API will detach the orphan volume from the VM before deleting it.
* @param optional nil or *OrphanVolumeApiOrphanVolumeDeleteOpts - Optional Parameters:
* @param "Datacenter" (optional.String) - (Optional) Datacenter name to narrow down the deletion of orphan.
* @param "Datacenter" (optional.String) - (Optional) Datacenter name to narrow down the deletion of orphan volumes to.
* @param "Datastores" (optional.String) - (Optional) List of comma-separated datastores to narrow down the deletion of orphan volumes to. Specify only if the `datacenter` param is specified.
@return OrphanVolumeDeleteResult
*/
Expand Down Expand Up @@ -146,7 +146,7 @@ func (a *OrphanVolumeApiService) OrphanVolumeDelete(ctx context.Context, deleteA

/*
OrphanVolumeApiService List all the orphan volumes.
Orphan volumes are created when the CNS solution creates more than one volume for a Persistent Volume in the Kubernetes cluster. This occurs when the vCenter components are slow, storage is slow, vCenter service restarts, connectivity issues between vCenter and ESXi hosts etc. Orphan volumes are the volumes that are present in the vSphere datastore but there is no corresponding PersistentVolume in the Kubernetes cluster. This API detects the orphan volumes for the given input parameters and returns a list of orphan volumes. The orphan volumes could be attached or detached. 1. `Attached orphan volumes` - These would have the details set and will have info on the VM it is attached to. 2. `Detached orphan volumes` - These are the orphan volumes that do not have the details set. Orphan volumes are safe to detach since there is no `PersistentVolume` in the Kubernetes cluster referring it.
Returns a list of orphan volumes for the given input parameters, which could be attached or detached. Since the detection of orphan volumes is an expensive operation, the operation is performed asynchronously at regular intervals. This API returns the list of orphan volumes found in the last run of the operation. The response body contains the following fields: 1. `TotalOrphans` - The total number of orphan volumes found. 2. `OrphanVolumes` - The list of orphan volumes found. 3. `RetryAfterMinutes` - The time in minutes after which the next retry should be attempted to get the updated orphan volume list. 4. `TotalOrphansAttached` - The total number of orphan volumes found that are attached to a VM. 5. `TotalOrphansDetached` - The total number of orphan volumes found that are detached. Orphan volumes are safe to delete since there is no PersistentVolume in the Kubernetes cluster referring to them.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param includeDetails Set to \"true\" to get a detailed dump of the orphan volume.
* @param optional nil or *OrphanVolumeApiOrphanVolumeListOpts - Optional Parameters:
Expand Down
8 changes: 5 additions & 3 deletions client-sdk/go/client/model_fault.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -16,6 +16,8 @@ limitations under the License.
package swagger

type Fault struct {
Message string `json:"message"`
FaultType string `json:"faultType"`
// Error message for the fault.
Message string `json:"message,omitempty"`
// Type of fault.
FaultType string `json:"faultType,omitempty"`
}
24 changes: 24 additions & 0 deletions client-sdk/go/client/model_orphan_volume_delete_failure.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Copyright 2023 VMware, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package swagger

// OrphanVolumeDeleteFailure is the result of a failed orphan volume deletion. It contains the ID of the orphan volume and the reason for deletion failure.
type OrphanVolumeDeleteFailure struct {
// ID of the orphan volume whose deletion failed.
VolumeId string `json:"volumeId"`
// Reason for deletion failure.
Reason string `json:"reason"`
}
7 changes: 6 additions & 1 deletion client-sdk/go/client/model_orphan_volume_delete_result.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 VMware, Inc.
Copyright 2022 VMware, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@ limitations under the License.

package swagger

// OrphanVolumeDeleteResult is the result of deleting orphan volumes.
type OrphanVolumeDeleteResult struct {
// Number of orphan volumes detected.
TotalOrphansDetected int64 `json:"totalOrphansDetected"`
Expand All @@ -25,4 +26,8 @@ type OrphanVolumeDeleteResult struct {
TotalDetachedOrphansDeleted int64 `json:"totalDetachedOrphansDeleted"`
// Number of deleted orphan volumes that were attached to a VM.
TotalAttachedOrphansDeleted int64 `json:"totalAttachedOrphansDeleted"`
// Array of successfully deleted orphan volume IDs.
SuccessfulOrphanDeletions []string `json:"successfulOrphanDeletions"`
// Array of failed orphan volume deletions with the reason for failure for each orphan volume.
FailedOrphanDeletions []OrphanVolumeDeleteFailure `json:"failedOrphanDeletions,omitempty"`
}
10 changes: 7 additions & 3 deletions client-sdk/go/client/model_orphan_volume_result.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 VMware, Inc.
Copyright 2022 VMware, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -18,9 +18,13 @@ package swagger

type OrphanVolumeResult struct {
// The total orphan volumes returned.
TotalOrphans int64 `json:"totalOrphans,omitempty"`
TotalOrphans int64 `json:"totalOrphans"`
// This field is set only if includeDetails is set to true.
TotalOrphansAttached int64 `json:"totalOrphansAttached,omitempty"`
// This field is set only if includeDetails is set to true.
TotalOrphansDetached int64 `json:"totalOrphansDetached,omitempty"`
// Array of orphan volumes
OrphanVolumes []OrphanVolume `json:"orphanVolumes,omitempty"`
OrphanVolumes []OrphanVolume `json:"orphanVolumes"`
// The time in minutes after which the next retry should be attempted to get the updated orphan volume list.
RetryAfterMinutes int64 `json:"retryAfterMinutes"`
}
Loading

0 comments on commit 903131a

Please sign in to comment.