From 4ae3d16b8acfbc809962482805ca2b095a36d7a0 Mon Sep 17 00:00:00 2001 From: Dimitar Proynov Date: Tue, 17 Oct 2023 17:25:19 +0300 Subject: [PATCH 1/3] Implement support for VCF 452 APIs The update is required as new APIs for rotation of certificate from external CA have been included in the 452 release, that the VCF provider needs to make use of. Reverted manually changes to ResourcePoolSpec and SDDCNSXTSpec, changed in previous commits. Testing done: go mod tidy go build Signed-off-by: Dimitar Proynov --- client/certificates/certificates_client.go | 129 ++- .../delete_ca_configuration_responses.go | 2 +- .../certificates/download_csr_parameters.go | 2 +- .../generate_certificates_parameters.go | 2 +- .../certificates/generates_csrs_parameters.go | 2 +- .../get_certificates_parameters.go | 2 +- client/certificates/get_csrs_parameters.go | 2 +- ...rtificates_validation_result_parameters.go | 176 ++++ ...ertificates_validation_result_responses.go | 239 ++++++ .../replace_certificates_parameters.go | 2 +- ...eplace_resource_certificates_parameters.go | 178 ++++ ...replace_resource_certificates_responses.go | 239 ++++++ .../upload_certificates_parameters.go | 2 +- ...lidate_resource_certificates_parameters.go | 178 ++++ ...alidate_resource_certificates_responses.go | 308 +++++++ .../view_certificate_parameters.go | 2 +- .../get_domain_licensing_info_parameters.go | 154 ++++ .../get_domain_licensing_info_responses.go | 170 ++++ .../get_system_licensing_info_parameters.go | 131 +++ .../get_system_licensing_info_responses.go | 170 ++++ client/license_keys/license_keys_client.go | 162 ++++ ...update_domain_licensing_info_parameters.go | 178 ++++ .../update_domain_licensing_info_responses.go | 353 ++++++++ ...update_system_licensing_info_parameters.go | 156 ++++ .../update_system_licensing_info_responses.go | 353 ++++++++ client/system/patch_system_parameters.go | 156 ++++ client/system/patch_system_responses.go | 227 ++++++ client/system/system_client.go | 42 + .../delete_trusted_certificate_parameters.go | 154 ++++ .../delete_trusted_certificate_responses.go | 272 +++++++ .../get_trusted_certificates_parameters.go | 131 +++ .../get_trusted_certificates_responses.go | 170 ++++ .../trusted_certificates_client.go | 89 +- client/vcf_client.go | 28 +- client/vra/vra_client.go | 4 +- .../vsan_health_check_client.go | 4 +- models/certificate.go | 25 +- models/certificate_authority.go | 9 + models/certificate_authority_creation_spec.go | 2 +- models/certificate_validation.go | 137 ++++ models/certificate_validation_task.go | 166 ++++ models/csr.go | 19 + models/csr_generation_spec.go | 6 + models/domain.go | 46 ++ models/domain_future_release.go | 9 + models/edge_cluster_creation_spec.go | 3 + models/edge_cluster_expansion_spec.go | 3 + models/license_key.go | 2 +- models/licensing_info.go | 2 +- models/licensing_info_reference.go | 67 ++ models/licensing_info_spec.go | 75 ++ ...nd_list_of_vx_rail_custom_array_context.go | 67 ++ .../microsoft_certificate_authority_spec.go | 4 + models/nsx_t_edge_node_spec.go | 6 - models/open_ssl_certificate_authority_spec.go | 6 + models/page_of_trusted_certificate.go | 165 ++++ models/release.go | 9 + models/resource.go | 4 + models/resource_certificate_spec.go | 70 ++ models/system_update_spec.go | 53 ++ models/trusted_certificate.go | 93 +++ models/trusted_certificate_spec.go | 3 +- models/vx_rail_array_association_context.go | 110 +++ models/vx_rail_custom_array_context.go | 165 ++++ models/vx_rail_details.go | 50 ++ scripts/fix_abbreviations.sh | 4 + swagger.json | 767 +++++++++++++++++- 67 files changed, 6630 insertions(+), 86 deletions(-) create mode 100644 client/certificates/get_resource_certificates_validation_result_parameters.go create mode 100644 client/certificates/get_resource_certificates_validation_result_responses.go create mode 100644 client/certificates/replace_resource_certificates_parameters.go create mode 100644 client/certificates/replace_resource_certificates_responses.go create mode 100644 client/certificates/validate_resource_certificates_parameters.go create mode 100644 client/certificates/validate_resource_certificates_responses.go create mode 100644 client/license_keys/get_domain_licensing_info_parameters.go create mode 100644 client/license_keys/get_domain_licensing_info_responses.go create mode 100644 client/license_keys/get_system_licensing_info_parameters.go create mode 100644 client/license_keys/get_system_licensing_info_responses.go create mode 100644 client/license_keys/update_domain_licensing_info_parameters.go create mode 100644 client/license_keys/update_domain_licensing_info_responses.go create mode 100644 client/license_keys/update_system_licensing_info_parameters.go create mode 100644 client/license_keys/update_system_licensing_info_responses.go create mode 100644 client/system/patch_system_parameters.go create mode 100644 client/system/patch_system_responses.go create mode 100644 client/trusted_certificates/delete_trusted_certificate_parameters.go create mode 100644 client/trusted_certificates/delete_trusted_certificate_responses.go create mode 100644 client/trusted_certificates/get_trusted_certificates_parameters.go create mode 100644 client/trusted_certificates/get_trusted_certificates_responses.go create mode 100644 models/certificate_validation.go create mode 100644 models/certificate_validation_task.go create mode 100644 models/licensing_info_reference.go create mode 100644 models/licensing_info_spec.go create mode 100644 models/map_ofstring_and_list_of_vx_rail_custom_array_context.go create mode 100644 models/page_of_trusted_certificate.go create mode 100644 models/resource_certificate_spec.go create mode 100644 models/system_update_spec.go create mode 100644 models/trusted_certificate.go create mode 100644 models/vx_rail_array_association_context.go create mode 100644 models/vx_rail_custom_array_context.go diff --git a/client/certificates/certificates_client.go b/client/certificates/certificates_client.go index 0d71ca1..ebc89e8 100644 --- a/client/certificates/certificates_client.go +++ b/client/certificates/certificates_client.go @@ -53,10 +53,16 @@ type ClientService interface { GetCertificates(params *GetCertificatesParams, opts ...ClientOption) (*GetCertificatesOK, error) + GetResourceCertificatesValidationResult(params *GetResourceCertificatesValidationResultParams, opts ...ClientOption) (*GetResourceCertificatesValidationResultOK, error) + ReplaceCertificates(params *ReplaceCertificatesParams, opts ...ClientOption) (*ReplaceCertificatesOK, *ReplaceCertificatesAccepted, error) + ReplaceResourceCertificates(params *ReplaceResourceCertificatesParams, opts ...ClientOption) (*ReplaceResourceCertificatesOK, error) + UploadCertificates(params *UploadCertificatesParams, opts ...ClientOption) (*UploadCertificatesOK, error) + ValidateResourceCertificates(params *ValidateResourceCertificatesParams, opts ...ClientOption) (*ValidateResourceCertificatesOK, *ValidateResourceCertificatesCreated, error) + ViewCertificate(params *ViewCertificateParams, opts ...ClientOption) (*ViewCertificateOK, error) SetTransport(transport runtime.ClientTransport) @@ -270,7 +276,7 @@ func (a *Client) GenerateCertificates(params *GenerateCertificatesParams, opts . Generate CSR(s) for the selected resource(s) in the domain. *Warning:* -_Avoid using wildcard certificates. Instead, use subdomain-specific certificates that are rotated often. A compromised wildcard certificate can lead to security repercussions._ +_Avoid using wildcard certificates. Instead, use subdomain-specific certificates that are rotated often. A compromised wildcard certificate can lead to security repercussions_ */ func (a *Client) GeneratesCSRs(params *GeneratesCSRsParams, opts ...ClientOption) (*GeneratesCSRsOK, *GeneratesCSRsAccepted, error) { // TODO: Validate the params before sending @@ -468,6 +474,46 @@ func (a *Client) GetCertificates(params *GetCertificatesParams, opts ...ClientOp panic(msg) } +/* +GetResourceCertificatesValidationResult gets the resource certificate validation result + +Get the resource certificate validation result +*/ +func (a *Client) GetResourceCertificatesValidationResult(params *GetResourceCertificatesValidationResultParams, opts ...ClientOption) (*GetResourceCertificatesValidationResultOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetResourceCertificatesValidationResultParams() + } + op := &runtime.ClientOperation{ + ID: "getResourceCertificatesValidationResult", + Method: "GET", + PathPattern: "/v1/domains/{id}/resource-certificates/validations/{validationId}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetResourceCertificatesValidationResultReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetResourceCertificatesValidationResultOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getResourceCertificatesValidationResult: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* ReplaceCertificates replaces certificate s for the selected resource s in a domain @@ -509,6 +555,46 @@ func (a *Client) ReplaceCertificates(params *ReplaceCertificatesParams, opts ... panic(msg) } +/* +ReplaceResourceCertificates replaces resource certificates + +Replace resource certificates +*/ +func (a *Client) ReplaceResourceCertificates(params *ReplaceResourceCertificatesParams, opts ...ClientOption) (*ReplaceResourceCertificatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReplaceResourceCertificatesParams() + } + op := &runtime.ClientOperation{ + ID: "replaceResourceCertificates", + Method: "PUT", + PathPattern: "/v1/domains/{id}/resource-certificates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReplaceResourceCertificatesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReplaceResourceCertificatesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for replaceResourceCertificates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* UploadCertificates uploads certificates to the certificate store @@ -549,6 +635,47 @@ func (a *Client) UploadCertificates(params *UploadCertificatesParams, opts ...Cl panic(msg) } +/* +ValidateResourceCertificates validates resource certificates + +Validate resource certificates +*/ +func (a *Client) ValidateResourceCertificates(params *ValidateResourceCertificatesParams, opts ...ClientOption) (*ValidateResourceCertificatesOK, *ValidateResourceCertificatesCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewValidateResourceCertificatesParams() + } + op := &runtime.ClientOperation{ + ID: "validateResourceCertificates", + Method: "PUT", + PathPattern: "/v1/domains/{id}/resource-certificates/validations", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ValidateResourceCertificatesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *ValidateResourceCertificatesOK: + return value, nil, nil + case *ValidateResourceCertificatesCreated: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for certificates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* ViewCertificate views certificate of all the resources in a domain diff --git a/client/certificates/delete_ca_configuration_responses.go b/client/certificates/delete_ca_configuration_responses.go index 5122840..f44a422 100644 --- a/client/certificates/delete_ca_configuration_responses.go +++ b/client/certificates/delete_ca_configuration_responses.go @@ -124,7 +124,7 @@ func NewDeleteCaConfigurationNoContent() *DeleteCaConfigurationNoContent { /* DeleteCaConfigurationNoContent describes a response with status code 204, with default header values. -No contet +No content */ type DeleteCaConfigurationNoContent struct { Payload interface{} diff --git a/client/certificates/download_csr_parameters.go b/client/certificates/download_csr_parameters.go index 4907cbd..7ab4fe8 100644 --- a/client/certificates/download_csr_parameters.go +++ b/client/certificates/download_csr_parameters.go @@ -66,7 +66,7 @@ type DownloadCSRParams struct { /* DomainName. - The domain name + Domain ID or Name */ DomainName string diff --git a/client/certificates/generate_certificates_parameters.go b/client/certificates/generate_certificates_parameters.go index 938a4b8..f3933d7 100644 --- a/client/certificates/generate_certificates_parameters.go +++ b/client/certificates/generate_certificates_parameters.go @@ -74,7 +74,7 @@ type GenerateCertificatesParams struct { /* DomainName. - The domain name + Domain ID or Name */ DomainName string diff --git a/client/certificates/generates_csrs_parameters.go b/client/certificates/generates_csrs_parameters.go index 65ade64..1a3921f 100644 --- a/client/certificates/generates_csrs_parameters.go +++ b/client/certificates/generates_csrs_parameters.go @@ -74,7 +74,7 @@ type GeneratesCSRsParams struct { /* DomainName. - The domain name + Domain ID or Name */ DomainName string diff --git a/client/certificates/get_certificates_parameters.go b/client/certificates/get_certificates_parameters.go index f832664..4e7e376 100644 --- a/client/certificates/get_certificates_parameters.go +++ b/client/certificates/get_certificates_parameters.go @@ -66,7 +66,7 @@ type GetCertificatesParams struct { /* DomainName. - The domain name + Domain ID or Name */ DomainName string diff --git a/client/certificates/get_csrs_parameters.go b/client/certificates/get_csrs_parameters.go index d5f5cad..2bb6c9b 100644 --- a/client/certificates/get_csrs_parameters.go +++ b/client/certificates/get_csrs_parameters.go @@ -66,7 +66,7 @@ type GetCSRsParams struct { /* DomainName. - The domain name + Domain ID or Name */ DomainName string diff --git a/client/certificates/get_resource_certificates_validation_result_parameters.go b/client/certificates/get_resource_certificates_validation_result_parameters.go new file mode 100644 index 0000000..ca32129 --- /dev/null +++ b/client/certificates/get_resource_certificates_validation_result_parameters.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetResourceCertificatesValidationResultParams creates a new GetResourceCertificatesValidationResultParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetResourceCertificatesValidationResultParams() *GetResourceCertificatesValidationResultParams { + return &GetResourceCertificatesValidationResultParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetResourceCertificatesValidationResultParamsWithTimeout creates a new GetResourceCertificatesValidationResultParams object +// with the ability to set a timeout on a request. +func NewGetResourceCertificatesValidationResultParamsWithTimeout(timeout time.Duration) *GetResourceCertificatesValidationResultParams { + return &GetResourceCertificatesValidationResultParams{ + timeout: timeout, + } +} + +// NewGetResourceCertificatesValidationResultParamsWithContext creates a new GetResourceCertificatesValidationResultParams object +// with the ability to set a context for a request. +func NewGetResourceCertificatesValidationResultParamsWithContext(ctx context.Context) *GetResourceCertificatesValidationResultParams { + return &GetResourceCertificatesValidationResultParams{ + Context: ctx, + } +} + +// NewGetResourceCertificatesValidationResultParamsWithHTTPClient creates a new GetResourceCertificatesValidationResultParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetResourceCertificatesValidationResultParamsWithHTTPClient(client *http.Client) *GetResourceCertificatesValidationResultParams { + return &GetResourceCertificatesValidationResultParams{ + HTTPClient: client, + } +} + +/* +GetResourceCertificatesValidationResultParams contains all the parameters to send to the API endpoint + + for the get resource certificates validation result operation. + + Typically these are written to a http.Request. +*/ +type GetResourceCertificatesValidationResultParams struct { + + /* ID. + + Domain ID + */ + ID string + + /* ValidationID. + + Validation ID + */ + ValidationID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get resource certificates validation result params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourceCertificatesValidationResultParams) WithDefaults() *GetResourceCertificatesValidationResultParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get resource certificates validation result params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetResourceCertificatesValidationResultParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get resource certificates validation result params +func (o *GetResourceCertificatesValidationResultParams) WithTimeout(timeout time.Duration) *GetResourceCertificatesValidationResultParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get resource certificates validation result params +func (o *GetResourceCertificatesValidationResultParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get resource certificates validation result params +func (o *GetResourceCertificatesValidationResultParams) WithContext(ctx context.Context) *GetResourceCertificatesValidationResultParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get resource certificates validation result params +func (o *GetResourceCertificatesValidationResultParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get resource certificates validation result params +func (o *GetResourceCertificatesValidationResultParams) WithHTTPClient(client *http.Client) *GetResourceCertificatesValidationResultParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get resource certificates validation result params +func (o *GetResourceCertificatesValidationResultParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get resource certificates validation result params +func (o *GetResourceCertificatesValidationResultParams) WithID(id string) *GetResourceCertificatesValidationResultParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get resource certificates validation result params +func (o *GetResourceCertificatesValidationResultParams) SetID(id string) { + o.ID = id +} + +// WithValidationID adds the validationID to the get resource certificates validation result params +func (o *GetResourceCertificatesValidationResultParams) WithValidationID(validationID string) *GetResourceCertificatesValidationResultParams { + o.SetValidationID(validationID) + return o +} + +// SetValidationID adds the validationId to the get resource certificates validation result params +func (o *GetResourceCertificatesValidationResultParams) SetValidationID(validationID string) { + o.ValidationID = validationID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetResourceCertificatesValidationResultParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + // path param validationId + if err := r.SetPathParam("validationId", o.ValidationID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/certificates/get_resource_certificates_validation_result_responses.go b/client/certificates/get_resource_certificates_validation_result_responses.go new file mode 100644 index 0000000..68610bd --- /dev/null +++ b/client/certificates/get_resource_certificates_validation_result_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// GetResourceCertificatesValidationResultReader is a Reader for the GetResourceCertificatesValidationResult structure. +type GetResourceCertificatesValidationResultReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetResourceCertificatesValidationResultReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetResourceCertificatesValidationResultOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewGetResourceCertificatesValidationResultNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetResourceCertificatesValidationResultInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetResourceCertificatesValidationResultOK creates a GetResourceCertificatesValidationResultOK with default headers values +func NewGetResourceCertificatesValidationResultOK() *GetResourceCertificatesValidationResultOK { + return &GetResourceCertificatesValidationResultOK{} +} + +/* +GetResourceCertificatesValidationResultOK describes a response with status code 200, with default header values. + +OK +*/ +type GetResourceCertificatesValidationResultOK struct { + Payload *models.CertificateValidationTask +} + +// IsSuccess returns true when this get resource certificates validation result o k response has a 2xx status code +func (o *GetResourceCertificatesValidationResultOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get resource certificates validation result o k response has a 3xx status code +func (o *GetResourceCertificatesValidationResultOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get resource certificates validation result o k response has a 4xx status code +func (o *GetResourceCertificatesValidationResultOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get resource certificates validation result o k response has a 5xx status code +func (o *GetResourceCertificatesValidationResultOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get resource certificates validation result o k response a status code equal to that given +func (o *GetResourceCertificatesValidationResultOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetResourceCertificatesValidationResultOK) Error() string { + return fmt.Sprintf("[GET /v1/domains/{id}/resource-certificates/validations/{validationId}][%d] getResourceCertificatesValidationResultOK %+v", 200, o.Payload) +} + +func (o *GetResourceCertificatesValidationResultOK) String() string { + return fmt.Sprintf("[GET /v1/domains/{id}/resource-certificates/validations/{validationId}][%d] getResourceCertificatesValidationResultOK %+v", 200, o.Payload) +} + +func (o *GetResourceCertificatesValidationResultOK) GetPayload() *models.CertificateValidationTask { + return o.Payload +} + +func (o *GetResourceCertificatesValidationResultOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CertificateValidationTask) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetResourceCertificatesValidationResultNotFound creates a GetResourceCertificatesValidationResultNotFound with default headers values +func NewGetResourceCertificatesValidationResultNotFound() *GetResourceCertificatesValidationResultNotFound { + return &GetResourceCertificatesValidationResultNotFound{} +} + +/* +GetResourceCertificatesValidationResultNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type GetResourceCertificatesValidationResultNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this get resource certificates validation result not found response has a 2xx status code +func (o *GetResourceCertificatesValidationResultNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get resource certificates validation result not found response has a 3xx status code +func (o *GetResourceCertificatesValidationResultNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get resource certificates validation result not found response has a 4xx status code +func (o *GetResourceCertificatesValidationResultNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get resource certificates validation result not found response has a 5xx status code +func (o *GetResourceCertificatesValidationResultNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get resource certificates validation result not found response a status code equal to that given +func (o *GetResourceCertificatesValidationResultNotFound) IsCode(code int) bool { + return code == 404 +} + +func (o *GetResourceCertificatesValidationResultNotFound) Error() string { + return fmt.Sprintf("[GET /v1/domains/{id}/resource-certificates/validations/{validationId}][%d] getResourceCertificatesValidationResultNotFound %+v", 404, o.Payload) +} + +func (o *GetResourceCertificatesValidationResultNotFound) String() string { + return fmt.Sprintf("[GET /v1/domains/{id}/resource-certificates/validations/{validationId}][%d] getResourceCertificatesValidationResultNotFound %+v", 404, o.Payload) +} + +func (o *GetResourceCertificatesValidationResultNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetResourceCertificatesValidationResultNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetResourceCertificatesValidationResultInternalServerError creates a GetResourceCertificatesValidationResultInternalServerError with default headers values +func NewGetResourceCertificatesValidationResultInternalServerError() *GetResourceCertificatesValidationResultInternalServerError { + return &GetResourceCertificatesValidationResultInternalServerError{} +} + +/* +GetResourceCertificatesValidationResultInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetResourceCertificatesValidationResultInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this get resource certificates validation result internal server error response has a 2xx status code +func (o *GetResourceCertificatesValidationResultInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get resource certificates validation result internal server error response has a 3xx status code +func (o *GetResourceCertificatesValidationResultInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get resource certificates validation result internal server error response has a 4xx status code +func (o *GetResourceCertificatesValidationResultInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get resource certificates validation result internal server error response has a 5xx status code +func (o *GetResourceCertificatesValidationResultInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get resource certificates validation result internal server error response a status code equal to that given +func (o *GetResourceCertificatesValidationResultInternalServerError) IsCode(code int) bool { + return code == 500 +} + +func (o *GetResourceCertificatesValidationResultInternalServerError) Error() string { + return fmt.Sprintf("[GET /v1/domains/{id}/resource-certificates/validations/{validationId}][%d] getResourceCertificatesValidationResultInternalServerError %+v", 500, o.Payload) +} + +func (o *GetResourceCertificatesValidationResultInternalServerError) String() string { + return fmt.Sprintf("[GET /v1/domains/{id}/resource-certificates/validations/{validationId}][%d] getResourceCertificatesValidationResultInternalServerError %+v", 500, o.Payload) +} + +func (o *GetResourceCertificatesValidationResultInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetResourceCertificatesValidationResultInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/certificates/replace_certificates_parameters.go b/client/certificates/replace_certificates_parameters.go index 008286f..7d03a25 100644 --- a/client/certificates/replace_certificates_parameters.go +++ b/client/certificates/replace_certificates_parameters.go @@ -74,7 +74,7 @@ type ReplaceCertificatesParams struct { /* DomainName. - The domain name + Domain ID or Name */ DomainName string diff --git a/client/certificates/replace_resource_certificates_parameters.go b/client/certificates/replace_resource_certificates_parameters.go new file mode 100644 index 0000000..119813c --- /dev/null +++ b/client/certificates/replace_resource_certificates_parameters.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// NewReplaceResourceCertificatesParams creates a new ReplaceResourceCertificatesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReplaceResourceCertificatesParams() *ReplaceResourceCertificatesParams { + return &ReplaceResourceCertificatesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReplaceResourceCertificatesParamsWithTimeout creates a new ReplaceResourceCertificatesParams object +// with the ability to set a timeout on a request. +func NewReplaceResourceCertificatesParamsWithTimeout(timeout time.Duration) *ReplaceResourceCertificatesParams { + return &ReplaceResourceCertificatesParams{ + timeout: timeout, + } +} + +// NewReplaceResourceCertificatesParamsWithContext creates a new ReplaceResourceCertificatesParams object +// with the ability to set a context for a request. +func NewReplaceResourceCertificatesParamsWithContext(ctx context.Context) *ReplaceResourceCertificatesParams { + return &ReplaceResourceCertificatesParams{ + Context: ctx, + } +} + +// NewReplaceResourceCertificatesParamsWithHTTPClient creates a new ReplaceResourceCertificatesParams object +// with the ability to set a custom HTTPClient for a request. +func NewReplaceResourceCertificatesParamsWithHTTPClient(client *http.Client) *ReplaceResourceCertificatesParams { + return &ReplaceResourceCertificatesParams{ + HTTPClient: client, + } +} + +/* +ReplaceResourceCertificatesParams contains all the parameters to send to the API endpoint + + for the replace resource certificates operation. + + Typically these are written to a http.Request. +*/ +type ReplaceResourceCertificatesParams struct { + + /* ID. + + Domain ID + */ + ID string + + /* ResourceCertificateSpecs. + + resourceCertificateSpecs + */ + ResourceCertificateSpecs []*models.ResourceCertificateSpec + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the replace resource certificates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReplaceResourceCertificatesParams) WithDefaults() *ReplaceResourceCertificatesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the replace resource certificates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReplaceResourceCertificatesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the replace resource certificates params +func (o *ReplaceResourceCertificatesParams) WithTimeout(timeout time.Duration) *ReplaceResourceCertificatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the replace resource certificates params +func (o *ReplaceResourceCertificatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the replace resource certificates params +func (o *ReplaceResourceCertificatesParams) WithContext(ctx context.Context) *ReplaceResourceCertificatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the replace resource certificates params +func (o *ReplaceResourceCertificatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the replace resource certificates params +func (o *ReplaceResourceCertificatesParams) WithHTTPClient(client *http.Client) *ReplaceResourceCertificatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the replace resource certificates params +func (o *ReplaceResourceCertificatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the replace resource certificates params +func (o *ReplaceResourceCertificatesParams) WithID(id string) *ReplaceResourceCertificatesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the replace resource certificates params +func (o *ReplaceResourceCertificatesParams) SetID(id string) { + o.ID = id +} + +// WithResourceCertificateSpecs adds the resourceCertificateSpecs to the replace resource certificates params +func (o *ReplaceResourceCertificatesParams) WithResourceCertificateSpecs(resourceCertificateSpecs []*models.ResourceCertificateSpec) *ReplaceResourceCertificatesParams { + o.SetResourceCertificateSpecs(resourceCertificateSpecs) + return o +} + +// SetResourceCertificateSpecs adds the resourceCertificateSpecs to the replace resource certificates params +func (o *ReplaceResourceCertificatesParams) SetResourceCertificateSpecs(resourceCertificateSpecs []*models.ResourceCertificateSpec) { + o.ResourceCertificateSpecs = resourceCertificateSpecs +} + +// WriteToRequest writes these params to a swagger request +func (o *ReplaceResourceCertificatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.ResourceCertificateSpecs != nil { + if err := r.SetBodyParam(o.ResourceCertificateSpecs); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/certificates/replace_resource_certificates_responses.go b/client/certificates/replace_resource_certificates_responses.go new file mode 100644 index 0000000..f61139b --- /dev/null +++ b/client/certificates/replace_resource_certificates_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// ReplaceResourceCertificatesReader is a Reader for the ReplaceResourceCertificates structure. +type ReplaceResourceCertificatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReplaceResourceCertificatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReplaceResourceCertificatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewReplaceResourceCertificatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReplaceResourceCertificatesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewReplaceResourceCertificatesOK creates a ReplaceResourceCertificatesOK with default headers values +func NewReplaceResourceCertificatesOK() *ReplaceResourceCertificatesOK { + return &ReplaceResourceCertificatesOK{} +} + +/* +ReplaceResourceCertificatesOK describes a response with status code 200, with default header values. + +OK +*/ +type ReplaceResourceCertificatesOK struct { + Payload *models.Task +} + +// IsSuccess returns true when this replace resource certificates o k response has a 2xx status code +func (o *ReplaceResourceCertificatesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this replace resource certificates o k response has a 3xx status code +func (o *ReplaceResourceCertificatesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this replace resource certificates o k response has a 4xx status code +func (o *ReplaceResourceCertificatesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this replace resource certificates o k response has a 5xx status code +func (o *ReplaceResourceCertificatesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this replace resource certificates o k response a status code equal to that given +func (o *ReplaceResourceCertificatesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ReplaceResourceCertificatesOK) Error() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates][%d] replaceResourceCertificatesOK %+v", 200, o.Payload) +} + +func (o *ReplaceResourceCertificatesOK) String() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates][%d] replaceResourceCertificatesOK %+v", 200, o.Payload) +} + +func (o *ReplaceResourceCertificatesOK) GetPayload() *models.Task { + return o.Payload +} + +func (o *ReplaceResourceCertificatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Task) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReplaceResourceCertificatesNotFound creates a ReplaceResourceCertificatesNotFound with default headers values +func NewReplaceResourceCertificatesNotFound() *ReplaceResourceCertificatesNotFound { + return &ReplaceResourceCertificatesNotFound{} +} + +/* +ReplaceResourceCertificatesNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type ReplaceResourceCertificatesNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this replace resource certificates not found response has a 2xx status code +func (o *ReplaceResourceCertificatesNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this replace resource certificates not found response has a 3xx status code +func (o *ReplaceResourceCertificatesNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this replace resource certificates not found response has a 4xx status code +func (o *ReplaceResourceCertificatesNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this replace resource certificates not found response has a 5xx status code +func (o *ReplaceResourceCertificatesNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this replace resource certificates not found response a status code equal to that given +func (o *ReplaceResourceCertificatesNotFound) IsCode(code int) bool { + return code == 404 +} + +func (o *ReplaceResourceCertificatesNotFound) Error() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates][%d] replaceResourceCertificatesNotFound %+v", 404, o.Payload) +} + +func (o *ReplaceResourceCertificatesNotFound) String() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates][%d] replaceResourceCertificatesNotFound %+v", 404, o.Payload) +} + +func (o *ReplaceResourceCertificatesNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *ReplaceResourceCertificatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReplaceResourceCertificatesInternalServerError creates a ReplaceResourceCertificatesInternalServerError with default headers values +func NewReplaceResourceCertificatesInternalServerError() *ReplaceResourceCertificatesInternalServerError { + return &ReplaceResourceCertificatesInternalServerError{} +} + +/* +ReplaceResourceCertificatesInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type ReplaceResourceCertificatesInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this replace resource certificates internal server error response has a 2xx status code +func (o *ReplaceResourceCertificatesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this replace resource certificates internal server error response has a 3xx status code +func (o *ReplaceResourceCertificatesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this replace resource certificates internal server error response has a 4xx status code +func (o *ReplaceResourceCertificatesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this replace resource certificates internal server error response has a 5xx status code +func (o *ReplaceResourceCertificatesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this replace resource certificates internal server error response a status code equal to that given +func (o *ReplaceResourceCertificatesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +func (o *ReplaceResourceCertificatesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates][%d] replaceResourceCertificatesInternalServerError %+v", 500, o.Payload) +} + +func (o *ReplaceResourceCertificatesInternalServerError) String() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates][%d] replaceResourceCertificatesInternalServerError %+v", 500, o.Payload) +} + +func (o *ReplaceResourceCertificatesInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *ReplaceResourceCertificatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/certificates/upload_certificates_parameters.go b/client/certificates/upload_certificates_parameters.go index 5c4aa1e..9498bb8 100644 --- a/client/certificates/upload_certificates_parameters.go +++ b/client/certificates/upload_certificates_parameters.go @@ -66,7 +66,7 @@ type UploadCertificatesParams struct { /* DomainName. - The domain name + Domain ID or Name */ DomainName string diff --git a/client/certificates/validate_resource_certificates_parameters.go b/client/certificates/validate_resource_certificates_parameters.go new file mode 100644 index 0000000..66822cb --- /dev/null +++ b/client/certificates/validate_resource_certificates_parameters.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// NewValidateResourceCertificatesParams creates a new ValidateResourceCertificatesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewValidateResourceCertificatesParams() *ValidateResourceCertificatesParams { + return &ValidateResourceCertificatesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewValidateResourceCertificatesParamsWithTimeout creates a new ValidateResourceCertificatesParams object +// with the ability to set a timeout on a request. +func NewValidateResourceCertificatesParamsWithTimeout(timeout time.Duration) *ValidateResourceCertificatesParams { + return &ValidateResourceCertificatesParams{ + timeout: timeout, + } +} + +// NewValidateResourceCertificatesParamsWithContext creates a new ValidateResourceCertificatesParams object +// with the ability to set a context for a request. +func NewValidateResourceCertificatesParamsWithContext(ctx context.Context) *ValidateResourceCertificatesParams { + return &ValidateResourceCertificatesParams{ + Context: ctx, + } +} + +// NewValidateResourceCertificatesParamsWithHTTPClient creates a new ValidateResourceCertificatesParams object +// with the ability to set a custom HTTPClient for a request. +func NewValidateResourceCertificatesParamsWithHTTPClient(client *http.Client) *ValidateResourceCertificatesParams { + return &ValidateResourceCertificatesParams{ + HTTPClient: client, + } +} + +/* +ValidateResourceCertificatesParams contains all the parameters to send to the API endpoint + + for the validate resource certificates operation. + + Typically these are written to a http.Request. +*/ +type ValidateResourceCertificatesParams struct { + + /* ID. + + Domain ID + */ + ID string + + /* ResourceCertificateSpecs. + + resourceCertificateSpecs + */ + ResourceCertificateSpecs []*models.ResourceCertificateSpec + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the validate resource certificates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateResourceCertificatesParams) WithDefaults() *ValidateResourceCertificatesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the validate resource certificates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateResourceCertificatesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the validate resource certificates params +func (o *ValidateResourceCertificatesParams) WithTimeout(timeout time.Duration) *ValidateResourceCertificatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the validate resource certificates params +func (o *ValidateResourceCertificatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the validate resource certificates params +func (o *ValidateResourceCertificatesParams) WithContext(ctx context.Context) *ValidateResourceCertificatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the validate resource certificates params +func (o *ValidateResourceCertificatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the validate resource certificates params +func (o *ValidateResourceCertificatesParams) WithHTTPClient(client *http.Client) *ValidateResourceCertificatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the validate resource certificates params +func (o *ValidateResourceCertificatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the validate resource certificates params +func (o *ValidateResourceCertificatesParams) WithID(id string) *ValidateResourceCertificatesParams { + o.SetID(id) + return o +} + +// SetID adds the id to the validate resource certificates params +func (o *ValidateResourceCertificatesParams) SetID(id string) { + o.ID = id +} + +// WithResourceCertificateSpecs adds the resourceCertificateSpecs to the validate resource certificates params +func (o *ValidateResourceCertificatesParams) WithResourceCertificateSpecs(resourceCertificateSpecs []*models.ResourceCertificateSpec) *ValidateResourceCertificatesParams { + o.SetResourceCertificateSpecs(resourceCertificateSpecs) + return o +} + +// SetResourceCertificateSpecs adds the resourceCertificateSpecs to the validate resource certificates params +func (o *ValidateResourceCertificatesParams) SetResourceCertificateSpecs(resourceCertificateSpecs []*models.ResourceCertificateSpec) { + o.ResourceCertificateSpecs = resourceCertificateSpecs +} + +// WriteToRequest writes these params to a swagger request +func (o *ValidateResourceCertificatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.ResourceCertificateSpecs != nil { + if err := r.SetBodyParam(o.ResourceCertificateSpecs); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/certificates/validate_resource_certificates_responses.go b/client/certificates/validate_resource_certificates_responses.go new file mode 100644 index 0000000..4479a68 --- /dev/null +++ b/client/certificates/validate_resource_certificates_responses.go @@ -0,0 +1,308 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// ValidateResourceCertificatesReader is a Reader for the ValidateResourceCertificates structure. +type ValidateResourceCertificatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ValidateResourceCertificatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewValidateResourceCertificatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 201: + result := NewValidateResourceCertificatesCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewValidateResourceCertificatesNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewValidateResourceCertificatesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewValidateResourceCertificatesOK creates a ValidateResourceCertificatesOK with default headers values +func NewValidateResourceCertificatesOK() *ValidateResourceCertificatesOK { + return &ValidateResourceCertificatesOK{} +} + +/* +ValidateResourceCertificatesOK describes a response with status code 200, with default header values. + +OK +*/ +type ValidateResourceCertificatesOK struct { + Payload *models.CertificateValidationTask +} + +// IsSuccess returns true when this validate resource certificates o k response has a 2xx status code +func (o *ValidateResourceCertificatesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate resource certificates o k response has a 3xx status code +func (o *ValidateResourceCertificatesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate resource certificates o k response has a 4xx status code +func (o *ValidateResourceCertificatesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate resource certificates o k response has a 5xx status code +func (o *ValidateResourceCertificatesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this validate resource certificates o k response a status code equal to that given +func (o *ValidateResourceCertificatesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *ValidateResourceCertificatesOK) Error() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates/validations][%d] validateResourceCertificatesOK %+v", 200, o.Payload) +} + +func (o *ValidateResourceCertificatesOK) String() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates/validations][%d] validateResourceCertificatesOK %+v", 200, o.Payload) +} + +func (o *ValidateResourceCertificatesOK) GetPayload() *models.CertificateValidationTask { + return o.Payload +} + +func (o *ValidateResourceCertificatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CertificateValidationTask) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateResourceCertificatesCreated creates a ValidateResourceCertificatesCreated with default headers values +func NewValidateResourceCertificatesCreated() *ValidateResourceCertificatesCreated { + return &ValidateResourceCertificatesCreated{} +} + +/* +ValidateResourceCertificatesCreated describes a response with status code 201, with default header values. + +Created +*/ +type ValidateResourceCertificatesCreated struct { + Payload *models.CertificateValidationTask +} + +// IsSuccess returns true when this validate resource certificates created response has a 2xx status code +func (o *ValidateResourceCertificatesCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate resource certificates created response has a 3xx status code +func (o *ValidateResourceCertificatesCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate resource certificates created response has a 4xx status code +func (o *ValidateResourceCertificatesCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate resource certificates created response has a 5xx status code +func (o *ValidateResourceCertificatesCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this validate resource certificates created response a status code equal to that given +func (o *ValidateResourceCertificatesCreated) IsCode(code int) bool { + return code == 201 +} + +func (o *ValidateResourceCertificatesCreated) Error() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates/validations][%d] validateResourceCertificatesCreated %+v", 201, o.Payload) +} + +func (o *ValidateResourceCertificatesCreated) String() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates/validations][%d] validateResourceCertificatesCreated %+v", 201, o.Payload) +} + +func (o *ValidateResourceCertificatesCreated) GetPayload() *models.CertificateValidationTask { + return o.Payload +} + +func (o *ValidateResourceCertificatesCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CertificateValidationTask) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateResourceCertificatesNotFound creates a ValidateResourceCertificatesNotFound with default headers values +func NewValidateResourceCertificatesNotFound() *ValidateResourceCertificatesNotFound { + return &ValidateResourceCertificatesNotFound{} +} + +/* +ValidateResourceCertificatesNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type ValidateResourceCertificatesNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this validate resource certificates not found response has a 2xx status code +func (o *ValidateResourceCertificatesNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this validate resource certificates not found response has a 3xx status code +func (o *ValidateResourceCertificatesNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate resource certificates not found response has a 4xx status code +func (o *ValidateResourceCertificatesNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this validate resource certificates not found response has a 5xx status code +func (o *ValidateResourceCertificatesNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this validate resource certificates not found response a status code equal to that given +func (o *ValidateResourceCertificatesNotFound) IsCode(code int) bool { + return code == 404 +} + +func (o *ValidateResourceCertificatesNotFound) Error() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates/validations][%d] validateResourceCertificatesNotFound %+v", 404, o.Payload) +} + +func (o *ValidateResourceCertificatesNotFound) String() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates/validations][%d] validateResourceCertificatesNotFound %+v", 404, o.Payload) +} + +func (o *ValidateResourceCertificatesNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *ValidateResourceCertificatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateResourceCertificatesInternalServerError creates a ValidateResourceCertificatesInternalServerError with default headers values +func NewValidateResourceCertificatesInternalServerError() *ValidateResourceCertificatesInternalServerError { + return &ValidateResourceCertificatesInternalServerError{} +} + +/* +ValidateResourceCertificatesInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type ValidateResourceCertificatesInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this validate resource certificates internal server error response has a 2xx status code +func (o *ValidateResourceCertificatesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this validate resource certificates internal server error response has a 3xx status code +func (o *ValidateResourceCertificatesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate resource certificates internal server error response has a 4xx status code +func (o *ValidateResourceCertificatesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate resource certificates internal server error response has a 5xx status code +func (o *ValidateResourceCertificatesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this validate resource certificates internal server error response a status code equal to that given +func (o *ValidateResourceCertificatesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +func (o *ValidateResourceCertificatesInternalServerError) Error() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates/validations][%d] validateResourceCertificatesInternalServerError %+v", 500, o.Payload) +} + +func (o *ValidateResourceCertificatesInternalServerError) String() string { + return fmt.Sprintf("[PUT /v1/domains/{id}/resource-certificates/validations][%d] validateResourceCertificatesInternalServerError %+v", 500, o.Payload) +} + +func (o *ValidateResourceCertificatesInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *ValidateResourceCertificatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/certificates/view_certificate_parameters.go b/client/certificates/view_certificate_parameters.go index 5b379d1..a916947 100644 --- a/client/certificates/view_certificate_parameters.go +++ b/client/certificates/view_certificate_parameters.go @@ -66,7 +66,7 @@ type ViewCertificateParams struct { /* DomainName. - The domain name + Domain ID or Name */ DomainName string diff --git a/client/license_keys/get_domain_licensing_info_parameters.go b/client/license_keys/get_domain_licensing_info_parameters.go new file mode 100644 index 0000000..8c55119 --- /dev/null +++ b/client/license_keys/get_domain_licensing_info_parameters.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package license_keys + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetDomainLicensingInfoParams creates a new GetDomainLicensingInfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetDomainLicensingInfoParams() *GetDomainLicensingInfoParams { + return &GetDomainLicensingInfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDomainLicensingInfoParamsWithTimeout creates a new GetDomainLicensingInfoParams object +// with the ability to set a timeout on a request. +func NewGetDomainLicensingInfoParamsWithTimeout(timeout time.Duration) *GetDomainLicensingInfoParams { + return &GetDomainLicensingInfoParams{ + timeout: timeout, + } +} + +// NewGetDomainLicensingInfoParamsWithContext creates a new GetDomainLicensingInfoParams object +// with the ability to set a context for a request. +func NewGetDomainLicensingInfoParamsWithContext(ctx context.Context) *GetDomainLicensingInfoParams { + return &GetDomainLicensingInfoParams{ + Context: ctx, + } +} + +// NewGetDomainLicensingInfoParamsWithHTTPClient creates a new GetDomainLicensingInfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDomainLicensingInfoParamsWithHTTPClient(client *http.Client) *GetDomainLicensingInfoParams { + return &GetDomainLicensingInfoParams{ + HTTPClient: client, + } +} + +/* +GetDomainLicensingInfoParams contains all the parameters to send to the API endpoint + + for the get domain licensing info operation. + + Typically these are written to a http.Request. +*/ +type GetDomainLicensingInfoParams struct { + + /* ID. + + The domain ID + */ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get domain licensing info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDomainLicensingInfoParams) WithDefaults() *GetDomainLicensingInfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get domain licensing info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDomainLicensingInfoParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get domain licensing info params +func (o *GetDomainLicensingInfoParams) WithTimeout(timeout time.Duration) *GetDomainLicensingInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get domain licensing info params +func (o *GetDomainLicensingInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get domain licensing info params +func (o *GetDomainLicensingInfoParams) WithContext(ctx context.Context) *GetDomainLicensingInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get domain licensing info params +func (o *GetDomainLicensingInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get domain licensing info params +func (o *GetDomainLicensingInfoParams) WithHTTPClient(client *http.Client) *GetDomainLicensingInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get domain licensing info params +func (o *GetDomainLicensingInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the get domain licensing info params +func (o *GetDomainLicensingInfoParams) WithID(id string) *GetDomainLicensingInfoParams { + o.SetID(id) + return o +} + +// SetID adds the id to the get domain licensing info params +func (o *GetDomainLicensingInfoParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDomainLicensingInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/license_keys/get_domain_licensing_info_responses.go b/client/license_keys/get_domain_licensing_info_responses.go new file mode 100644 index 0000000..a3e257b --- /dev/null +++ b/client/license_keys/get_domain_licensing_info_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package license_keys + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// GetDomainLicensingInfoReader is a Reader for the GetDomainLicensingInfo structure. +type GetDomainLicensingInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDomainLicensingInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDomainLicensingInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewGetDomainLicensingInfoInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetDomainLicensingInfoOK creates a GetDomainLicensingInfoOK with default headers values +func NewGetDomainLicensingInfoOK() *GetDomainLicensingInfoOK { + return &GetDomainLicensingInfoOK{} +} + +/* +GetDomainLicensingInfoOK describes a response with status code 200, with default header values. + +Successful +*/ +type GetDomainLicensingInfoOK struct { + Payload *models.LicensingInfo +} + +// IsSuccess returns true when this get domain licensing info o k response has a 2xx status code +func (o *GetDomainLicensingInfoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get domain licensing info o k response has a 3xx status code +func (o *GetDomainLicensingInfoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get domain licensing info o k response has a 4xx status code +func (o *GetDomainLicensingInfoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get domain licensing info o k response has a 5xx status code +func (o *GetDomainLicensingInfoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get domain licensing info o k response a status code equal to that given +func (o *GetDomainLicensingInfoOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetDomainLicensingInfoOK) Error() string { + return fmt.Sprintf("[GET /v1/licensing-info/domains/{id}][%d] getDomainLicensingInfoOK %+v", 200, o.Payload) +} + +func (o *GetDomainLicensingInfoOK) String() string { + return fmt.Sprintf("[GET /v1/licensing-info/domains/{id}][%d] getDomainLicensingInfoOK %+v", 200, o.Payload) +} + +func (o *GetDomainLicensingInfoOK) GetPayload() *models.LicensingInfo { + return o.Payload +} + +func (o *GetDomainLicensingInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.LicensingInfo) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDomainLicensingInfoInternalServerError creates a GetDomainLicensingInfoInternalServerError with default headers values +func NewGetDomainLicensingInfoInternalServerError() *GetDomainLicensingInfoInternalServerError { + return &GetDomainLicensingInfoInternalServerError{} +} + +/* +GetDomainLicensingInfoInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetDomainLicensingInfoInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this get domain licensing info internal server error response has a 2xx status code +func (o *GetDomainLicensingInfoInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get domain licensing info internal server error response has a 3xx status code +func (o *GetDomainLicensingInfoInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get domain licensing info internal server error response has a 4xx status code +func (o *GetDomainLicensingInfoInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get domain licensing info internal server error response has a 5xx status code +func (o *GetDomainLicensingInfoInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get domain licensing info internal server error response a status code equal to that given +func (o *GetDomainLicensingInfoInternalServerError) IsCode(code int) bool { + return code == 500 +} + +func (o *GetDomainLicensingInfoInternalServerError) Error() string { + return fmt.Sprintf("[GET /v1/licensing-info/domains/{id}][%d] getDomainLicensingInfoInternalServerError %+v", 500, o.Payload) +} + +func (o *GetDomainLicensingInfoInternalServerError) String() string { + return fmt.Sprintf("[GET /v1/licensing-info/domains/{id}][%d] getDomainLicensingInfoInternalServerError %+v", 500, o.Payload) +} + +func (o *GetDomainLicensingInfoInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetDomainLicensingInfoInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/license_keys/get_system_licensing_info_parameters.go b/client/license_keys/get_system_licensing_info_parameters.go new file mode 100644 index 0000000..d0c0e6a --- /dev/null +++ b/client/license_keys/get_system_licensing_info_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package license_keys + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetSystemLicensingInfoParams creates a new GetSystemLicensingInfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetSystemLicensingInfoParams() *GetSystemLicensingInfoParams { + return &GetSystemLicensingInfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSystemLicensingInfoParamsWithTimeout creates a new GetSystemLicensingInfoParams object +// with the ability to set a timeout on a request. +func NewGetSystemLicensingInfoParamsWithTimeout(timeout time.Duration) *GetSystemLicensingInfoParams { + return &GetSystemLicensingInfoParams{ + timeout: timeout, + } +} + +// NewGetSystemLicensingInfoParamsWithContext creates a new GetSystemLicensingInfoParams object +// with the ability to set a context for a request. +func NewGetSystemLicensingInfoParamsWithContext(ctx context.Context) *GetSystemLicensingInfoParams { + return &GetSystemLicensingInfoParams{ + Context: ctx, + } +} + +// NewGetSystemLicensingInfoParamsWithHTTPClient creates a new GetSystemLicensingInfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSystemLicensingInfoParamsWithHTTPClient(client *http.Client) *GetSystemLicensingInfoParams { + return &GetSystemLicensingInfoParams{ + HTTPClient: client, + } +} + +/* +GetSystemLicensingInfoParams contains all the parameters to send to the API endpoint + + for the get system licensing info operation. + + Typically these are written to a http.Request. +*/ +type GetSystemLicensingInfoParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get system licensing info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSystemLicensingInfoParams) WithDefaults() *GetSystemLicensingInfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get system licensing info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSystemLicensingInfoParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get system licensing info params +func (o *GetSystemLicensingInfoParams) WithTimeout(timeout time.Duration) *GetSystemLicensingInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get system licensing info params +func (o *GetSystemLicensingInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get system licensing info params +func (o *GetSystemLicensingInfoParams) WithContext(ctx context.Context) *GetSystemLicensingInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get system licensing info params +func (o *GetSystemLicensingInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get system licensing info params +func (o *GetSystemLicensingInfoParams) WithHTTPClient(client *http.Client) *GetSystemLicensingInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get system licensing info params +func (o *GetSystemLicensingInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSystemLicensingInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/license_keys/get_system_licensing_info_responses.go b/client/license_keys/get_system_licensing_info_responses.go new file mode 100644 index 0000000..7867c0f --- /dev/null +++ b/client/license_keys/get_system_licensing_info_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package license_keys + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// GetSystemLicensingInfoReader is a Reader for the GetSystemLicensingInfo structure. +type GetSystemLicensingInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSystemLicensingInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSystemLicensingInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewGetSystemLicensingInfoInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSystemLicensingInfoOK creates a GetSystemLicensingInfoOK with default headers values +func NewGetSystemLicensingInfoOK() *GetSystemLicensingInfoOK { + return &GetSystemLicensingInfoOK{} +} + +/* +GetSystemLicensingInfoOK describes a response with status code 200, with default header values. + +Successful +*/ +type GetSystemLicensingInfoOK struct { + Payload *models.LicensingInfo +} + +// IsSuccess returns true when this get system licensing info o k response has a 2xx status code +func (o *GetSystemLicensingInfoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get system licensing info o k response has a 3xx status code +func (o *GetSystemLicensingInfoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get system licensing info o k response has a 4xx status code +func (o *GetSystemLicensingInfoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get system licensing info o k response has a 5xx status code +func (o *GetSystemLicensingInfoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get system licensing info o k response a status code equal to that given +func (o *GetSystemLicensingInfoOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetSystemLicensingInfoOK) Error() string { + return fmt.Sprintf("[GET /v1/licensing-info/system][%d] getSystemLicensingInfoOK %+v", 200, o.Payload) +} + +func (o *GetSystemLicensingInfoOK) String() string { + return fmt.Sprintf("[GET /v1/licensing-info/system][%d] getSystemLicensingInfoOK %+v", 200, o.Payload) +} + +func (o *GetSystemLicensingInfoOK) GetPayload() *models.LicensingInfo { + return o.Payload +} + +func (o *GetSystemLicensingInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.LicensingInfo) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSystemLicensingInfoInternalServerError creates a GetSystemLicensingInfoInternalServerError with default headers values +func NewGetSystemLicensingInfoInternalServerError() *GetSystemLicensingInfoInternalServerError { + return &GetSystemLicensingInfoInternalServerError{} +} + +/* +GetSystemLicensingInfoInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetSystemLicensingInfoInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this get system licensing info internal server error response has a 2xx status code +func (o *GetSystemLicensingInfoInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get system licensing info internal server error response has a 3xx status code +func (o *GetSystemLicensingInfoInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get system licensing info internal server error response has a 4xx status code +func (o *GetSystemLicensingInfoInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get system licensing info internal server error response has a 5xx status code +func (o *GetSystemLicensingInfoInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get system licensing info internal server error response a status code equal to that given +func (o *GetSystemLicensingInfoInternalServerError) IsCode(code int) bool { + return code == 500 +} + +func (o *GetSystemLicensingInfoInternalServerError) Error() string { + return fmt.Sprintf("[GET /v1/licensing-info/system][%d] getSystemLicensingInfoInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSystemLicensingInfoInternalServerError) String() string { + return fmt.Sprintf("[GET /v1/licensing-info/system][%d] getSystemLicensingInfoInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSystemLicensingInfoInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetSystemLicensingInfoInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/license_keys/license_keys_client.go b/client/license_keys/license_keys_client.go index fa3d6da..774b760 100644 --- a/client/license_keys/license_keys_client.go +++ b/client/license_keys/license_keys_client.go @@ -37,12 +37,20 @@ type ClientService interface { DeleteLicenseKey(params *DeleteLicenseKeyParams, opts ...ClientOption) (*DeleteLicenseKeyOK, *DeleteLicenseKeyNoContent, error) + GetDomainLicensingInfo(params *GetDomainLicensingInfoParams, opts ...ClientOption) (*GetDomainLicensingInfoOK, error) + GetLicenseKey(params *GetLicenseKeyParams, opts ...ClientOption) (*GetLicenseKeyOK, error) GetLicenseKeys(params *GetLicenseKeysParams, opts ...ClientOption) (*GetLicenseKeysOK, error) GetLicensingInfo(params *GetLicensingInfoParams, opts ...ClientOption) (*GetLicensingInfoOK, error) + GetSystemLicensingInfo(params *GetSystemLicensingInfoParams, opts ...ClientOption) (*GetSystemLicensingInfoOK, error) + + UpdateDomainLicensingInfo(params *UpdateDomainLicensingInfoParams, opts ...ClientOption) (*UpdateDomainLicensingInfoOK, *UpdateDomainLicensingInfoAccepted, error) + + UpdateSystemLicensingInfo(params *UpdateSystemLicensingInfoParams, opts ...ClientOption) (*UpdateSystemLicensingInfoOK, *UpdateSystemLicensingInfoAccepted, error) + SetTransport(transport runtime.ClientTransport) } @@ -124,6 +132,44 @@ func (a *Client) DeleteLicenseKey(params *DeleteLicenseKeyParams, opts ...Client panic(msg) } +/* +GetDomainLicensingInfo gets the licensing information of a domain +*/ +func (a *Client) GetDomainLicensingInfo(params *GetDomainLicensingInfoParams, opts ...ClientOption) (*GetDomainLicensingInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDomainLicensingInfoParams() + } + op := &runtime.ClientOperation{ + ID: "getDomainLicensingInfo", + Method: "GET", + PathPattern: "/v1/licensing-info/domains/{id}", + ProducesMediaTypes: []string{"*/*"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetDomainLicensingInfoReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetDomainLicensingInfoOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getDomainLicensingInfo: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetLicenseKey gets a license key by key */ @@ -238,6 +284,122 @@ func (a *Client) GetLicensingInfo(params *GetLicensingInfoParams, opts ...Client panic(msg) } +/* +GetSystemLicensingInfo gets the licensing information of system +*/ +func (a *Client) GetSystemLicensingInfo(params *GetSystemLicensingInfoParams, opts ...ClientOption) (*GetSystemLicensingInfoOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSystemLicensingInfoParams() + } + op := &runtime.ClientOperation{ + ID: "getSystemLicensingInfo", + Method: "GET", + PathPattern: "/v1/licensing-info/system", + ProducesMediaTypes: []string{"*/*"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSystemLicensingInfoReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetSystemLicensingInfoOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSystemLicensingInfo: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateDomainLicensingInfo updates the licensing information of a domain +*/ +func (a *Client) UpdateDomainLicensingInfo(params *UpdateDomainLicensingInfoParams, opts ...ClientOption) (*UpdateDomainLicensingInfoOK, *UpdateDomainLicensingInfoAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateDomainLicensingInfoParams() + } + op := &runtime.ClientOperation{ + ID: "updateDomainLicensingInfo", + Method: "PUT", + PathPattern: "/v1/licensing-info/domains/{id}", + ProducesMediaTypes: []string{"*/*"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateDomainLicensingInfoReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *UpdateDomainLicensingInfoOK: + return value, nil, nil + case *UpdateDomainLicensingInfoAccepted: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for license_keys: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateSystemLicensingInfo updates the licensing information of system +*/ +func (a *Client) UpdateSystemLicensingInfo(params *UpdateSystemLicensingInfoParams, opts ...ClientOption) (*UpdateSystemLicensingInfoOK, *UpdateSystemLicensingInfoAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateSystemLicensingInfoParams() + } + op := &runtime.ClientOperation{ + ID: "updateSystemLicensingInfo", + Method: "PUT", + PathPattern: "/v1/licensing-info/system", + ProducesMediaTypes: []string{"*/*"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateSystemLicensingInfoReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *UpdateSystemLicensingInfoOK: + return value, nil, nil + case *UpdateSystemLicensingInfoAccepted: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for license_keys: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/client/license_keys/update_domain_licensing_info_parameters.go b/client/license_keys/update_domain_licensing_info_parameters.go new file mode 100644 index 0000000..b6e36ad --- /dev/null +++ b/client/license_keys/update_domain_licensing_info_parameters.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package license_keys + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// NewUpdateDomainLicensingInfoParams creates a new UpdateDomainLicensingInfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateDomainLicensingInfoParams() *UpdateDomainLicensingInfoParams { + return &UpdateDomainLicensingInfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateDomainLicensingInfoParamsWithTimeout creates a new UpdateDomainLicensingInfoParams object +// with the ability to set a timeout on a request. +func NewUpdateDomainLicensingInfoParamsWithTimeout(timeout time.Duration) *UpdateDomainLicensingInfoParams { + return &UpdateDomainLicensingInfoParams{ + timeout: timeout, + } +} + +// NewUpdateDomainLicensingInfoParamsWithContext creates a new UpdateDomainLicensingInfoParams object +// with the ability to set a context for a request. +func NewUpdateDomainLicensingInfoParamsWithContext(ctx context.Context) *UpdateDomainLicensingInfoParams { + return &UpdateDomainLicensingInfoParams{ + Context: ctx, + } +} + +// NewUpdateDomainLicensingInfoParamsWithHTTPClient creates a new UpdateDomainLicensingInfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateDomainLicensingInfoParamsWithHTTPClient(client *http.Client) *UpdateDomainLicensingInfoParams { + return &UpdateDomainLicensingInfoParams{ + HTTPClient: client, + } +} + +/* +UpdateDomainLicensingInfoParams contains all the parameters to send to the API endpoint + + for the update domain licensing info operation. + + Typically these are written to a http.Request. +*/ +type UpdateDomainLicensingInfoParams struct { + + /* ID. + + The domain ID + */ + ID string + + /* LicensingInfoSpec. + + License information spec + */ + LicensingInfoSpec *models.LicensingInfoSpec + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update domain licensing info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateDomainLicensingInfoParams) WithDefaults() *UpdateDomainLicensingInfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update domain licensing info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateDomainLicensingInfoParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update domain licensing info params +func (o *UpdateDomainLicensingInfoParams) WithTimeout(timeout time.Duration) *UpdateDomainLicensingInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update domain licensing info params +func (o *UpdateDomainLicensingInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update domain licensing info params +func (o *UpdateDomainLicensingInfoParams) WithContext(ctx context.Context) *UpdateDomainLicensingInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update domain licensing info params +func (o *UpdateDomainLicensingInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update domain licensing info params +func (o *UpdateDomainLicensingInfoParams) WithHTTPClient(client *http.Client) *UpdateDomainLicensingInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update domain licensing info params +func (o *UpdateDomainLicensingInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the update domain licensing info params +func (o *UpdateDomainLicensingInfoParams) WithID(id string) *UpdateDomainLicensingInfoParams { + o.SetID(id) + return o +} + +// SetID adds the id to the update domain licensing info params +func (o *UpdateDomainLicensingInfoParams) SetID(id string) { + o.ID = id +} + +// WithLicensingInfoSpec adds the licensingInfoSpec to the update domain licensing info params +func (o *UpdateDomainLicensingInfoParams) WithLicensingInfoSpec(licensingInfoSpec *models.LicensingInfoSpec) *UpdateDomainLicensingInfoParams { + o.SetLicensingInfoSpec(licensingInfoSpec) + return o +} + +// SetLicensingInfoSpec adds the licensingInfoSpec to the update domain licensing info params +func (o *UpdateDomainLicensingInfoParams) SetLicensingInfoSpec(licensingInfoSpec *models.LicensingInfoSpec) { + o.LicensingInfoSpec = licensingInfoSpec +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateDomainLicensingInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + if o.LicensingInfoSpec != nil { + if err := r.SetBodyParam(o.LicensingInfoSpec); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/license_keys/update_domain_licensing_info_responses.go b/client/license_keys/update_domain_licensing_info_responses.go new file mode 100644 index 0000000..72b38fa --- /dev/null +++ b/client/license_keys/update_domain_licensing_info_responses.go @@ -0,0 +1,353 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package license_keys + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// UpdateDomainLicensingInfoReader is a Reader for the UpdateDomainLicensingInfo structure. +type UpdateDomainLicensingInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateDomainLicensingInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateDomainLicensingInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 202: + result := NewUpdateDomainLicensingInfoAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateDomainLicensingInfoBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdateDomainLicensingInfoConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateDomainLicensingInfoInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateDomainLicensingInfoOK creates a UpdateDomainLicensingInfoOK with default headers values +func NewUpdateDomainLicensingInfoOK() *UpdateDomainLicensingInfoOK { + return &UpdateDomainLicensingInfoOK{} +} + +/* +UpdateDomainLicensingInfoOK describes a response with status code 200, with default header values. + +OK +*/ +type UpdateDomainLicensingInfoOK struct { +} + +// IsSuccess returns true when this update domain licensing info o k response has a 2xx status code +func (o *UpdateDomainLicensingInfoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update domain licensing info o k response has a 3xx status code +func (o *UpdateDomainLicensingInfoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update domain licensing info o k response has a 4xx status code +func (o *UpdateDomainLicensingInfoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update domain licensing info o k response has a 5xx status code +func (o *UpdateDomainLicensingInfoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update domain licensing info o k response a status code equal to that given +func (o *UpdateDomainLicensingInfoOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateDomainLicensingInfoOK) Error() string { + return fmt.Sprintf("[PUT /v1/licensing-info/domains/{id}][%d] updateDomainLicensingInfoOK ", 200) +} + +func (o *UpdateDomainLicensingInfoOK) String() string { + return fmt.Sprintf("[PUT /v1/licensing-info/domains/{id}][%d] updateDomainLicensingInfoOK ", 200) +} + +func (o *UpdateDomainLicensingInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateDomainLicensingInfoAccepted creates a UpdateDomainLicensingInfoAccepted with default headers values +func NewUpdateDomainLicensingInfoAccepted() *UpdateDomainLicensingInfoAccepted { + return &UpdateDomainLicensingInfoAccepted{} +} + +/* +UpdateDomainLicensingInfoAccepted describes a response with status code 202, with default header values. + +Accepted +*/ +type UpdateDomainLicensingInfoAccepted struct { +} + +// IsSuccess returns true when this update domain licensing info accepted response has a 2xx status code +func (o *UpdateDomainLicensingInfoAccepted) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update domain licensing info accepted response has a 3xx status code +func (o *UpdateDomainLicensingInfoAccepted) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update domain licensing info accepted response has a 4xx status code +func (o *UpdateDomainLicensingInfoAccepted) IsClientError() bool { + return false +} + +// IsServerError returns true when this update domain licensing info accepted response has a 5xx status code +func (o *UpdateDomainLicensingInfoAccepted) IsServerError() bool { + return false +} + +// IsCode returns true when this update domain licensing info accepted response a status code equal to that given +func (o *UpdateDomainLicensingInfoAccepted) IsCode(code int) bool { + return code == 202 +} + +func (o *UpdateDomainLicensingInfoAccepted) Error() string { + return fmt.Sprintf("[PUT /v1/licensing-info/domains/{id}][%d] updateDomainLicensingInfoAccepted ", 202) +} + +func (o *UpdateDomainLicensingInfoAccepted) String() string { + return fmt.Sprintf("[PUT /v1/licensing-info/domains/{id}][%d] updateDomainLicensingInfoAccepted ", 202) +} + +func (o *UpdateDomainLicensingInfoAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateDomainLicensingInfoBadRequest creates a UpdateDomainLicensingInfoBadRequest with default headers values +func NewUpdateDomainLicensingInfoBadRequest() *UpdateDomainLicensingInfoBadRequest { + return &UpdateDomainLicensingInfoBadRequest{} +} + +/* +UpdateDomainLicensingInfoBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type UpdateDomainLicensingInfoBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this update domain licensing info bad request response has a 2xx status code +func (o *UpdateDomainLicensingInfoBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update domain licensing info bad request response has a 3xx status code +func (o *UpdateDomainLicensingInfoBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update domain licensing info bad request response has a 4xx status code +func (o *UpdateDomainLicensingInfoBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update domain licensing info bad request response has a 5xx status code +func (o *UpdateDomainLicensingInfoBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update domain licensing info bad request response a status code equal to that given +func (o *UpdateDomainLicensingInfoBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *UpdateDomainLicensingInfoBadRequest) Error() string { + return fmt.Sprintf("[PUT /v1/licensing-info/domains/{id}][%d] updateDomainLicensingInfoBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateDomainLicensingInfoBadRequest) String() string { + return fmt.Sprintf("[PUT /v1/licensing-info/domains/{id}][%d] updateDomainLicensingInfoBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateDomainLicensingInfoBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateDomainLicensingInfoBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateDomainLicensingInfoConflict creates a UpdateDomainLicensingInfoConflict with default headers values +func NewUpdateDomainLicensingInfoConflict() *UpdateDomainLicensingInfoConflict { + return &UpdateDomainLicensingInfoConflict{} +} + +/* +UpdateDomainLicensingInfoConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type UpdateDomainLicensingInfoConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this update domain licensing info conflict response has a 2xx status code +func (o *UpdateDomainLicensingInfoConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update domain licensing info conflict response has a 3xx status code +func (o *UpdateDomainLicensingInfoConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update domain licensing info conflict response has a 4xx status code +func (o *UpdateDomainLicensingInfoConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update domain licensing info conflict response has a 5xx status code +func (o *UpdateDomainLicensingInfoConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update domain licensing info conflict response a status code equal to that given +func (o *UpdateDomainLicensingInfoConflict) IsCode(code int) bool { + return code == 409 +} + +func (o *UpdateDomainLicensingInfoConflict) Error() string { + return fmt.Sprintf("[PUT /v1/licensing-info/domains/{id}][%d] updateDomainLicensingInfoConflict %+v", 409, o.Payload) +} + +func (o *UpdateDomainLicensingInfoConflict) String() string { + return fmt.Sprintf("[PUT /v1/licensing-info/domains/{id}][%d] updateDomainLicensingInfoConflict %+v", 409, o.Payload) +} + +func (o *UpdateDomainLicensingInfoConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateDomainLicensingInfoConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateDomainLicensingInfoInternalServerError creates a UpdateDomainLicensingInfoInternalServerError with default headers values +func NewUpdateDomainLicensingInfoInternalServerError() *UpdateDomainLicensingInfoInternalServerError { + return &UpdateDomainLicensingInfoInternalServerError{} +} + +/* +UpdateDomainLicensingInfoInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type UpdateDomainLicensingInfoInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this update domain licensing info internal server error response has a 2xx status code +func (o *UpdateDomainLicensingInfoInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update domain licensing info internal server error response has a 3xx status code +func (o *UpdateDomainLicensingInfoInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update domain licensing info internal server error response has a 4xx status code +func (o *UpdateDomainLicensingInfoInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update domain licensing info internal server error response has a 5xx status code +func (o *UpdateDomainLicensingInfoInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update domain licensing info internal server error response a status code equal to that given +func (o *UpdateDomainLicensingInfoInternalServerError) IsCode(code int) bool { + return code == 500 +} + +func (o *UpdateDomainLicensingInfoInternalServerError) Error() string { + return fmt.Sprintf("[PUT /v1/licensing-info/domains/{id}][%d] updateDomainLicensingInfoInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateDomainLicensingInfoInternalServerError) String() string { + return fmt.Sprintf("[PUT /v1/licensing-info/domains/{id}][%d] updateDomainLicensingInfoInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateDomainLicensingInfoInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateDomainLicensingInfoInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/license_keys/update_system_licensing_info_parameters.go b/client/license_keys/update_system_licensing_info_parameters.go new file mode 100644 index 0000000..2d160f0 --- /dev/null +++ b/client/license_keys/update_system_licensing_info_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package license_keys + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// NewUpdateSystemLicensingInfoParams creates a new UpdateSystemLicensingInfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateSystemLicensingInfoParams() *UpdateSystemLicensingInfoParams { + return &UpdateSystemLicensingInfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSystemLicensingInfoParamsWithTimeout creates a new UpdateSystemLicensingInfoParams object +// with the ability to set a timeout on a request. +func NewUpdateSystemLicensingInfoParamsWithTimeout(timeout time.Duration) *UpdateSystemLicensingInfoParams { + return &UpdateSystemLicensingInfoParams{ + timeout: timeout, + } +} + +// NewUpdateSystemLicensingInfoParamsWithContext creates a new UpdateSystemLicensingInfoParams object +// with the ability to set a context for a request. +func NewUpdateSystemLicensingInfoParamsWithContext(ctx context.Context) *UpdateSystemLicensingInfoParams { + return &UpdateSystemLicensingInfoParams{ + Context: ctx, + } +} + +// NewUpdateSystemLicensingInfoParamsWithHTTPClient creates a new UpdateSystemLicensingInfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateSystemLicensingInfoParamsWithHTTPClient(client *http.Client) *UpdateSystemLicensingInfoParams { + return &UpdateSystemLicensingInfoParams{ + HTTPClient: client, + } +} + +/* +UpdateSystemLicensingInfoParams contains all the parameters to send to the API endpoint + + for the update system licensing info operation. + + Typically these are written to a http.Request. +*/ +type UpdateSystemLicensingInfoParams struct { + + /* LicensingInfoSpec. + + License information spec + */ + LicensingInfoSpec *models.LicensingInfoSpec + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update system licensing info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSystemLicensingInfoParams) WithDefaults() *UpdateSystemLicensingInfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update system licensing info params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSystemLicensingInfoParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update system licensing info params +func (o *UpdateSystemLicensingInfoParams) WithTimeout(timeout time.Duration) *UpdateSystemLicensingInfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update system licensing info params +func (o *UpdateSystemLicensingInfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update system licensing info params +func (o *UpdateSystemLicensingInfoParams) WithContext(ctx context.Context) *UpdateSystemLicensingInfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update system licensing info params +func (o *UpdateSystemLicensingInfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update system licensing info params +func (o *UpdateSystemLicensingInfoParams) WithHTTPClient(client *http.Client) *UpdateSystemLicensingInfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update system licensing info params +func (o *UpdateSystemLicensingInfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLicensingInfoSpec adds the licensingInfoSpec to the update system licensing info params +func (o *UpdateSystemLicensingInfoParams) WithLicensingInfoSpec(licensingInfoSpec *models.LicensingInfoSpec) *UpdateSystemLicensingInfoParams { + o.SetLicensingInfoSpec(licensingInfoSpec) + return o +} + +// SetLicensingInfoSpec adds the licensingInfoSpec to the update system licensing info params +func (o *UpdateSystemLicensingInfoParams) SetLicensingInfoSpec(licensingInfoSpec *models.LicensingInfoSpec) { + o.LicensingInfoSpec = licensingInfoSpec +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSystemLicensingInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.LicensingInfoSpec != nil { + if err := r.SetBodyParam(o.LicensingInfoSpec); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/license_keys/update_system_licensing_info_responses.go b/client/license_keys/update_system_licensing_info_responses.go new file mode 100644 index 0000000..5113bb3 --- /dev/null +++ b/client/license_keys/update_system_licensing_info_responses.go @@ -0,0 +1,353 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package license_keys + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// UpdateSystemLicensingInfoReader is a Reader for the UpdateSystemLicensingInfo structure. +type UpdateSystemLicensingInfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSystemLicensingInfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSystemLicensingInfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 202: + result := NewUpdateSystemLicensingInfoAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateSystemLicensingInfoBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdateSystemLicensingInfoConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateSystemLicensingInfoInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewUpdateSystemLicensingInfoOK creates a UpdateSystemLicensingInfoOK with default headers values +func NewUpdateSystemLicensingInfoOK() *UpdateSystemLicensingInfoOK { + return &UpdateSystemLicensingInfoOK{} +} + +/* +UpdateSystemLicensingInfoOK describes a response with status code 200, with default header values. + +OK +*/ +type UpdateSystemLicensingInfoOK struct { +} + +// IsSuccess returns true when this update system licensing info o k response has a 2xx status code +func (o *UpdateSystemLicensingInfoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update system licensing info o k response has a 3xx status code +func (o *UpdateSystemLicensingInfoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update system licensing info o k response has a 4xx status code +func (o *UpdateSystemLicensingInfoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update system licensing info o k response has a 5xx status code +func (o *UpdateSystemLicensingInfoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update system licensing info o k response a status code equal to that given +func (o *UpdateSystemLicensingInfoOK) IsCode(code int) bool { + return code == 200 +} + +func (o *UpdateSystemLicensingInfoOK) Error() string { + return fmt.Sprintf("[PUT /v1/licensing-info/system][%d] updateSystemLicensingInfoOK ", 200) +} + +func (o *UpdateSystemLicensingInfoOK) String() string { + return fmt.Sprintf("[PUT /v1/licensing-info/system][%d] updateSystemLicensingInfoOK ", 200) +} + +func (o *UpdateSystemLicensingInfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateSystemLicensingInfoAccepted creates a UpdateSystemLicensingInfoAccepted with default headers values +func NewUpdateSystemLicensingInfoAccepted() *UpdateSystemLicensingInfoAccepted { + return &UpdateSystemLicensingInfoAccepted{} +} + +/* +UpdateSystemLicensingInfoAccepted describes a response with status code 202, with default header values. + +Accepted +*/ +type UpdateSystemLicensingInfoAccepted struct { +} + +// IsSuccess returns true when this update system licensing info accepted response has a 2xx status code +func (o *UpdateSystemLicensingInfoAccepted) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update system licensing info accepted response has a 3xx status code +func (o *UpdateSystemLicensingInfoAccepted) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update system licensing info accepted response has a 4xx status code +func (o *UpdateSystemLicensingInfoAccepted) IsClientError() bool { + return false +} + +// IsServerError returns true when this update system licensing info accepted response has a 5xx status code +func (o *UpdateSystemLicensingInfoAccepted) IsServerError() bool { + return false +} + +// IsCode returns true when this update system licensing info accepted response a status code equal to that given +func (o *UpdateSystemLicensingInfoAccepted) IsCode(code int) bool { + return code == 202 +} + +func (o *UpdateSystemLicensingInfoAccepted) Error() string { + return fmt.Sprintf("[PUT /v1/licensing-info/system][%d] updateSystemLicensingInfoAccepted ", 202) +} + +func (o *UpdateSystemLicensingInfoAccepted) String() string { + return fmt.Sprintf("[PUT /v1/licensing-info/system][%d] updateSystemLicensingInfoAccepted ", 202) +} + +func (o *UpdateSystemLicensingInfoAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateSystemLicensingInfoBadRequest creates a UpdateSystemLicensingInfoBadRequest with default headers values +func NewUpdateSystemLicensingInfoBadRequest() *UpdateSystemLicensingInfoBadRequest { + return &UpdateSystemLicensingInfoBadRequest{} +} + +/* +UpdateSystemLicensingInfoBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type UpdateSystemLicensingInfoBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this update system licensing info bad request response has a 2xx status code +func (o *UpdateSystemLicensingInfoBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update system licensing info bad request response has a 3xx status code +func (o *UpdateSystemLicensingInfoBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update system licensing info bad request response has a 4xx status code +func (o *UpdateSystemLicensingInfoBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update system licensing info bad request response has a 5xx status code +func (o *UpdateSystemLicensingInfoBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update system licensing info bad request response a status code equal to that given +func (o *UpdateSystemLicensingInfoBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *UpdateSystemLicensingInfoBadRequest) Error() string { + return fmt.Sprintf("[PUT /v1/licensing-info/system][%d] updateSystemLicensingInfoBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateSystemLicensingInfoBadRequest) String() string { + return fmt.Sprintf("[PUT /v1/licensing-info/system][%d] updateSystemLicensingInfoBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateSystemLicensingInfoBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateSystemLicensingInfoBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateSystemLicensingInfoConflict creates a UpdateSystemLicensingInfoConflict with default headers values +func NewUpdateSystemLicensingInfoConflict() *UpdateSystemLicensingInfoConflict { + return &UpdateSystemLicensingInfoConflict{} +} + +/* +UpdateSystemLicensingInfoConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type UpdateSystemLicensingInfoConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this update system licensing info conflict response has a 2xx status code +func (o *UpdateSystemLicensingInfoConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update system licensing info conflict response has a 3xx status code +func (o *UpdateSystemLicensingInfoConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update system licensing info conflict response has a 4xx status code +func (o *UpdateSystemLicensingInfoConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update system licensing info conflict response has a 5xx status code +func (o *UpdateSystemLicensingInfoConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update system licensing info conflict response a status code equal to that given +func (o *UpdateSystemLicensingInfoConflict) IsCode(code int) bool { + return code == 409 +} + +func (o *UpdateSystemLicensingInfoConflict) Error() string { + return fmt.Sprintf("[PUT /v1/licensing-info/system][%d] updateSystemLicensingInfoConflict %+v", 409, o.Payload) +} + +func (o *UpdateSystemLicensingInfoConflict) String() string { + return fmt.Sprintf("[PUT /v1/licensing-info/system][%d] updateSystemLicensingInfoConflict %+v", 409, o.Payload) +} + +func (o *UpdateSystemLicensingInfoConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateSystemLicensingInfoConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateSystemLicensingInfoInternalServerError creates a UpdateSystemLicensingInfoInternalServerError with default headers values +func NewUpdateSystemLicensingInfoInternalServerError() *UpdateSystemLicensingInfoInternalServerError { + return &UpdateSystemLicensingInfoInternalServerError{} +} + +/* +UpdateSystemLicensingInfoInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type UpdateSystemLicensingInfoInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this update system licensing info internal server error response has a 2xx status code +func (o *UpdateSystemLicensingInfoInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update system licensing info internal server error response has a 3xx status code +func (o *UpdateSystemLicensingInfoInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update system licensing info internal server error response has a 4xx status code +func (o *UpdateSystemLicensingInfoInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update system licensing info internal server error response has a 5xx status code +func (o *UpdateSystemLicensingInfoInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update system licensing info internal server error response a status code equal to that given +func (o *UpdateSystemLicensingInfoInternalServerError) IsCode(code int) bool { + return code == 500 +} + +func (o *UpdateSystemLicensingInfoInternalServerError) Error() string { + return fmt.Sprintf("[PUT /v1/licensing-info/system][%d] updateSystemLicensingInfoInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateSystemLicensingInfoInternalServerError) String() string { + return fmt.Sprintf("[PUT /v1/licensing-info/system][%d] updateSystemLicensingInfoInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateSystemLicensingInfoInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateSystemLicensingInfoInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/system/patch_system_parameters.go b/client/system/patch_system_parameters.go new file mode 100644 index 0000000..16e0bfc --- /dev/null +++ b/client/system/patch_system_parameters.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package system + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// NewPatchSystemParams creates a new PatchSystemParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPatchSystemParams() *PatchSystemParams { + return &PatchSystemParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPatchSystemParamsWithTimeout creates a new PatchSystemParams object +// with the ability to set a timeout on a request. +func NewPatchSystemParamsWithTimeout(timeout time.Duration) *PatchSystemParams { + return &PatchSystemParams{ + timeout: timeout, + } +} + +// NewPatchSystemParamsWithContext creates a new PatchSystemParams object +// with the ability to set a context for a request. +func NewPatchSystemParamsWithContext(ctx context.Context) *PatchSystemParams { + return &PatchSystemParams{ + Context: ctx, + } +} + +// NewPatchSystemParamsWithHTTPClient creates a new PatchSystemParams object +// with the ability to set a custom HTTPClient for a request. +func NewPatchSystemParamsWithHTTPClient(client *http.Client) *PatchSystemParams { + return &PatchSystemParams{ + HTTPClient: client, + } +} + +/* +PatchSystemParams contains all the parameters to send to the API endpoint + + for the patch system operation. + + Typically these are written to a http.Request. +*/ +type PatchSystemParams struct { + + /* UpdateSpec. + + updateSpec + */ + UpdateSpec *models.SystemUpdateSpec + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the patch system params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchSystemParams) WithDefaults() *PatchSystemParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the patch system params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PatchSystemParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the patch system params +func (o *PatchSystemParams) WithTimeout(timeout time.Duration) *PatchSystemParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the patch system params +func (o *PatchSystemParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the patch system params +func (o *PatchSystemParams) WithContext(ctx context.Context) *PatchSystemParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the patch system params +func (o *PatchSystemParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the patch system params +func (o *PatchSystemParams) WithHTTPClient(client *http.Client) *PatchSystemParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the patch system params +func (o *PatchSystemParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithUpdateSpec adds the updateSpec to the patch system params +func (o *PatchSystemParams) WithUpdateSpec(updateSpec *models.SystemUpdateSpec) *PatchSystemParams { + o.SetUpdateSpec(updateSpec) + return o +} + +// SetUpdateSpec adds the updateSpec to the patch system params +func (o *PatchSystemParams) SetUpdateSpec(updateSpec *models.SystemUpdateSpec) { + o.UpdateSpec = updateSpec +} + +// WriteToRequest writes these params to a swagger request +func (o *PatchSystemParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.UpdateSpec != nil { + if err := r.SetBodyParam(o.UpdateSpec); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/system/patch_system_responses.go b/client/system/patch_system_responses.go new file mode 100644 index 0000000..61ff5f4 --- /dev/null +++ b/client/system/patch_system_responses.go @@ -0,0 +1,227 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package system + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// PatchSystemReader is a Reader for the PatchSystem structure. +type PatchSystemReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PatchSystemReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPatchSystemOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPatchSystemBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPatchSystemInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPatchSystemOK creates a PatchSystemOK with default headers values +func NewPatchSystemOK() *PatchSystemOK { + return &PatchSystemOK{} +} + +/* +PatchSystemOK describes a response with status code 200, with default header values. + +OK +*/ +type PatchSystemOK struct { +} + +// IsSuccess returns true when this patch system o k response has a 2xx status code +func (o *PatchSystemOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this patch system o k response has a 3xx status code +func (o *PatchSystemOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this patch system o k response has a 4xx status code +func (o *PatchSystemOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this patch system o k response has a 5xx status code +func (o *PatchSystemOK) IsServerError() bool { + return false +} + +// IsCode returns true when this patch system o k response a status code equal to that given +func (o *PatchSystemOK) IsCode(code int) bool { + return code == 200 +} + +func (o *PatchSystemOK) Error() string { + return fmt.Sprintf("[PATCH /v1/system][%d] patchSystemOK ", 200) +} + +func (o *PatchSystemOK) String() string { + return fmt.Sprintf("[PATCH /v1/system][%d] patchSystemOK ", 200) +} + +func (o *PatchSystemOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewPatchSystemBadRequest creates a PatchSystemBadRequest with default headers values +func NewPatchSystemBadRequest() *PatchSystemBadRequest { + return &PatchSystemBadRequest{} +} + +/* +PatchSystemBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PatchSystemBadRequest struct { + Payload *models.ErrorResponse +} + +// IsSuccess returns true when this patch system bad request response has a 2xx status code +func (o *PatchSystemBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this patch system bad request response has a 3xx status code +func (o *PatchSystemBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this patch system bad request response has a 4xx status code +func (o *PatchSystemBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this patch system bad request response has a 5xx status code +func (o *PatchSystemBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this patch system bad request response a status code equal to that given +func (o *PatchSystemBadRequest) IsCode(code int) bool { + return code == 400 +} + +func (o *PatchSystemBadRequest) Error() string { + return fmt.Sprintf("[PATCH /v1/system][%d] patchSystemBadRequest %+v", 400, o.Payload) +} + +func (o *PatchSystemBadRequest) String() string { + return fmt.Sprintf("[PATCH /v1/system][%d] patchSystemBadRequest %+v", 400, o.Payload) +} + +func (o *PatchSystemBadRequest) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *PatchSystemBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchSystemInternalServerError creates a PatchSystemInternalServerError with default headers values +func NewPatchSystemInternalServerError() *PatchSystemInternalServerError { + return &PatchSystemInternalServerError{} +} + +/* +PatchSystemInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PatchSystemInternalServerError struct { + Payload *models.ErrorResponse +} + +// IsSuccess returns true when this patch system internal server error response has a 2xx status code +func (o *PatchSystemInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this patch system internal server error response has a 3xx status code +func (o *PatchSystemInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this patch system internal server error response has a 4xx status code +func (o *PatchSystemInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this patch system internal server error response has a 5xx status code +func (o *PatchSystemInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this patch system internal server error response a status code equal to that given +func (o *PatchSystemInternalServerError) IsCode(code int) bool { + return code == 500 +} + +func (o *PatchSystemInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /v1/system][%d] patchSystemInternalServerError %+v", 500, o.Payload) +} + +func (o *PatchSystemInternalServerError) String() string { + return fmt.Sprintf("[PATCH /v1/system][%d] patchSystemInternalServerError %+v", 500, o.Payload) +} + +func (o *PatchSystemInternalServerError) GetPayload() *models.ErrorResponse { + return o.Payload +} + +func (o *PatchSystemInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/system/system_client.go b/client/system/system_client.go index f2b1eac..409ab13 100644 --- a/client/system/system_client.go +++ b/client/system/system_client.go @@ -51,6 +51,8 @@ type ClientService interface { GetValidationsOfNtpConfiguration(params *GetValidationsOfNtpConfigurationParams, opts ...ClientOption) (*GetValidationsOfNtpConfigurationOK, error) + PatchSystem(params *PatchSystemParams, opts ...ClientOption) (*PatchSystemOK, error) + ValidateDNSConfiguration(params *ValidateDNSConfigurationParams, opts ...ClientOption) (*ValidateDNSConfigurationOK, *ValidateDNSConfigurationAccepted, error) ValidateNtpConfiguration(params *ValidateNtpConfigurationParams, opts ...ClientOption) (*ValidateNtpConfigurationOK, *ValidateNtpConfigurationAccepted, error) @@ -404,6 +406,46 @@ func (a *Client) GetValidationsOfNtpConfiguration(params *GetValidationsOfNtpCon panic(msg) } +/* +PatchSystem updates system level configuration + +Update system level configuration +*/ +func (a *Client) PatchSystem(params *PatchSystemParams, opts ...ClientOption) (*PatchSystemOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPatchSystemParams() + } + op := &runtime.ClientOperation{ + ID: "patchSystem", + Method: "PATCH", + PathPattern: "/v1/system", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &PatchSystemReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PatchSystemOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for patchSystem: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* ValidateDNSConfiguration validates Dns configuration input spec and system health before DNS configuration */ diff --git a/client/trusted_certificates/delete_trusted_certificate_parameters.go b/client/trusted_certificates/delete_trusted_certificate_parameters.go new file mode 100644 index 0000000..aea6595 --- /dev/null +++ b/client/trusted_certificates/delete_trusted_certificate_parameters.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package trusted_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteTrustedCertificateParams creates a new DeleteTrustedCertificateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteTrustedCertificateParams() *DeleteTrustedCertificateParams { + return &DeleteTrustedCertificateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteTrustedCertificateParamsWithTimeout creates a new DeleteTrustedCertificateParams object +// with the ability to set a timeout on a request. +func NewDeleteTrustedCertificateParamsWithTimeout(timeout time.Duration) *DeleteTrustedCertificateParams { + return &DeleteTrustedCertificateParams{ + timeout: timeout, + } +} + +// NewDeleteTrustedCertificateParamsWithContext creates a new DeleteTrustedCertificateParams object +// with the ability to set a context for a request. +func NewDeleteTrustedCertificateParamsWithContext(ctx context.Context) *DeleteTrustedCertificateParams { + return &DeleteTrustedCertificateParams{ + Context: ctx, + } +} + +// NewDeleteTrustedCertificateParamsWithHTTPClient creates a new DeleteTrustedCertificateParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteTrustedCertificateParamsWithHTTPClient(client *http.Client) *DeleteTrustedCertificateParams { + return &DeleteTrustedCertificateParams{ + HTTPClient: client, + } +} + +/* +DeleteTrustedCertificateParams contains all the parameters to send to the API endpoint + + for the delete trusted certificate operation. + + Typically these are written to a http.Request. +*/ +type DeleteTrustedCertificateParams struct { + + /* Alias. + + Certificate Alias + */ + Alias string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete trusted certificate params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTrustedCertificateParams) WithDefaults() *DeleteTrustedCertificateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete trusted certificate params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteTrustedCertificateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete trusted certificate params +func (o *DeleteTrustedCertificateParams) WithTimeout(timeout time.Duration) *DeleteTrustedCertificateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete trusted certificate params +func (o *DeleteTrustedCertificateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete trusted certificate params +func (o *DeleteTrustedCertificateParams) WithContext(ctx context.Context) *DeleteTrustedCertificateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete trusted certificate params +func (o *DeleteTrustedCertificateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete trusted certificate params +func (o *DeleteTrustedCertificateParams) WithHTTPClient(client *http.Client) *DeleteTrustedCertificateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete trusted certificate params +func (o *DeleteTrustedCertificateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAlias adds the alias to the delete trusted certificate params +func (o *DeleteTrustedCertificateParams) WithAlias(alias string) *DeleteTrustedCertificateParams { + o.SetAlias(alias) + return o +} + +// SetAlias adds the alias to the delete trusted certificate params +func (o *DeleteTrustedCertificateParams) SetAlias(alias string) { + o.Alias = alias +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteTrustedCertificateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param alias + if err := r.SetPathParam("alias", o.Alias); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/trusted_certificates/delete_trusted_certificate_responses.go b/client/trusted_certificates/delete_trusted_certificate_responses.go new file mode 100644 index 0000000..8b4fa9b --- /dev/null +++ b/client/trusted_certificates/delete_trusted_certificate_responses.go @@ -0,0 +1,272 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package trusted_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// DeleteTrustedCertificateReader is a Reader for the DeleteTrustedCertificate structure. +type DeleteTrustedCertificateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteTrustedCertificateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteTrustedCertificateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewDeleteTrustedCertificateNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 404: + result := NewDeleteTrustedCertificateNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteTrustedCertificateInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewDeleteTrustedCertificateOK creates a DeleteTrustedCertificateOK with default headers values +func NewDeleteTrustedCertificateOK() *DeleteTrustedCertificateOK { + return &DeleteTrustedCertificateOK{} +} + +/* +DeleteTrustedCertificateOK describes a response with status code 200, with default header values. + +OK +*/ +type DeleteTrustedCertificateOK struct { +} + +// IsSuccess returns true when this delete trusted certificate o k response has a 2xx status code +func (o *DeleteTrustedCertificateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete trusted certificate o k response has a 3xx status code +func (o *DeleteTrustedCertificateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete trusted certificate o k response has a 4xx status code +func (o *DeleteTrustedCertificateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete trusted certificate o k response has a 5xx status code +func (o *DeleteTrustedCertificateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete trusted certificate o k response a status code equal to that given +func (o *DeleteTrustedCertificateOK) IsCode(code int) bool { + return code == 200 +} + +func (o *DeleteTrustedCertificateOK) Error() string { + return fmt.Sprintf("[DELETE /v1/sddc-manager/trusted-certificates/{alias}][%d] deleteTrustedCertificateOK ", 200) +} + +func (o *DeleteTrustedCertificateOK) String() string { + return fmt.Sprintf("[DELETE /v1/sddc-manager/trusted-certificates/{alias}][%d] deleteTrustedCertificateOK ", 200) +} + +func (o *DeleteTrustedCertificateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteTrustedCertificateNoContent creates a DeleteTrustedCertificateNoContent with default headers values +func NewDeleteTrustedCertificateNoContent() *DeleteTrustedCertificateNoContent { + return &DeleteTrustedCertificateNoContent{} +} + +/* +DeleteTrustedCertificateNoContent describes a response with status code 204, with default header values. + +No Content +*/ +type DeleteTrustedCertificateNoContent struct { +} + +// IsSuccess returns true when this delete trusted certificate no content response has a 2xx status code +func (o *DeleteTrustedCertificateNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete trusted certificate no content response has a 3xx status code +func (o *DeleteTrustedCertificateNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete trusted certificate no content response has a 4xx status code +func (o *DeleteTrustedCertificateNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete trusted certificate no content response has a 5xx status code +func (o *DeleteTrustedCertificateNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete trusted certificate no content response a status code equal to that given +func (o *DeleteTrustedCertificateNoContent) IsCode(code int) bool { + return code == 204 +} + +func (o *DeleteTrustedCertificateNoContent) Error() string { + return fmt.Sprintf("[DELETE /v1/sddc-manager/trusted-certificates/{alias}][%d] deleteTrustedCertificateNoContent ", 204) +} + +func (o *DeleteTrustedCertificateNoContent) String() string { + return fmt.Sprintf("[DELETE /v1/sddc-manager/trusted-certificates/{alias}][%d] deleteTrustedCertificateNoContent ", 204) +} + +func (o *DeleteTrustedCertificateNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteTrustedCertificateNotFound creates a DeleteTrustedCertificateNotFound with default headers values +func NewDeleteTrustedCertificateNotFound() *DeleteTrustedCertificateNotFound { + return &DeleteTrustedCertificateNotFound{} +} + +/* +DeleteTrustedCertificateNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type DeleteTrustedCertificateNotFound struct { +} + +// IsSuccess returns true when this delete trusted certificate not found response has a 2xx status code +func (o *DeleteTrustedCertificateNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete trusted certificate not found response has a 3xx status code +func (o *DeleteTrustedCertificateNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete trusted certificate not found response has a 4xx status code +func (o *DeleteTrustedCertificateNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete trusted certificate not found response has a 5xx status code +func (o *DeleteTrustedCertificateNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this delete trusted certificate not found response a status code equal to that given +func (o *DeleteTrustedCertificateNotFound) IsCode(code int) bool { + return code == 404 +} + +func (o *DeleteTrustedCertificateNotFound) Error() string { + return fmt.Sprintf("[DELETE /v1/sddc-manager/trusted-certificates/{alias}][%d] deleteTrustedCertificateNotFound ", 404) +} + +func (o *DeleteTrustedCertificateNotFound) String() string { + return fmt.Sprintf("[DELETE /v1/sddc-manager/trusted-certificates/{alias}][%d] deleteTrustedCertificateNotFound ", 404) +} + +func (o *DeleteTrustedCertificateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteTrustedCertificateInternalServerError creates a DeleteTrustedCertificateInternalServerError with default headers values +func NewDeleteTrustedCertificateInternalServerError() *DeleteTrustedCertificateInternalServerError { + return &DeleteTrustedCertificateInternalServerError{} +} + +/* +DeleteTrustedCertificateInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type DeleteTrustedCertificateInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this delete trusted certificate internal server error response has a 2xx status code +func (o *DeleteTrustedCertificateInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete trusted certificate internal server error response has a 3xx status code +func (o *DeleteTrustedCertificateInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete trusted certificate internal server error response has a 4xx status code +func (o *DeleteTrustedCertificateInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete trusted certificate internal server error response has a 5xx status code +func (o *DeleteTrustedCertificateInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this delete trusted certificate internal server error response a status code equal to that given +func (o *DeleteTrustedCertificateInternalServerError) IsCode(code int) bool { + return code == 500 +} + +func (o *DeleteTrustedCertificateInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /v1/sddc-manager/trusted-certificates/{alias}][%d] deleteTrustedCertificateInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteTrustedCertificateInternalServerError) String() string { + return fmt.Sprintf("[DELETE /v1/sddc-manager/trusted-certificates/{alias}][%d] deleteTrustedCertificateInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteTrustedCertificateInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *DeleteTrustedCertificateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/trusted_certificates/get_trusted_certificates_parameters.go b/client/trusted_certificates/get_trusted_certificates_parameters.go new file mode 100644 index 0000000..dd415f9 --- /dev/null +++ b/client/trusted_certificates/get_trusted_certificates_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package trusted_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetTrustedCertificatesParams creates a new GetTrustedCertificatesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetTrustedCertificatesParams() *GetTrustedCertificatesParams { + return &GetTrustedCertificatesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetTrustedCertificatesParamsWithTimeout creates a new GetTrustedCertificatesParams object +// with the ability to set a timeout on a request. +func NewGetTrustedCertificatesParamsWithTimeout(timeout time.Duration) *GetTrustedCertificatesParams { + return &GetTrustedCertificatesParams{ + timeout: timeout, + } +} + +// NewGetTrustedCertificatesParamsWithContext creates a new GetTrustedCertificatesParams object +// with the ability to set a context for a request. +func NewGetTrustedCertificatesParamsWithContext(ctx context.Context) *GetTrustedCertificatesParams { + return &GetTrustedCertificatesParams{ + Context: ctx, + } +} + +// NewGetTrustedCertificatesParamsWithHTTPClient creates a new GetTrustedCertificatesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetTrustedCertificatesParamsWithHTTPClient(client *http.Client) *GetTrustedCertificatesParams { + return &GetTrustedCertificatesParams{ + HTTPClient: client, + } +} + +/* +GetTrustedCertificatesParams contains all the parameters to send to the API endpoint + + for the get trusted certificates operation. + + Typically these are written to a http.Request. +*/ +type GetTrustedCertificatesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get trusted certificates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTrustedCertificatesParams) WithDefaults() *GetTrustedCertificatesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get trusted certificates params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetTrustedCertificatesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get trusted certificates params +func (o *GetTrustedCertificatesParams) WithTimeout(timeout time.Duration) *GetTrustedCertificatesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get trusted certificates params +func (o *GetTrustedCertificatesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get trusted certificates params +func (o *GetTrustedCertificatesParams) WithContext(ctx context.Context) *GetTrustedCertificatesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get trusted certificates params +func (o *GetTrustedCertificatesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get trusted certificates params +func (o *GetTrustedCertificatesParams) WithHTTPClient(client *http.Client) *GetTrustedCertificatesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get trusted certificates params +func (o *GetTrustedCertificatesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetTrustedCertificatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/client/trusted_certificates/get_trusted_certificates_responses.go b/client/trusted_certificates/get_trusted_certificates_responses.go new file mode 100644 index 0000000..eb70942 --- /dev/null +++ b/client/trusted_certificates/get_trusted_certificates_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package trusted_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/vmware/vcf-sdk-go/models" +) + +// GetTrustedCertificatesReader is a Reader for the GetTrustedCertificates structure. +type GetTrustedCertificatesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetTrustedCertificatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetTrustedCertificatesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 500: + result := NewGetTrustedCertificatesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetTrustedCertificatesOK creates a GetTrustedCertificatesOK with default headers values +func NewGetTrustedCertificatesOK() *GetTrustedCertificatesOK { + return &GetTrustedCertificatesOK{} +} + +/* +GetTrustedCertificatesOK describes a response with status code 200, with default header values. + +OK +*/ +type GetTrustedCertificatesOK struct { + Payload *models.PageOfTrustedCertificate +} + +// IsSuccess returns true when this get trusted certificates o k response has a 2xx status code +func (o *GetTrustedCertificatesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get trusted certificates o k response has a 3xx status code +func (o *GetTrustedCertificatesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get trusted certificates o k response has a 4xx status code +func (o *GetTrustedCertificatesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get trusted certificates o k response has a 5xx status code +func (o *GetTrustedCertificatesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get trusted certificates o k response a status code equal to that given +func (o *GetTrustedCertificatesOK) IsCode(code int) bool { + return code == 200 +} + +func (o *GetTrustedCertificatesOK) Error() string { + return fmt.Sprintf("[GET /v1/sddc-manager/trusted-certificates][%d] getTrustedCertificatesOK %+v", 200, o.Payload) +} + +func (o *GetTrustedCertificatesOK) String() string { + return fmt.Sprintf("[GET /v1/sddc-manager/trusted-certificates][%d] getTrustedCertificatesOK %+v", 200, o.Payload) +} + +func (o *GetTrustedCertificatesOK) GetPayload() *models.PageOfTrustedCertificate { + return o.Payload +} + +func (o *GetTrustedCertificatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PageOfTrustedCertificate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetTrustedCertificatesInternalServerError creates a GetTrustedCertificatesInternalServerError with default headers values +func NewGetTrustedCertificatesInternalServerError() *GetTrustedCertificatesInternalServerError { + return &GetTrustedCertificatesInternalServerError{} +} + +/* +GetTrustedCertificatesInternalServerError describes a response with status code 500, with default header values. + +Internal server error +*/ +type GetTrustedCertificatesInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this get trusted certificates internal server error response has a 2xx status code +func (o *GetTrustedCertificatesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get trusted certificates internal server error response has a 3xx status code +func (o *GetTrustedCertificatesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get trusted certificates internal server error response has a 4xx status code +func (o *GetTrustedCertificatesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get trusted certificates internal server error response has a 5xx status code +func (o *GetTrustedCertificatesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get trusted certificates internal server error response a status code equal to that given +func (o *GetTrustedCertificatesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +func (o *GetTrustedCertificatesInternalServerError) Error() string { + return fmt.Sprintf("[GET /v1/sddc-manager/trusted-certificates][%d] getTrustedCertificatesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTrustedCertificatesInternalServerError) String() string { + return fmt.Sprintf("[GET /v1/sddc-manager/trusted-certificates][%d] getTrustedCertificatesInternalServerError %+v", 500, o.Payload) +} + +func (o *GetTrustedCertificatesInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetTrustedCertificatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/client/trusted_certificates/trusted_certificates_client.go b/client/trusted_certificates/trusted_certificates_client.go index de97c0d..e6adce7 100644 --- a/client/trusted_certificates/trusted_certificates_client.go +++ b/client/trusted_certificates/trusted_certificates_client.go @@ -35,13 +35,17 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { AddTrustedCertificate(params *AddTrustedCertificateParams, opts ...ClientOption) (*AddTrustedCertificateOK, error) + DeleteTrustedCertificate(params *DeleteTrustedCertificateParams, opts ...ClientOption) (*DeleteTrustedCertificateOK, *DeleteTrustedCertificateNoContent, error) + + GetTrustedCertificates(params *GetTrustedCertificatesParams, opts ...ClientOption) (*GetTrustedCertificatesOK, error) + SetTransport(transport runtime.ClientTransport) } /* -AddTrustedCertificate adds trusted certificate to the SDDC manager +AddTrustedCertificate adds a trusted certificate to the SDDC manager -Add trusted certificate to the SDDC manager +Add a trusted certificate to the SDDC Manager */ func (a *Client) AddTrustedCertificate(params *AddTrustedCertificateParams, opts ...ClientOption) (*AddTrustedCertificateOK, error) { // TODO: Validate the params before sending @@ -78,6 +82,87 @@ func (a *Client) AddTrustedCertificate(params *AddTrustedCertificateParams, opts panic(msg) } +/* +DeleteTrustedCertificate deletes a trusted certificate from the SDDC manager + +Delete a trusted certificate from the SDDC Manager. Restart the services to reflect the changes. +*/ +func (a *Client) DeleteTrustedCertificate(params *DeleteTrustedCertificateParams, opts ...ClientOption) (*DeleteTrustedCertificateOK, *DeleteTrustedCertificateNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteTrustedCertificateParams() + } + op := &runtime.ClientOperation{ + ID: "deleteTrustedCertificate", + Method: "DELETE", + PathPattern: "/v1/sddc-manager/trusted-certificates/{alias}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteTrustedCertificateReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *DeleteTrustedCertificateOK: + return value, nil, nil + case *DeleteTrustedCertificateNoContent: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for trusted_certificates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetTrustedCertificates gets the trusted certificates from the SDDC manager + +Get the trusted certificates from the SDDC Manager +*/ +func (a *Client) GetTrustedCertificates(params *GetTrustedCertificatesParams, opts ...ClientOption) (*GetTrustedCertificatesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetTrustedCertificatesParams() + } + op := &runtime.ClientOperation{ + ID: "getTrustedCertificates", + Method: "GET", + PathPattern: "/v1/sddc-manager/trusted-certificates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetTrustedCertificatesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetTrustedCertificatesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getTrustedCertificates: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/client/vcf_client.go b/client/vcf_client.go index fcef9c9..e4da9f5 100644 --- a/client/vcf_client.go +++ b/client/vcf_client.go @@ -27,12 +27,12 @@ import ( "github.com/vmware/vcf-sdk-go/client/identity_providers" "github.com/vmware/vcf-sdk-go/client/license_keys" "github.com/vmware/vcf-sdk-go/client/manifests" - "github.com/vmware/vcf-sdk-go/client/nsxt_clusters" "github.com/vmware/vcf-sdk-go/client/network_pools" + "github.com/vmware/vcf-sdk-go/client/nsxt_clusters" "github.com/vmware/vcf-sdk-go/client/nsxt_edge_clusters" - "github.com/vmware/vcf-sdk-go/client/pscs" "github.com/vmware/vcf-sdk-go/client/personalities" "github.com/vmware/vcf-sdk-go/client/proxy_configuration" + "github.com/vmware/vcf-sdk-go/client/pscs" "github.com/vmware/vcf-sdk-go/client/releases" "github.com/vmware/vcf-sdk-go/client/resource_functionalities" "github.com/vmware/vcf-sdk-go/client/resource_warnings" @@ -47,14 +47,14 @@ import ( "github.com/vmware/vcf-sdk-go/client/upgradables" "github.com/vmware/vcf-sdk-go/client/upgrades" "github.com/vmware/vcf-sdk-go/client/users" - "github.com/vmware/vcf-sdk-go/client/vcenters" - "github.com/vmware/vcf-sdk-go/client/vrli" - "github.com/vmware/vcf-sdk-go/client/vrops" - "github.com/vmware/vcf-sdk-go/client/vrslcm" "github.com/vmware/vcf-sdk-go/client/vasa_providers" + "github.com/vmware/vcf-sdk-go/client/vcenters" "github.com/vmware/vcf-sdk-go/client/vcf_services" "github.com/vmware/vcf-sdk-go/client/version_aliases_for_bundle_component_type" "github.com/vmware/vcf-sdk-go/client/vra" + "github.com/vmware/vcf-sdk-go/client/vrli" + "github.com/vmware/vcf-sdk-go/client/vrops" + "github.com/vmware/vcf-sdk-go/client/vrslcm" "github.com/vmware/vcf-sdk-go/client/vsan_health_check" "github.com/vmware/vcf-sdk-go/client/wsa" ) @@ -136,14 +136,14 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *VcfClient cli.Upgrades = upgrades.New(transport, formats) cli.Users = users.New(transport, formats) cli.VCenters = vcenters.New(transport, formats) + cli.VRA = vra.New(transport, formats) cli.Vrli = vrli.New(transport, formats) cli.VroPs = vrops.New(transport, formats) cli.VRSLCM = vrslcm.New(transport, formats) + cli.VSANHealthCheck = vsan_health_check.New(transport, formats) cli.VasaProviders = vasa_providers.New(transport, formats) cli.VcfServices = vcf_services.New(transport, formats) cli.VersionAliasesForBundleComponentType = version_aliases_for_bundle_component_type.New(transport, formats) - cli.VRA = vra.New(transport, formats) - cli.VSANHealthCheck = vsan_health_check.New(transport, formats) cli.WSA = wsa.New(transport, formats) return cli } @@ -259,22 +259,22 @@ type VcfClient struct { VCenters vcenters.ClientService + VRA vra.ClientService + Vrli vrli.ClientService VroPs vrops.ClientService VRSLCM vrslcm.ClientService + VSANHealthCheck vsan_health_check.ClientService + VasaProviders vasa_providers.ClientService VcfServices vcf_services.ClientService VersionAliasesForBundleComponentType version_aliases_for_bundle_component_type.ClientService - VRA vra.ClientService - - VSANHealthCheck vsan_health_check.ClientService - WSA wsa.ClientService Transport runtime.ClientTransport @@ -318,13 +318,13 @@ func (c *VcfClient) SetTransport(transport runtime.ClientTransport) { c.Upgrades.SetTransport(transport) c.Users.SetTransport(transport) c.VCenters.SetTransport(transport) + c.VRA.SetTransport(transport) c.Vrli.SetTransport(transport) c.VroPs.SetTransport(transport) c.VRSLCM.SetTransport(transport) + c.VSANHealthCheck.SetTransport(transport) c.VasaProviders.SetTransport(transport) c.VcfServices.SetTransport(transport) c.VersionAliasesForBundleComponentType.SetTransport(transport) - c.VRA.SetTransport(transport) - c.VSANHealthCheck.SetTransport(transport) c.WSA.SetTransport(transport) } diff --git a/client/vra/vra_client.go b/client/vra/vra_client.go index 12848b5..f0f9f6d 100644 --- a/client/vra/vra_client.go +++ b/client/vra/vra_client.go @@ -15,13 +15,13 @@ import ( "github.com/go-openapi/strfmt" ) -// New creates a new vra API client. +// New creates a new v r a API client. func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } /* -Client for vra API +Client for v r a API */ type Client struct { transport runtime.ClientTransport diff --git a/client/vsan_health_check/vsan_health_check_client.go b/client/vsan_health_check/vsan_health_check_client.go index d15fd30..2f00f27 100644 --- a/client/vsan_health_check/vsan_health_check_client.go +++ b/client/vsan_health_check/vsan_health_check_client.go @@ -15,13 +15,13 @@ import ( "github.com/go-openapi/strfmt" ) -// New creates a new vsan health check API client. +// New creates a new v san health check API client. func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } /* -Client for vsan health check API +Client for v san health check API */ type Client struct { transport runtime.ClientTransport diff --git a/models/certificate.go b/models/certificate.go index 991fd52..eb2024d 100644 --- a/models/certificate.go +++ b/models/certificate.go @@ -24,10 +24,10 @@ import ( type Certificate struct { // Certificate chain ordered from intermediate to root certificates - // Required: true CaChain []*Certificate `json:"caChain"` // Domain of the resource certificate + // Example: 3E86FBAD-8984-4D4B-992D-F0C49857572A // Required: true Domain *string `json:"domain"` @@ -37,43 +37,52 @@ type Certificate struct { ExpirationStatus *string `json:"expirationStatus"` // Error if certificate cannot be fetched + // Example: Status : NOT_TRUSTED, Message : Certificate Expired // Required: true GetCertificateError *string `json:"getCertificateError"` // Whether the certificate is installed or not + // Example: One among: true, false // Required: true IsInstalled *bool `json:"isInstalled"` // The certificate authority that issued the certificate + // Example: CN=OpenSSL CA, OU=VCF, O=VMware, L=Bengaluru, ST=Karnataka, C=IN // Required: true IssuedBy *string `json:"issuedBy"` // To whom the certificate is issued + // Example: sfo-vc01.rainpole.io // Required: true IssuedTo *string `json:"issuedTo"` - // The keysize of the certificate + // The key size of the certificate // Example: One among: 2048, 3072, 4096 // Required: true KeySize *string `json:"keySize"` // The timestamp after which certificate is not valid + // Example: 2021-02-02T00:00:00.000Z // Required: true NotAfter *string `json:"notAfter"` // The timestamp before which certificate is not valid + // Example: 2020-01-01T00:00:00.000Z // Required: true NotBefore *string `json:"notBefore"` // Number of days left for the certificate to expire + // Example: 398 // Required: true NumberOfDaysToExpire *int32 `json:"numberOfDaysToExpire"` // The PEM encoded certificate content + // Example: -----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE----- // Required: true PemEncoded *string `json:"pemEncoded"` // The public key of the certificate + // Example: D6:FD:DF:33:F1:... // Required: true PublicKey *string `json:"publicKey"` @@ -83,30 +92,37 @@ type Certificate struct { PublicKeyAlgorithm *string `json:"publicKeyAlgorithm"` // The serial number of the certificate + // Example: 46:85:19:77:36:12:67:26 // Required: true SerialNumber *string `json:"serialNumber"` // Algorithm used to sign the certificate + // Example: SHA256withRSA // Required: true SignatureAlgorithm *string `json:"signatureAlgorithm"` // Complete distinguished name to which the certificate is issued + // Example: CN=sfo-vc01.rainpole.io, OU=VCF, O=VMware, L=Bengaluru, ST=Karnataka, C=IN // Required: true Subject *string `json:"subject"` // The alternative names to which the certificate is issued + // Example: sfo-vc01.rainpole.io // Required: true SubjectAlternativeName []string `json:"subjectAlternativeName"` // Thumbprint generated using certificate content + // Example: 59:24:D5:18:04:A0:26:B0:A4:05:EA:82:60:95:82:A2:4B:F6:31:FB:81:93:01:F3:29:7D:34:9C:D3:05:39:90 // Required: true Thumbprint *string `json:"thumbprint"` // Algorithm used to generate thumbprint + // Example: SHA-256 // Required: true ThumbprintAlgorithm *string `json:"thumbprintAlgorithm"` // The X.509 version of the certificate + // Example: V3 // Required: true Version *string `json:"version"` } @@ -206,9 +222,8 @@ func (m *Certificate) Validate(formats strfmt.Registry) error { } func (m *Certificate) validateCaChain(formats strfmt.Registry) error { - - if err := validate.Required("caChain", "body", m.CaChain); err != nil { - return err + if swag.IsZero(m.CaChain) { // not required + return nil } for i := 0; i < len(m.CaChain); i++ { diff --git a/models/certificate_authority.go b/models/certificate_authority.go index 3baa262..1afc8e5 100644 --- a/models/certificate_authority.go +++ b/models/certificate_authority.go @@ -23,9 +23,11 @@ import ( type CertificateAuthority struct { // OpenSSL CA domain name + // Example: OpenSSL CA CommonName string `json:"commonName,omitempty"` // ISO 3166 country code where company is legally registered + // Example: IN Country string `json:"country,omitempty"` // CA type. Only supports Microsoft and OpenSSL CAs @@ -34,24 +36,31 @@ type CertificateAuthority struct { ID *string `json:"id"` // The city or locality where company is legally registered + // Example: Bengaluru Locality string `json:"locality,omitempty"` // The name under which company is legally registered + // Example: VMware Inc. Organization string `json:"organization,omitempty"` // Organization with which the certificate is associated + // Example: VCF OrganizationUnit string `json:"organizationUnit,omitempty"` // Microsoft CA server url + // Example: https://sfo-ad.rainpole.io/certsrv ServerURL string `json:"serverUrl,omitempty"` // The full name of the state where company is legally registered + // Example: Karnataka State string `json:"state,omitempty"` // Microsoft CA server template name + // Example: WebServer TemplateName string `json:"templateName,omitempty"` // Microsoft CA server username + // Example: Administrator Username string `json:"username,omitempty"` } diff --git a/models/certificate_authority_creation_spec.go b/models/certificate_authority_creation_spec.go index 5b2384c..966740a 100644 --- a/models/certificate_authority_creation_spec.go +++ b/models/certificate_authority_creation_spec.go @@ -16,7 +16,7 @@ import ( "github.com/go-openapi/swag" ) -// CertificateAuthorityCreationSpec This specification contains Certificate Authority (CA) creation details +// CertificateAuthorityCreationSpec This specification contains Certificate Authority (CA) creation details. Either openSSLCertificateAuthoritySpec or microsoftCertificateAuthoritySpec should be specified. // // swagger:model CertificateAuthorityCreationSpec type CertificateAuthorityCreationSpec struct { diff --git a/models/certificate_validation.go b/models/certificate_validation.go new file mode 100644 index 0000000..9c1c132 --- /dev/null +++ b/models/certificate_validation.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CertificateValidation The Certificate Validation details. +// +// swagger:model CertificateValidation +type CertificateValidation struct { + + // End Timestamp + // Example: 2021-02-02T00:00:00.000Z + EndTimestamp string `json:"endTimestamp,omitempty"` + + // Resource FQDN + // Example: sfo-vc01.rainpole.io + // Required: true + ResourceFqdn *string `json:"resourceFqdn"` + + // Resource ID + // Example: BE8A5E04-92A0-43F6-A166-AA041F4327CC + // Required: true + ResourceID *string `json:"resourceId"` + + // Start Timestamp + // Example: 2020-01-01T00:00:00.000Z + // Required: true + StartTimestamp *string `json:"startTimestamp"` + + // Validation Message + // Example: Certificate Expired + ValidationMessage string `json:"validationMessage,omitempty"` + + // Validation Status + // Example: One among: INPROGRESS, SUCCESSFUL, FAILED + // Required: true + ValidationStatus *string `json:"validationStatus"` +} + +// Validate validates this certificate validation +func (m *CertificateValidation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResourceFqdn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResourceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartTimestamp(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValidationStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CertificateValidation) validateResourceFqdn(formats strfmt.Registry) error { + + if err := validate.Required("resourceFqdn", "body", m.ResourceFqdn); err != nil { + return err + } + + return nil +} + +func (m *CertificateValidation) validateResourceID(formats strfmt.Registry) error { + + if err := validate.Required("resourceId", "body", m.ResourceID); err != nil { + return err + } + + return nil +} + +func (m *CertificateValidation) validateStartTimestamp(formats strfmt.Registry) error { + + if err := validate.Required("startTimestamp", "body", m.StartTimestamp); err != nil { + return err + } + + return nil +} + +func (m *CertificateValidation) validateValidationStatus(formats strfmt.Registry) error { + + if err := validate.Required("validationStatus", "body", m.ValidationStatus); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this certificate validation based on context it is used +func (m *CertificateValidation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CertificateValidation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CertificateValidation) UnmarshalBinary(b []byte) error { + var res CertificateValidation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/certificate_validation_task.go b/models/certificate_validation_task.go new file mode 100644 index 0000000..d2d118c --- /dev/null +++ b/models/certificate_validation_task.go @@ -0,0 +1,166 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CertificateValidationTask The Certificate Validation Task. +// +// swagger:model CertificateValidationTask +type CertificateValidationTask struct { + + // Validation Task Completed + // Example: One among: true, false + // Required: true + Completed *bool `json:"completed"` + + // Validation Task End Time + // Example: 2021-02-02T00:00:00.000Z + EndTimestamp string `json:"endTimestamp,omitempty"` + + // Validation Task Start Time + // Example: 2021-02-02T00:00:00.000Z + StartTimestamp string `json:"startTimestamp,omitempty"` + + // Validation ID + // Example: B1930850-7D1A-4BAA-89D7-52FD5DAD196A + // Required: true + ValidationID *string `json:"validationId"` + + // Resource Certificate Validations + // Required: true + Validations []*CertificateValidation `json:"validations"` +} + +// Validate validates this certificate validation task +func (m *CertificateValidationTask) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCompleted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValidationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValidations(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CertificateValidationTask) validateCompleted(formats strfmt.Registry) error { + + if err := validate.Required("completed", "body", m.Completed); err != nil { + return err + } + + return nil +} + +func (m *CertificateValidationTask) validateValidationID(formats strfmt.Registry) error { + + if err := validate.Required("validationId", "body", m.ValidationID); err != nil { + return err + } + + return nil +} + +func (m *CertificateValidationTask) validateValidations(formats strfmt.Registry) error { + + if err := validate.Required("validations", "body", m.Validations); err != nil { + return err + } + + for i := 0; i < len(m.Validations); i++ { + if swag.IsZero(m.Validations[i]) { // not required + continue + } + + if m.Validations[i] != nil { + if err := m.Validations[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("validations" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("validations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this certificate validation task based on the context it is used +func (m *CertificateValidationTask) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateValidations(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CertificateValidationTask) contextValidateValidations(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Validations); i++ { + + if m.Validations[i] != nil { + if err := m.Validations[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("validations" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("validations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CertificateValidationTask) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CertificateValidationTask) UnmarshalBinary(b []byte) error { + var res CertificateValidationTask + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/csr.go b/models/csr.go index 6bad5a4..b64d993 100644 --- a/models/csr.go +++ b/models/csr.go @@ -22,7 +22,13 @@ import ( // swagger:model Csr type CSR struct { + // The CSR decoded content + // Example: DECODED CSR AS STRING + // Required: true + CSRDecodedContent *string `json:"csrDecodedContent"` + // The CSR encoded content + // Example: -----BEGIN CERTIFICATE REQUEST-----\nMIIEH...\n-----END CERTIFICATE REQUEST----- // Required: true CSREncodedContent *string `json:"csrEncodedContent"` @@ -35,6 +41,10 @@ type CSR struct { func (m *CSR) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCSRDecodedContent(formats); err != nil { + res = append(res, err) + } + if err := m.validateCSREncodedContent(formats); err != nil { res = append(res, err) } @@ -49,6 +59,15 @@ func (m *CSR) Validate(formats strfmt.Registry) error { return nil } +func (m *CSR) validateCSRDecodedContent(formats strfmt.Registry) error { + + if err := validate.Required("csrDecodedContent", "body", m.CSRDecodedContent); err != nil { + return err + } + + return nil +} + func (m *CSR) validateCSREncodedContent(formats strfmt.Registry) error { if err := validate.Required("csrEncodedContent", "body", m.CSREncodedContent); err != nil { diff --git a/models/csr_generation_spec.go b/models/csr_generation_spec.go index 4d292dc..280766a 100644 --- a/models/csr_generation_spec.go +++ b/models/csr_generation_spec.go @@ -23,10 +23,12 @@ import ( type CSRGenerationSpec struct { // ISO 3166 country code where company is legally registered + // Example: IN // Required: true Country *string `json:"country"` // Contact email address + // Example: admin@vmware.com Email string `json:"email,omitempty"` // The public key algorithm of the certificate @@ -40,18 +42,22 @@ type CSRGenerationSpec struct { KeySize *string `json:"keySize"` // The city or locality where company is legally registered + // Example: Bengaluru // Required: true Locality *string `json:"locality"` // The name under which company is legally registered + // Example: VMware Inc. // Required: true Organization *string `json:"organization"` // Organization with which the certificate is associated + // Example: VCF // Required: true OrganizationUnit *string `json:"organizationUnit"` // The full name of the state where company is legally registered + // Example: Karnataka // Required: true State *string `json:"state"` } diff --git a/models/domain.go b/models/domain.go index 91dc82c..510779d 100644 --- a/models/domain.go +++ b/models/domain.go @@ -34,6 +34,9 @@ type Domain struct { // Shows whether the workload domain is joined to the Management domain SSO IsManagementSSODomain bool `json:"isManagementSsoDomain,omitempty"` + // Licensing information of the workload domain + LicensingInfo *LicensingInfoReference `json:"licensingInfo,omitempty"` + // Name of the workload domain Name string `json:"name,omitempty"` @@ -71,6 +74,10 @@ func (m *Domain) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLicensingInfo(formats); err != nil { + res = append(res, err) + } + if err := m.validateNSXTCluster(formats); err != nil { res = append(res, err) } @@ -134,6 +141,25 @@ func (m *Domain) validateClusters(formats strfmt.Registry) error { return nil } +func (m *Domain) validateLicensingInfo(formats strfmt.Registry) error { + if swag.IsZero(m.LicensingInfo) { // not required + return nil + } + + if m.LicensingInfo != nil { + if err := m.LicensingInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("licensingInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("licensingInfo") + } + return err + } + } + + return nil +} + func (m *Domain) validateNSXTCluster(formats strfmt.Registry) error { if swag.IsZero(m.NSXTCluster) { // not required return nil @@ -217,6 +243,10 @@ func (m *Domain) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } + if err := m.contextValidateLicensingInfo(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateNSXTCluster(ctx, formats); err != nil { res = append(res, err) } @@ -271,6 +301,22 @@ func (m *Domain) contextValidateClusters(ctx context.Context, formats strfmt.Reg return nil } +func (m *Domain) contextValidateLicensingInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.LicensingInfo != nil { + if err := m.LicensingInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("licensingInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("licensingInfo") + } + return err + } + } + + return nil +} + func (m *Domain) contextValidateNSXTCluster(ctx context.Context, formats strfmt.Registry) error { if m.NSXTCluster != nil { diff --git a/models/domain_future_release.go b/models/domain_future_release.go index 90078b3..fafeb8e 100644 --- a/models/domain_future_release.go +++ b/models/domain_future_release.go @@ -41,6 +41,15 @@ type DomainFutureRelease struct { // [Deprecated] Whether bundle is applicable or not. IsApplicable bool `json:"isApplicable,omitempty"` + // know issues of the release, used to display KB link for known issues of the release + KnownIssuesDescription string `json:"knownIssuesDescription,omitempty"` + + // know issues of the release, used to display description for known issues of the release + KnownIssuesURL string `json:"knownIssuesUrl,omitempty"` + + // Maximum compatible VCF version, used to represent compatibility of SDDC Manager and VMware BOM components + MaxCompatibleVcfVersion string `json:"maxCompatibleVcfVersion,omitempty"` + // Minimum compatible VCF version, used to represent compatibility of SDDC Manager and VMware BOM components // Required: true MinCompatibleVcfVersion *string `json:"minCompatibleVcfVersion"` diff --git a/models/edge_cluster_creation_spec.go b/models/edge_cluster_creation_spec.go index baf8d09..3807779 100644 --- a/models/edge_cluster_creation_spec.go +++ b/models/edge_cluster_creation_spec.go @@ -72,6 +72,9 @@ type EdgeClusterCreationSpec struct { // Required: true Mtu *int32 `json:"mtu"` + // Set to true to bypass normal ICMP-based check of Edge TEP / host TEP routability (default is false, meaning do check) + SkipTepRoutabilityCheck bool `json:"skipTepRoutabilityCheck,omitempty"` + // Name for the Tier-0 // Required: true Tier0Name *string `json:"tier0Name"` diff --git a/models/edge_cluster_expansion_spec.go b/models/edge_cluster_expansion_spec.go index 65f3400..7f4c6a8 100644 --- a/models/edge_cluster_expansion_spec.go +++ b/models/edge_cluster_expansion_spec.go @@ -42,6 +42,9 @@ type EdgeClusterExpansionSpec struct { // Required: true EdgeNodeSpecs []*NsxTEdgeNodeSpec `json:"edgeNodeSpecs"` + // Set to true to bypass normal ICMP-based check of Edge TEP / host TEP routability (default is false, meaning do check) + SkipTepRoutabilityCheck bool `json:"skipTepRoutabilityCheck,omitempty"` + // Select whether all Tier-1(s) being created per this spec are hosted on the Edge cluster or not (default is false, meaning hosted) Tier1Unhosted bool `json:"tier1Unhosted,omitempty"` } diff --git a/models/license_key.go b/models/license_key.go index dda448d..c794ffc 100644 --- a/models/license_key.go +++ b/models/license_key.go @@ -44,7 +44,7 @@ type LicenseKey struct { LicenseKeyValidity *LicenseKeyValidity `json:"licenseKeyValidity,omitempty"` // The type of the product to which the license key is applicable - // Example: One among: VCENTER, VSAN, SDDC_MANAGER, ESXI, NSXT, NSXIO, WCP, HORIZON_VIEW + // Example: One among: VCENTER, VSAN, ESXI, NSXT, NSXIO, WCP, HORIZON_VIEW // Required: true ProductType *string `json:"productType"` } diff --git a/models/licensing_info.go b/models/licensing_info.go index 9d3654e..5688d2d 100644 --- a/models/licensing_info.go +++ b/models/licensing_info.go @@ -32,7 +32,7 @@ type LicensingInfo struct { IsSubscribed bool `json:"isSubscribed,omitempty"` // Licensing mode - // Example: One among: SUBSCRIPTION, PERPETUAL + // Example: One among: SUBSCRIPTION, PERPETUAL, MIXED LicensingMode string `json:"licensingMode,omitempty"` // ID of the resource, need not be set for the resource of the type : SYSTEM diff --git a/models/licensing_info_reference.go b/models/licensing_info_reference.go new file mode 100644 index 0000000..396e57a --- /dev/null +++ b/models/licensing_info_reference.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// LicensingInfoReference Licensing information of the resource +// +// swagger:model LicensingInfoReference +type LicensingInfoReference struct { + + // Number of days remaining to subscribe + DaysRemainingToSubscribe int32 `json:"daysRemainingToSubscribe,omitempty"` + + // Flag indicating the resource is registered for subscription or not + IsRegistered bool `json:"isRegistered,omitempty"` + + // Flag indicating the resource is subscribed or not + IsSubscribed bool `json:"isSubscribed,omitempty"` + + // Licensing mode + // Example: One among: SUBSCRIPTION, PERPETUAL, MIXED + LicensingMode string `json:"licensingMode,omitempty"` + + // Status of the subscription mode + // Example: One among: UNSUBSCRIBED, ACTIVE, EXPIRED + SubscriptionStatus string `json:"subscriptionStatus,omitempty"` +} + +// Validate validates this licensing info reference +func (m *LicensingInfoReference) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this licensing info reference based on context it is used +func (m *LicensingInfoReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *LicensingInfoReference) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LicensingInfoReference) UnmarshalBinary(b []byte) error { + var res LicensingInfoReference + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/licensing_info_spec.go b/models/licensing_info_spec.go new file mode 100644 index 0000000..da3e5ff --- /dev/null +++ b/models/licensing_info_spec.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// LicensingInfoSpec Represents the licensing info spec +// +// swagger:model LicensingInfoSpec +type LicensingInfoSpec struct { + + // Licensing mode + // Example: One among: SUBSCRIPTION + // Required: true + LicensingMode *string `json:"licensingMode"` +} + +// Validate validates this licensing info spec +func (m *LicensingInfoSpec) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLicensingMode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LicensingInfoSpec) validateLicensingMode(formats strfmt.Registry) error { + + if err := validate.Required("licensingMode", "body", m.LicensingMode); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this licensing info spec based on context it is used +func (m *LicensingInfoSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *LicensingInfoSpec) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LicensingInfoSpec) UnmarshalBinary(b []byte) error { + var res LicensingInfoSpec + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/map_ofstring_and_list_of_vx_rail_custom_array_context.go b/models/map_ofstring_and_list_of_vx_rail_custom_array_context.go new file mode 100644 index 0000000..dd03419 --- /dev/null +++ b/models/map_ofstring_and_list_of_vx_rail_custom_array_context.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" +) + +// MapOfstringAndListOfVxRailCustomArrayContext map ofstring and list of vx rail custom array context +// +// swagger:model MapOfstringAndListOfVxRailCustomArrayContext +type MapOfstringAndListOfVxRailCustomArrayContext map[string]List + +// Validate validates this map ofstring and list of vx rail custom array context +func (m MapOfstringAndListOfVxRailCustomArrayContext) Validate(formats strfmt.Registry) error { + var res []error + + for k := range m { + + if err := m[k].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(k) + } + return err + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this map ofstring and list of vx rail custom array context based on the context it is used +func (m MapOfstringAndListOfVxRailCustomArrayContext) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for k := range m { + + if err := m[k].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(k) + } + return err + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/models/microsoft_certificate_authority_spec.go b/models/microsoft_certificate_authority_spec.go index 8ac1326..425a734 100644 --- a/models/microsoft_certificate_authority_spec.go +++ b/models/microsoft_certificate_authority_spec.go @@ -23,18 +23,22 @@ import ( type MicrosoftCertificateAuthoritySpec struct { // CA server password + // Example: ******** // Required: true Secret *string `json:"secret"` // CA server url + // Example: https://sfo-ad.rainpole.io/certsrv // Required: true ServerURL *string `json:"serverUrl"` // CA server template name + // Example: WebServer // Required: true TemplateName *string `json:"templateName"` // CA server username + // Example: Administrator // Required: true Username *string `json:"username"` } diff --git a/models/nsx_t_edge_node_spec.go b/models/nsx_t_edge_node_spec.go index 27c4643..217a56b 100644 --- a/models/nsx_t_edge_node_spec.go +++ b/models/nsx_t_edge_node_spec.go @@ -63,18 +63,12 @@ type NsxTEdgeNodeSpec struct { // Required: true ManagementIP *string `json:"managementIP"` - // Management Vlan Id - ManagementVlanID int32 `json:"managementVlanId,omitempty"` - // Second NSX enabled VDS uplink for the Edge node // Example: One among: uplink1, uplink2, uplink3, uplink4 SecondNsxVdsUplink string `json:"secondNsxVdsUplink,omitempty"` // Specifications of Tier0 uplinks for the Edge Node UplinkNetwork []*NsxTEdgeUplinkNetwork `json:"uplinkNetwork"` - - // VM Management Network Name - VMManagementNetworkName string `json:"vmManagementNetworkName,omitempty"` } // Validate validates this nsx t edge node spec diff --git a/models/open_ssl_certificate_authority_spec.go b/models/open_ssl_certificate_authority_spec.go index a92dab5..7b796cb 100644 --- a/models/open_ssl_certificate_authority_spec.go +++ b/models/open_ssl_certificate_authority_spec.go @@ -23,26 +23,32 @@ import ( type OpenSSLCertificateAuthoritySpec struct { // OpenSSL CA domain name + // Example: OpenSSL CA // Required: true CommonName *string `json:"commonName"` // ISO 3166 country code where company is legally registered + // Example: IN // Required: true Country *string `json:"country"` // The city or locality where company is legally registered + // Example: Bengaluru // Required: true Locality *string `json:"locality"` // The name under which company is legally registered + // Example: VMware Inc. // Required: true Organization *string `json:"organization"` // Organization with which the certificate is associated + // Example: VCF // Required: true OrganizationUnit *string `json:"organizationUnit"` // The full name of the state where company is legally registered + // Example: Karnataka // Required: true State *string `json:"state"` } diff --git a/models/page_of_trusted_certificate.go b/models/page_of_trusted_certificate.go new file mode 100644 index 0000000..ac87995 --- /dev/null +++ b/models/page_of_trusted_certificate.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PageOfTrustedCertificate Represents a page of elements of a single type +// +// swagger:model PageOfTrustedCertificate +type PageOfTrustedCertificate struct { + + // The list of elements included in this page + Elements []*TrustedCertificate `json:"elements"` + + // Pageable elements pagination metadata information + PageMetadata *PageMetadata `json:"pageMetadata,omitempty"` +} + +// Validate validates this page of trusted certificate +func (m *PageOfTrustedCertificate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateElements(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePageMetadata(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfTrustedCertificate) validateElements(formats strfmt.Registry) error { + if swag.IsZero(m.Elements) { // not required + return nil + } + + for i := 0; i < len(m.Elements); i++ { + if swag.IsZero(m.Elements[i]) { // not required + continue + } + + if m.Elements[i] != nil { + if err := m.Elements[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("elements" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("elements" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfTrustedCertificate) validatePageMetadata(formats strfmt.Registry) error { + if swag.IsZero(m.PageMetadata) { // not required + return nil + } + + if m.PageMetadata != nil { + if err := m.PageMetadata.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pageMetadata") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pageMetadata") + } + return err + } + } + + return nil +} + +// ContextValidate validate this page of trusted certificate based on the context it is used +func (m *PageOfTrustedCertificate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateElements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePageMetadata(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PageOfTrustedCertificate) contextValidateElements(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Elements); i++ { + + if m.Elements[i] != nil { + if err := m.Elements[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("elements" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("elements" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PageOfTrustedCertificate) contextValidatePageMetadata(ctx context.Context, formats strfmt.Registry) error { + + if m.PageMetadata != nil { + if err := m.PageMetadata.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pageMetadata") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pageMetadata") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PageOfTrustedCertificate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PageOfTrustedCertificate) UnmarshalBinary(b []byte) error { + var res PageOfTrustedCertificate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/release.go b/models/release.go index 90bc588..4e5a5a1 100644 --- a/models/release.go +++ b/models/release.go @@ -37,6 +37,15 @@ type Release struct { // [Deprecated] Whether bundle is applicable or not. IsApplicable bool `json:"isApplicable,omitempty"` + // know issues of the release, used to display KB link for known issues of the release + KnownIssuesDescription string `json:"knownIssuesDescription,omitempty"` + + // know issues of the release, used to display description for known issues of the release + KnownIssuesURL string `json:"knownIssuesUrl,omitempty"` + + // Maximum compatible VCF version, used to represent compatibility of SDDC Manager and VMware BOM components + MaxCompatibleVcfVersion string `json:"maxCompatibleVcfVersion,omitempty"` + // Minimum compatible VCF version, used to represent compatibility of SDDC Manager and VMware BOM components // Required: true MinCompatibleVcfVersion *string `json:"minCompatibleVcfVersion"` diff --git a/models/resource.go b/models/resource.go index 37cfa3a..7f48753 100644 --- a/models/resource.go +++ b/models/resource.go @@ -23,19 +23,23 @@ import ( type Resource struct { // Resource FQDN + // Example: sfo-vc01.rainpole.io Fqdn string `json:"fqdn,omitempty"` // Name of the resource Name string `json:"name,omitempty"` // Resource ID + // Example: BE8A5E04-92A0-43F6-A166-AA041F4327CC // Required: true ResourceID *string `json:"resourceId"` // Subject alternative name(s) + // Example: sfo-vc01.rainpole.io Sans []string `json:"sans"` // Resource type + // Example: One among: SDDC_MANAGER, PSC, VCENTER, NSX_MANAGER, NSXT_MANAGER, VRA, VRLI, VROPS, VRSLCM, VXRAIL_MANAGER // Required: true Type *string `json:"type"` } diff --git a/models/resource_certificate_spec.go b/models/resource_certificate_spec.go new file mode 100644 index 0000000..71f1f58 --- /dev/null +++ b/models/resource_certificate_spec.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ResourceCertificateSpec This specification contains resource certificate details. Either resourceId or resourceFqdn should be provided. Either certificateChain or both resourceCertificate and caCertificate should be provided. +// +// swagger:model ResourceCertificateSpec +type ResourceCertificateSpec struct { + + // CA Certificate + // Example: -----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE----- + CaCertificate string `json:"caCertificate,omitempty"` + + // Certificate Chain + // Example: -----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE----- + CertificateChain string `json:"certificateChain,omitempty"` + + // Resource Certificate + // Example: -----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE----- + ResourceCertificate string `json:"resourceCertificate,omitempty"` + + // Resource FQDN + // Example: sfo-vc01.rainpole.io + ResourceFqdn string `json:"resourceFqdn,omitempty"` + + // Resource ID + // Example: BE8A5E04-92A0-43F6-A166-AA041F4327CC + ResourceID string `json:"resourceId,omitempty"` +} + +// Validate validates this resource certificate spec +func (m *ResourceCertificateSpec) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this resource certificate spec based on context it is used +func (m *ResourceCertificateSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ResourceCertificateSpec) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResourceCertificateSpec) UnmarshalBinary(b []byte) error { + var res ResourceCertificateSpec + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/system_update_spec.go b/models/system_update_spec.go new file mode 100644 index 0000000..4ef85b6 --- /dev/null +++ b/models/system_update_spec.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SystemUpdateSpec Contains the parameters required to perform update operation on system +// +// swagger:model SystemUpdateSpec +type SystemUpdateSpec struct { + + // new limit of amount of domains in subscription mode + MaxAllowedDomainsInSubscription int32 `json:"maxAllowedDomainsInSubscription,omitempty"` +} + +// Validate validates this system update spec +func (m *SystemUpdateSpec) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this system update spec based on context it is used +func (m *SystemUpdateSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SystemUpdateSpec) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SystemUpdateSpec) UnmarshalBinary(b []byte) error { + var res SystemUpdateSpec + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/trusted_certificate.go b/models/trusted_certificate.go new file mode 100644 index 0000000..f91385e --- /dev/null +++ b/models/trusted_certificate.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TrustedCertificate The Trusted Certificate details. +// +// swagger:model TrustedCertificate +type TrustedCertificate struct { + + // Certificate alias + // Example: vcf_59:24:D5:18:04:A0:26:B0:A4:05:EA:82:60:95:82:A2:4B:F6:31:FB:81:93:01:F3:29:7D:34:9C:D3:05:39:90 + // Required: true + Alias *string `json:"alias"` + + // Certificate in PEM format + // Example: -----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE----- + // Required: true + Certificate *string `json:"certificate"` +} + +// Validate validates this trusted certificate +func (m *TrustedCertificate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAlias(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCertificate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TrustedCertificate) validateAlias(formats strfmt.Registry) error { + + if err := validate.Required("alias", "body", m.Alias); err != nil { + return err + } + + return nil +} + +func (m *TrustedCertificate) validateCertificate(formats strfmt.Registry) error { + + if err := validate.Required("certificate", "body", m.Certificate); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this trusted certificate based on context it is used +func (m *TrustedCertificate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TrustedCertificate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TrustedCertificate) UnmarshalBinary(b []byte) error { + var res TrustedCertificate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/trusted_certificate_spec.go b/models/trusted_certificate_spec.go index 63e7c1c..74afe98 100644 --- a/models/trusted_certificate_spec.go +++ b/models/trusted_certificate_spec.go @@ -22,7 +22,8 @@ import ( // swagger:model TrustedCertificateSpec type TrustedCertificateSpec struct { - // Certificate in one-line PEM format + // Certificate in PEM format + // Example: -----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE----- // Required: true Certificate *string `json:"certificate"` diff --git a/models/vx_rail_array_association_context.go b/models/vx_rail_array_association_context.go new file mode 100644 index 0000000..1258f45 --- /dev/null +++ b/models/vx_rail_array_association_context.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VxRailArrayAssociationContext Contains the mapping between custom attributes and the supported attributes on the array item object. +// +// swagger:model VxRailArrayAssociationContext +type VxRailArrayAssociationContext struct { + + // Key, Value map that holds the simple attributes on the array item that are currently supported. + ArrayAttributeIdsKeyValue map[string]string `json:"arrayAttributeIdsKeyValue,omitempty"` + + // Details that holds the association with the parent for nested objects + Parent *VxRailArrayAssociationContext `json:"parent,omitempty"` +} + +// Validate validates this vx rail array association context +func (m *VxRailArrayAssociationContext) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateParent(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VxRailArrayAssociationContext) validateParent(formats strfmt.Registry) error { + if swag.IsZero(m.Parent) { // not required + return nil + } + + if m.Parent != nil { + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +// ContextValidate validate this vx rail array association context based on the context it is used +func (m *VxRailArrayAssociationContext) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateParent(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VxRailArrayAssociationContext) contextValidateParent(ctx context.Context, formats strfmt.Registry) error { + + if m.Parent != nil { + if err := m.Parent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VxRailArrayAssociationContext) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VxRailArrayAssociationContext) UnmarshalBinary(b []byte) error { + var res VxRailArrayAssociationContext + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/vx_rail_custom_array_context.go b/models/vx_rail_custom_array_context.go new file mode 100644 index 0000000..eb658b5 --- /dev/null +++ b/models/vx_rail_custom_array_context.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2023 VMware, Inc. +// SPDX-License-Identifier: BSD-2-Clause + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VxRailCustomArrayContext Contains the details of simple/complex custom attribute on an array item object. +// +// swagger:model VxRailCustomArrayContext +type VxRailCustomArrayContext struct { + + // Details that holds the mapping between the custom attributes to the array item + ArrayAssociationContext *VxRailArrayAssociationContext `json:"arrayAssociationContext,omitempty"` + + // Collection of simple attributes that contains name, value and type for each attribute. + SimpleAttributes []*VxRailContext `json:"simpleAttributes"` +} + +// Validate validates this vx rail custom array context +func (m *VxRailCustomArrayContext) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateArrayAssociationContext(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSimpleAttributes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VxRailCustomArrayContext) validateArrayAssociationContext(formats strfmt.Registry) error { + if swag.IsZero(m.ArrayAssociationContext) { // not required + return nil + } + + if m.ArrayAssociationContext != nil { + if err := m.ArrayAssociationContext.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("arrayAssociationContext") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("arrayAssociationContext") + } + return err + } + } + + return nil +} + +func (m *VxRailCustomArrayContext) validateSimpleAttributes(formats strfmt.Registry) error { + if swag.IsZero(m.SimpleAttributes) { // not required + return nil + } + + for i := 0; i < len(m.SimpleAttributes); i++ { + if swag.IsZero(m.SimpleAttributes[i]) { // not required + continue + } + + if m.SimpleAttributes[i] != nil { + if err := m.SimpleAttributes[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("simpleAttributes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("simpleAttributes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this vx rail custom array context based on the context it is used +func (m *VxRailCustomArrayContext) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateArrayAssociationContext(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSimpleAttributes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VxRailCustomArrayContext) contextValidateArrayAssociationContext(ctx context.Context, formats strfmt.Registry) error { + + if m.ArrayAssociationContext != nil { + if err := m.ArrayAssociationContext.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("arrayAssociationContext") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("arrayAssociationContext") + } + return err + } + } + + return nil +} + +func (m *VxRailCustomArrayContext) contextValidateSimpleAttributes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.SimpleAttributes); i++ { + + if m.SimpleAttributes[i] != nil { + if err := m.SimpleAttributes[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("simpleAttributes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("simpleAttributes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VxRailCustomArrayContext) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VxRailCustomArrayContext) UnmarshalBinary(b []byte) error { + var res VxRailCustomArrayContext + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/vx_rail_details.go b/models/vx_rail_details.go index a2d2a3c..689b079 100644 --- a/models/vx_rail_details.go +++ b/models/vx_rail_details.go @@ -25,6 +25,9 @@ type VxRailDetails struct { // VxRail Manager admin credentials AdminCredentials *UnmanagedResourceCredential `json:"adminCredentials,omitempty"` + // Map of Context class with list of key and value pairs for array objects + ArrayContextWithKeyValuePair map[string]List `json:"arrayContextWithKeyValuePair,omitempty"` + // Map of Context class with list of key and value pairs ContextWithKeyValuePair map[string]List `json:"contextWithKeyValuePair,omitempty"` @@ -58,6 +61,10 @@ func (m *VxRailDetails) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateArrayContextWithKeyValuePair(formats); err != nil { + res = append(res, err) + } + if err := m.validateContextWithKeyValuePair(formats); err != nil { res = append(res, err) } @@ -95,6 +102,27 @@ func (m *VxRailDetails) validateAdminCredentials(formats strfmt.Registry) error return nil } +func (m *VxRailDetails) validateArrayContextWithKeyValuePair(formats strfmt.Registry) error { + if swag.IsZero(m.ArrayContextWithKeyValuePair) { // not required + return nil + } + + for k := range m.ArrayContextWithKeyValuePair { + + if err := m.ArrayContextWithKeyValuePair[k].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("arrayContextWithKeyValuePair" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("arrayContextWithKeyValuePair" + "." + k) + } + return err + } + + } + + return nil +} + func (m *VxRailDetails) validateContextWithKeyValuePair(formats strfmt.Registry) error { if swag.IsZero(m.ContextWithKeyValuePair) { // not required return nil @@ -169,6 +197,10 @@ func (m *VxRailDetails) ContextValidate(ctx context.Context, formats strfmt.Regi res = append(res, err) } + if err := m.contextValidateArrayContextWithKeyValuePair(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateContextWithKeyValuePair(ctx, formats); err != nil { res = append(res, err) } @@ -203,6 +235,24 @@ func (m *VxRailDetails) contextValidateAdminCredentials(ctx context.Context, for return nil } +func (m *VxRailDetails) contextValidateArrayContextWithKeyValuePair(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.ArrayContextWithKeyValuePair { + + if err := m.ArrayContextWithKeyValuePair[k].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("arrayContextWithKeyValuePair" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("arrayContextWithKeyValuePair" + "." + k) + } + return err + } + + } + + return nil +} + func (m *VxRailDetails) contextValidateContextWithKeyValuePair(ctx context.Context, formats strfmt.Registry) error { for k := range m.ContextWithKeyValuePair { diff --git a/scripts/fix_abbreviations.sh b/scripts/fix_abbreviations.sh index ecb8c16..90e274d 100755 --- a/scripts/fix_abbreviations.sh +++ b/scripts/fix_abbreviations.sh @@ -18,6 +18,8 @@ rename v_centers vcenters rename v_r_l_i vrli rename v_r_o_ps vrops rename v_r_s_l_c_m vrslcm +rename v_r_a vra +rename v_san_health_check vsan_health_check echo "Replace package names and occurrences of incorrect abbreviations with correct ones" find client -type f -name '*.go' -exec sed -i "" 's/a_v_ns/avns/g' {} + @@ -28,6 +30,8 @@ find client -type f -name '*.go' -exec sed -i "" 's/v_r_l_i/vrli/g' {} + find client -type f -name '*.go' -exec sed -i "" 's/v_centers/vcenters/g' {} + find client -type f -name '*.go' -exec sed -i "" 's/v_r_o_ps/vrops/g' {} + find client -type f -name '*.go' -exec sed -i "" 's/v_r_s_l_c_m/vrslcm/g' {} + +find client -type f -name '*.go' -exec sed -i "" 's/v_r_a/vra/g' {} + +find client -type f -name '*.go' -exec sed -i "" 's/v_san_health_check/vsan_health_check/g' {} + echo "Changing main client filename" mv client/vcf_client_client.go client/vcf_client.go diff --git a/swagger.json b/swagger.json index b145619..1b7eed8 100755 --- a/swagger.json +++ b/swagger.json @@ -2,7 +2,7 @@ "swagger" : "2.0", "info" : { "description" : "VMware Cloud Foundation is an integrated software stack that bundles the VMware virtualization and management components like compute virtualization (vSphere), storage virtualization (vSAN), network virtualization (NSX), and cloud management (vRealize Suite). VCF consists of Cloud Builder - that automates the bringup of the management infrastructure and SDDC Manager - that automates the workload domain management, lifecycle and operations. This API reference guide covers APIs of both Cloud Builder and SDDC Manager", - "version" : "4.5.0", + "version" : "4.5.2-vcf4520RELEASE", "title" : "VMware Cloud Foundation API Reference Guide", "termsOfService" : "http://www.vmware.com/", "contact" : { @@ -138,7 +138,7 @@ "name" : "SystemPrechecks", "description" : "APIs for managing System Prechecks" }, { - "name" : "VSANHealthCheck", + "name" : "vSANHealthCheck", "description" : "APIs for managing vSAN health checks" }, { "name" : "SDDC", @@ -147,7 +147,7 @@ "name" : "Identity Providers", "description" : "APIs for managing Identity Providers" }, { - "name" : "VRA", + "name" : "vRA", "description" : "APIs for managing vRealize Automation" } ], "schemes" : [ "https" ], @@ -709,7 +709,7 @@ } }, "204" : { - "description" : "No contet", + "description" : "No content", "schema" : { "type" : "object" } @@ -2944,7 +2944,7 @@ }, "/v1/domains/{domainId}/health-checks" : { "get" : { - "tags" : [ "VSANHealthCheck" ], + "tags" : [ "vSANHealthCheck" ], "summary" : "Get vSAN health check status", "description" : "Get vSAN health check status for all cluster on the domain", "operationId" : "getHealthCheckQuery", @@ -2991,7 +2991,7 @@ } }, "patch" : { - "tags" : [ "VSANHealthCheck" ], + "tags" : [ "vSANHealthCheck" ], "summary" : "Update vSAN health check status", "description" : "Update vSAN health check status for domain", "operationId" : "setHealthCheckStatus", @@ -3045,7 +3045,7 @@ }, "/v1/domains/{domainId}/health-checks/queries/{queryId}" : { "get" : { - "tags" : [ "VSANHealthCheck" ], + "tags" : [ "vSANHealthCheck" ], "summary" : "Get vSAN health check status by Query Id", "description" : "Get vSAN health check status for a given Query Id", "operationId" : "getHealthCheckStatus", @@ -3088,7 +3088,7 @@ }, "/v1/domains/{domainId}/health-checks/tasks/{taskId}" : { "get" : { - "tags" : [ "VSANHealthCheck" ], + "tags" : [ "vSANHealthCheck" ], "summary" : "Get vSAN health check update task status", "description" : "Get vSAN health check update task status for a given task Id", "operationId" : "getHealthCheckStatusTask", @@ -3140,7 +3140,7 @@ "parameters" : [ { "name" : "domainName", "in" : "path", - "description" : "The domain name", + "description" : "Domain ID or Name", "required" : true, "type" : "string" } ], @@ -3175,7 +3175,7 @@ "parameters" : [ { "name" : "domainName", "in" : "path", - "description" : "The domain name", + "description" : "Domain ID or Name", "required" : true, "type" : "string" }, { @@ -3236,7 +3236,7 @@ "parameters" : [ { "name" : "domainName", "in" : "path", - "description" : "The domain name", + "description" : "Domain ID or Name", "required" : true, "type" : "string" }, { @@ -3291,7 +3291,8 @@ "$ref" : "#/definitions/Error" } } - } + }, + "deprecated" : true } }, "/v1/domains/{domainName}/certificates/uploads" : { @@ -3305,7 +3306,7 @@ "parameters" : [ { "name" : "domainName", "in" : "path", - "description" : "The domain name", + "description" : "Domain ID or Name", "required" : true, "type" : "string" }, { @@ -3340,7 +3341,8 @@ "$ref" : "#/definitions/Error" } } - } + }, + "deprecated" : true } }, "/v1/domains/{domainName}/csrs" : { @@ -3354,7 +3356,7 @@ "parameters" : [ { "name" : "domainName", "in" : "path", - "description" : "The domain name", + "description" : "Domain ID or Name", "required" : true, "type" : "string" } ], @@ -3382,14 +3384,14 @@ "put" : { "tags" : [ "Certificates" ], "summary" : "Generate CSR(s)", - "description" : "Generate CSR(s) for the selected resource(s) in the domain.\n\n*Warning:*\n_Avoid using wildcard certificates. Instead, use subdomain-specific certificates that are rotated often. A compromised wildcard certificate can lead to security repercussions._", + "description" : "Generate CSR(s) for the selected resource(s) in the domain.\n\n*Warning:*\n_Avoid using wildcard certificates. Instead, use subdomain-specific certificates that are rotated often. A compromised wildcard certificate can lead to security repercussions_", "operationId" : "generatesCSRs", "consumes" : [ "application/json" ], "produces" : [ "application/json" ], "parameters" : [ { "name" : "domainName", "in" : "path", - "description" : "The domain name", + "description" : "Domain ID or Name", "required" : true, "type" : "string" }, { @@ -3452,7 +3454,7 @@ "parameters" : [ { "name" : "domainName", "in" : "path", - "description" : "The domain name", + "description" : "Domain ID or Name", "required" : true, "type" : "string" } ], @@ -3476,7 +3478,8 @@ "$ref" : "#/definitions/Error" } } - } + }, + "deprecated" : true } }, "/v1/domains/{domainName}/resource-certificates" : { @@ -3490,7 +3493,7 @@ "parameters" : [ { "name" : "domainName", "in" : "path", - "description" : "The domain name", + "description" : "Domain ID or Name", "required" : true, "type" : "string" } ], @@ -3649,8 +3652,7 @@ "$ref" : "#/definitions/Error" } } - }, - "deprecated" : true + } } }, "/v1/domains/{id}/endpoints" : { @@ -3689,6 +3691,151 @@ } } }, + "/v1/domains/{id}/resource-certificates" : { + "put" : { + "tags" : [ "Certificates" ], + "summary" : "Replace resource certificates", + "description" : "Replace resource certificates", + "operationId" : "replaceResourceCertificates", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "id", + "in" : "path", + "description" : "Domain ID", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "resourceCertificateSpecs", + "description" : "resourceCertificateSpecs", + "required" : true, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ResourceCertificateSpec" + } + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "schema" : { + "$ref" : "#/definitions/Task" + } + }, + "500" : { + "description" : "Internal server error", + "schema" : { + "$ref" : "#/definitions/Error" + } + }, + "404" : { + "description" : "Not Found", + "schema" : { + "$ref" : "#/definitions/Error" + } + } + } + } + }, + "/v1/domains/{id}/resource-certificates/validations" : { + "put" : { + "tags" : [ "Certificates" ], + "summary" : "Validate resource certificates", + "description" : "Validate resource certificates", + "operationId" : "validateResourceCertificates", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "id", + "in" : "path", + "description" : "Domain ID", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "resourceCertificateSpecs", + "description" : "resourceCertificateSpecs", + "required" : true, + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ResourceCertificateSpec" + } + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "schema" : { + "$ref" : "#/definitions/CertificateValidationTask" + } + }, + "201" : { + "description" : "Created", + "schema" : { + "$ref" : "#/definitions/CertificateValidationTask" + } + }, + "500" : { + "description" : "Internal server error", + "schema" : { + "$ref" : "#/definitions/Error" + } + }, + "404" : { + "description" : "Not Found", + "schema" : { + "$ref" : "#/definitions/Error" + } + } + } + } + }, + "/v1/domains/{id}/resource-certificates/validations/{validationId}" : { + "get" : { + "tags" : [ "Certificates" ], + "summary" : "Get the resource certificate validation result", + "description" : "Get the resource certificate validation result", + "operationId" : "getResourceCertificatesValidationResult", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "id", + "in" : "path", + "description" : "Domain ID", + "required" : true, + "type" : "string" + }, { + "name" : "validationId", + "in" : "path", + "description" : "Validation ID", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "OK", + "schema" : { + "$ref" : "#/definitions/CertificateValidationTask" + } + }, + "500" : { + "description" : "Internal server error", + "schema" : { + "$ref" : "#/definitions/Error" + } + }, + "404" : { + "description" : "Not Found", + "schema" : { + "$ref" : "#/definitions/Error" + } + } + } + } + }, "/v1/domains/{id}/tags" : { "get" : { "tags" : [ "Domains" ], @@ -5377,6 +5524,149 @@ } } }, + "/v1/licensing-info/domains/{id}" : { + "get" : { + "tags" : [ "License Keys" ], + "summary" : "Get the Licensing information of a domain", + "operationId" : "getDomainLicensingInfo", + "consumes" : [ "application/json" ], + "produces" : [ "*/*" ], + "parameters" : [ { + "name" : "id", + "in" : "path", + "description" : "The domain ID", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "Successful", + "schema" : { + "$ref" : "#/definitions/LicensingInfo" + } + }, + "500" : { + "description" : "Internal server error", + "schema" : { + "$ref" : "#/definitions/Error" + } + } + } + }, + "put" : { + "tags" : [ "License Keys" ], + "summary" : "Update the Licensing information of a domain", + "operationId" : "updateDomainLicensingInfo", + "consumes" : [ "application/json" ], + "produces" : [ "*/*" ], + "parameters" : [ { + "in" : "body", + "name" : "licensingInfoSpec", + "description" : "License information spec", + "required" : true, + "schema" : { + "$ref" : "#/definitions/LicensingInfoSpec" + } + }, { + "name" : "id", + "in" : "path", + "description" : "The domain ID", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "OK" + }, + "400" : { + "description" : "Bad Request", + "schema" : { + "$ref" : "#/definitions/Error" + } + }, + "202" : { + "description" : "Accepted" + }, + "500" : { + "description" : "Internal server error", + "schema" : { + "$ref" : "#/definitions/Error" + } + }, + "409" : { + "description" : "Conflict", + "schema" : { + "$ref" : "#/definitions/Error" + } + } + } + } + }, + "/v1/licensing-info/system" : { + "get" : { + "tags" : [ "License Keys" ], + "summary" : "Get the Licensing information of system", + "operationId" : "getSystemLicensingInfo", + "consumes" : [ "application/json" ], + "produces" : [ "*/*" ], + "responses" : { + "200" : { + "description" : "Successful", + "schema" : { + "$ref" : "#/definitions/LicensingInfo" + } + }, + "500" : { + "description" : "Internal server error", + "schema" : { + "$ref" : "#/definitions/Error" + } + } + } + }, + "put" : { + "tags" : [ "License Keys" ], + "summary" : "Update the Licensing information of system", + "operationId" : "updateSystemLicensingInfo", + "consumes" : [ "application/json" ], + "produces" : [ "*/*" ], + "parameters" : [ { + "in" : "body", + "name" : "licensingInfoSpec", + "description" : "License information spec", + "required" : true, + "schema" : { + "$ref" : "#/definitions/LicensingInfoSpec" + } + } ], + "responses" : { + "200" : { + "description" : "OK" + }, + "400" : { + "description" : "Bad Request", + "schema" : { + "$ref" : "#/definitions/Error" + } + }, + "202" : { + "description" : "Accepted" + }, + "500" : { + "description" : "Internal server error", + "schema" : { + "$ref" : "#/definitions/Error" + } + }, + "409" : { + "description" : "Conflict", + "schema" : { + "$ref" : "#/definitions/Error" + } + } + } + } + }, "/v1/manifests" : { "get" : { "tags" : [ "Manifests" ], @@ -6855,10 +7145,32 @@ } }, "/v1/sddc-manager/trusted-certificates" : { + "get" : { + "tags" : [ "Trusted Certificates" ], + "summary" : "Get the trusted certificates from the SDDC Manager", + "description" : "Get the trusted certificates from the SDDC Manager", + "operationId" : "getTrustedCertificates", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "responses" : { + "200" : { + "description" : "OK", + "schema" : { + "$ref" : "#/definitions/PageOfTrustedCertificate" + } + }, + "500" : { + "description" : "Internal server error", + "schema" : { + "$ref" : "#/definitions/Error" + } + } + } + }, "post" : { "tags" : [ "Trusted Certificates" ], - "summary" : "Add trusted certificate to the SDDC manager", - "description" : "Add trusted certificate to the SDDC manager", + "summary" : "Add a trusted certificate to the SDDC Manager", + "description" : "Add a trusted certificate to the SDDC Manager", "operationId" : "addTrustedCertificate", "consumes" : [ "application/json" ], "produces" : [ "*/*" ], @@ -6896,6 +7208,40 @@ } } }, + "/v1/sddc-manager/trusted-certificates/{alias}" : { + "delete" : { + "tags" : [ "Trusted Certificates" ], + "summary" : "Delete a trusted certificate from the SDDC Manager", + "description" : "Delete a trusted certificate from the SDDC Manager. Restart the services to reflect the changes.", + "operationId" : "deleteTrustedCertificate", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "alias", + "in" : "path", + "description" : "Certificate Alias", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "OK" + }, + "500" : { + "description" : "Internal server error", + "schema" : { + "$ref" : "#/definitions/Error" + } + }, + "204" : { + "description" : "No Content" + }, + "404" : { + "description" : "Not Found" + } + } + } + }, "/v1/sddc-managers" : { "get" : { "tags" : [ "SddcManagers" ], @@ -7561,6 +7907,40 @@ } } } + }, + "patch" : { + "tags" : [ "System" ], + "summary" : "Update system level configuration", + "description" : "Update system level configuration", + "operationId" : "patchSystem", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "updateSpec", + "description" : "updateSpec", + "required" : true, + "schema" : { + "$ref" : "#/definitions/SystemUpdateSpec" + } + } ], + "responses" : { + "200" : { + "description" : "OK" + }, + "400" : { + "description" : "Bad Request", + "schema" : { + "$ref" : "#/definitions/ErrorResponse" + } + }, + "500" : { + "description" : "Internal Server Error", + "schema" : { + "$ref" : "#/definitions/ErrorResponse" + } + } + } } }, "/v1/system/backup-configuration" : { @@ -10637,7 +11017,7 @@ }, "/v1/vras" : { "get" : { - "tags" : [ "VRA" ], + "tags" : [ "vRA" ], "summary" : "Get all existing vRealize Automation instances", "operationId" : "getVras", "consumes" : [ "application/json" ], @@ -11158,26 +11538,32 @@ "properties" : { "commonName" : { "type" : "string", + "example" : "OpenSSL CA", "description" : "OpenSSL CA domain name" }, "country" : { "type" : "string", + "example" : "IN", "description" : "ISO 3166 country code where company is legally registered" }, "locality" : { "type" : "string", + "example" : "Bengaluru", "description" : "The city or locality where company is legally registered" }, "organization" : { "type" : "string", + "example" : "VMware Inc.", "description" : "The name under which company is legally registered" }, "organizationUnit" : { "type" : "string", + "example" : "VCF", "description" : "Organization with which the certificate is associated" }, "state" : { "type" : "string", + "example" : "Karnataka", "description" : "The full name of the state where company is legally registered" } }, @@ -11306,6 +11692,10 @@ "$ref" : "#/definitions/NsxTEdgeNodeSpec" } }, + "skipTepRoutabilityCheck" : { + "type" : "boolean", + "description" : "Set to true to bypass normal ICMP-based check of Edge TEP / host TEP routability (default is false, meaning do check)" + }, "tier1Unhosted" : { "type" : "boolean", "description" : "Select whether all Tier-1(s) being created per this spec are hosted on the Edge cluster or not (default is false, meaning hosted)" @@ -11531,7 +11921,7 @@ "$ref" : "#/definitions/OpenSSLCertificateAuthoritySpec" } }, - "description" : "This specification contains Certificate Authority (CA) creation details" + "description" : "This specification contains Certificate Authority (CA) creation details. Either openSSLCertificateAuthoritySpec or microsoftCertificateAuthoritySpec should be specified." }, "SsoDomainEntity" : { "required" : [ "type" ], @@ -11781,6 +12171,17 @@ }, "description" : "Represents a page of elements of a single type" }, + "LicensingInfoSpec" : { + "required" : [ "licensingMode" ], + "properties" : { + "licensingMode" : { + "type" : "string", + "example" : "One among: SUBSCRIPTION", + "description" : "Licensing mode" + } + }, + "description" : "Represents the licensing info spec" + }, "NiocBandwidthAllocationSpec" : { "required" : [ "type" ], "properties" : { @@ -11839,6 +12240,38 @@ }, "description" : "This specification contains cluster storage configuration for vSAN" }, + "VxRailArrayAssociationContext" : { + "properties" : { + "arrayAttributeIdsKeyValue" : { + "type" : "object", + "description" : "Key, Value map that holds the simple attributes on the array item that are currently supported.", + "additionalProperties" : { + "type" : "string" + } + }, + "parent" : { + "description" : "Details that holds the association with the parent for nested objects", + "$ref" : "#/definitions/VxRailArrayAssociationContext" + } + }, + "description" : "Contains the mapping between custom attributes and the supported attributes on the array item object." + }, + "TrustedCertificate" : { + "required" : [ "alias", "certificate" ], + "properties" : { + "alias" : { + "type" : "string", + "example" : "vcf_59:24:D5:18:04:A0:26:B0:A4:05:EA:82:60:95:82:A2:4B:F6:31:FB:81:93:01:F3:29:7D:34:9C:D3:05:39:90", + "description" : "Certificate alias" + }, + "certificate" : { + "type" : "string", + "example" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----", + "description" : "Certificate in PEM format" + } + }, + "description" : "The Trusted Certificate details." + }, "BaseAlias" : { "required" : [ "aliases", "version" ], "properties" : { @@ -11883,7 +12316,8 @@ "properties" : { "certificate" : { "type" : "string", - "description" : "Certificate in one-line PEM format" + "example" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----", + "description" : "Certificate in PEM format" }, "certificateUsageType" : { "type" : "string", @@ -12455,18 +12889,22 @@ "properties" : { "secret" : { "type" : "string", + "example" : "********", "description" : "CA server password" }, "serverUrl" : { "type" : "string", + "example" : "https://sfo-ad.rainpole.io/certsrv", "description" : "CA server url" }, "templateName" : { "type" : "string", + "example" : "WebServer", "description" : "CA server template name" }, "username" : { "type" : "string", + "example" : "Administrator", "description" : "CA server username" } }, @@ -13107,6 +13545,10 @@ "format" : "int32", "description" : "Maximum transmission unit" }, + "skipTepRoutabilityCheck" : { + "type" : "boolean", + "description" : "Set to true to bypass normal ICMP-based check of Edge TEP / host TEP routability (default is false, meaning do check)" + }, "tier0Name" : { "type" : "string", "description" : "Name for the Tier-0" @@ -13219,6 +13661,39 @@ }, "description" : "Represents an IP Pool of a network in a network pool" }, + "CertificateValidationTask" : { + "required" : [ "completed", "validationId", "validations" ], + "properties" : { + "completed" : { + "type" : "boolean", + "example" : "One among: true, false", + "description" : "Validation Task Completed" + }, + "endTimestamp" : { + "type" : "string", + "example" : "2021-02-02T00:00:00.000Z", + "description" : "Validation Task End Time" + }, + "startTimestamp" : { + "type" : "string", + "example" : "2021-02-02T00:00:00.000Z", + "description" : "Validation Task Start Time" + }, + "validationId" : { + "type" : "string", + "example" : "B1930850-7D1A-4BAA-89D7-52FD5DAD196A", + "description" : "Validation ID" + }, + "validations" : { + "type" : "array", + "description" : "Resource Certificate Validations", + "items" : { + "$ref" : "#/definitions/CertificateValidation" + } + } + }, + "description" : "The Certificate Validation Task." + }, "Wsa" : { "properties" : { "id" : { @@ -14032,10 +14507,12 @@ "properties" : { "commonName" : { "type" : "string", + "example" : "OpenSSL CA", "description" : "OpenSSL CA domain name" }, "country" : { "type" : "string", + "example" : "IN", "description" : "ISO 3166 country code where company is legally registered" }, "id" : { @@ -14045,30 +14522,37 @@ }, "locality" : { "type" : "string", + "example" : "Bengaluru", "description" : "The city or locality where company is legally registered" }, "organization" : { "type" : "string", + "example" : "VMware Inc.", "description" : "The name under which company is legally registered" }, "organizationUnit" : { "type" : "string", + "example" : "VCF", "description" : "Organization with which the certificate is associated" }, "serverUrl" : { "type" : "string", + "example" : "https://sfo-ad.rainpole.io/certsrv", "description" : "Microsoft CA server url" }, "state" : { "type" : "string", + "example" : "Karnataka", "description" : "The full name of the state where company is legally registered" }, "templateName" : { "type" : "string", + "example" : "WebServer", "description" : "Microsoft CA server template name" }, "username" : { "type" : "string", + "example" : "Administrator", "description" : "Microsoft CA server username" } }, @@ -14543,10 +15027,12 @@ "properties" : { "country" : { "type" : "string", + "example" : "IN", "description" : "ISO 3166 country code where company is legally registered" }, "email" : { "type" : "string", + "example" : "admin@vmware.com", "description" : "Contact email address" }, "keyAlgorithm" : { @@ -14561,18 +15047,22 @@ }, "locality" : { "type" : "string", + "example" : "Bengaluru", "description" : "The city or locality where company is legally registered" }, "organization" : { "type" : "string", + "example" : "VMware Inc.", "description" : "The name under which company is legally registered" }, "organizationUnit" : { "type" : "string", + "example" : "VCF", "description" : "Organization with which the certificate is associated" }, "state" : { "type" : "string", + "example" : "Karnataka", "description" : "The full name of the state where company is legally registered" } }, @@ -14683,11 +15173,6 @@ "type" : "string", "description" : "Management Interface IP" }, - "managementVlanId" : { - "type" : "integer", - "format" : "int32", - "description" : "Management Vlan Id" - }, "secondNsxVdsUplink" : { "type" : "string", "example" : "One among: uplink1, uplink2, uplink3, uplink4", @@ -14699,10 +15184,6 @@ "items" : { "$ref" : "#/definitions/NsxTEdgeUplinkNetwork" } - }, - "vmManagementNetworkName" : { - "type" : "string", - "description" : "VM Management Network Name" } }, "description" : "This specification contains configuration inputs required to deploy and configure an edge node" @@ -15130,7 +15611,7 @@ }, "productType" : { "type" : "string", - "example" : "One among: VCENTER, VSAN, SDDC_MANAGER, ESXI, NSXT, NSXIO, WCP, HORIZON_VIEW", + "example" : "One among: VCENTER, VSAN, ESXI, NSXT, NSXIO, WCP, HORIZON_VIEW", "description" : "The type of the product to which the license key is applicable" } }, @@ -15263,6 +15744,13 @@ "description" : "VxRail Manager admin credentials", "$ref" : "#/definitions/UnmanagedResourceCredential" }, + "arrayContextWithKeyValuePair" : { + "type" : "object", + "description" : "Map of Context class with list of key and value pairs for array objects", + "additionalProperties" : { + "$ref" : "#/definitions/List" + } + }, "contextWithKeyValuePair" : { "type" : "object", "description" : "Map of Context class with list of key and value pairs", @@ -15637,6 +16125,34 @@ }, "description" : "Defines a functionality model" }, + "LicensingInfoReference" : { + "properties" : { + "daysRemainingToSubscribe" : { + "type" : "integer", + "format" : "int32", + "description" : "Number of days remaining to subscribe" + }, + "isRegistered" : { + "type" : "boolean", + "description" : "Flag indicating the resource is registered for subscription or not" + }, + "isSubscribed" : { + "type" : "boolean", + "description" : "Flag indicating the resource is subscribed or not" + }, + "licensingMode" : { + "type" : "string", + "example" : "One among: SUBSCRIPTION, PERPETUAL, MIXED", + "description" : "Licensing mode" + }, + "subscriptionStatus" : { + "type" : "string", + "example" : "One among: UNSUBSCRIBED, ACTIVE, EXPIRED", + "description" : "Status of the subscription mode" + } + }, + "description" : "Licensing information of the resource" + }, "StorageInfo" : { "properties" : { "total" : { @@ -15815,7 +16331,7 @@ }, "licensingMode" : { "type" : "string", - "example" : "One among: SUBSCRIPTION, PERPETUAL", + "example" : "One among: SUBSCRIPTION, PERPETUAL, MIXED", "description" : "Licensing mode" }, "resourceId" : { @@ -16025,11 +16541,23 @@ }, "description" : "Represents Identity provider configuration" }, + "MapOfstringAndListOfVxRailCustomArrayContext" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/definitions/List" + } + }, "Csr" : { - "required" : [ "csrEncodedContent", "resource" ], + "required" : [ "csrDecodedContent", "csrEncodedContent", "resource" ], "properties" : { + "csrDecodedContent" : { + "type" : "string", + "example" : "DECODED CSR AS STRING", + "description" : "The CSR decoded content" + }, "csrEncodedContent" : { "type" : "string", + "example" : "-----BEGIN CERTIFICATE REQUEST-----\nMIIEH...\n-----END CERTIFICATE REQUEST-----", "description" : "The CSR encoded content" }, "resource" : { @@ -16425,6 +16953,22 @@ }, "description" : "Nsxt Upgrade Resources for an NSXT instance" }, + "PageOfTrustedCertificate" : { + "properties" : { + "elements" : { + "type" : "array", + "description" : "The list of elements included in this page", + "items" : { + "$ref" : "#/definitions/TrustedCertificate" + } + }, + "pageMetadata" : { + "description" : "Pageable elements pagination metadata information", + "$ref" : "#/definitions/PageMetadata" + } + }, + "description" : "Represents a page of elements of a single type" + }, "MapOfstringAndHardwareSupportPackageInfo" : { "type" : "object", "additionalProperties" : { @@ -16935,6 +17479,42 @@ }, "description" : "Represents a cluster query response." }, + "CertificateValidation" : { + "required" : [ "resourceFqdn", "resourceId", "startTimestamp", "validationStatus" ], + "properties" : { + "endTimestamp" : { + "type" : "string", + "example" : "2021-02-02T00:00:00.000Z", + "description" : "End Timestamp" + }, + "resourceFqdn" : { + "type" : "string", + "example" : "sfo-vc01.rainpole.io", + "description" : "Resource FQDN" + }, + "resourceId" : { + "type" : "string", + "example" : "BE8A5E04-92A0-43F6-A166-AA041F4327CC", + "description" : "Resource ID" + }, + "startTimestamp" : { + "type" : "string", + "example" : "2020-01-01T00:00:00.000Z", + "description" : "Start Timestamp" + }, + "validationMessage" : { + "type" : "string", + "example" : "Certificate Expired", + "description" : "Validation Message" + }, + "validationStatus" : { + "type" : "string", + "example" : "One among: INPROGRESS, SUCCESSFUL, FAILED", + "description" : "Validation Status" + } + }, + "description" : "The Certificate Validation details." + }, "VvsVersionAliases" : { "required" : [ "version" ], "properties" : { @@ -18119,6 +18699,10 @@ "type" : "boolean", "description" : "Shows whether the workload domain is joined to the Management domain SSO" }, + "licensingInfo" : { + "description" : "Licensing information of the workload domain", + "$ref" : "#/definitions/LicensingInfoReference" + }, "name" : { "type" : "string", "description" : "Name of the workload domain" @@ -18161,7 +18745,7 @@ "description" : "Represents a domain" }, "Certificate" : { - "required" : [ "caChain", "domain", "expirationStatus", "getCertificateError", "isInstalled", "issuedBy", "issuedTo", "keySize", "notAfter", "notBefore", "numberOfDaysToExpire", "pemEncoded", "publicKey", "publicKeyAlgorithm", "serialNumber", "signatureAlgorithm", "subject", "subjectAlternativeName", "thumbprint", "thumbprintAlgorithm", "version" ], + "required" : [ "domain", "expirationStatus", "getCertificateError", "isInstalled", "issuedBy", "issuedTo", "keySize", "notAfter", "notBefore", "numberOfDaysToExpire", "pemEncoded", "publicKey", "publicKeyAlgorithm", "serialNumber", "signatureAlgorithm", "subject", "subjectAlternativeName", "thumbprint", "thumbprintAlgorithm", "version" ], "properties" : { "caChain" : { "type" : "array", @@ -18172,6 +18756,7 @@ }, "domain" : { "type" : "string", + "example" : "3E86FBAD-8984-4D4B-992D-F0C49857572A", "description" : "Domain of the resource certificate" }, "expirationStatus" : { @@ -18181,44 +18766,53 @@ }, "getCertificateError" : { "type" : "string", + "example" : "Status : NOT_TRUSTED, Message : Certificate Expired", "description" : "Error if certificate cannot be fetched" }, "isInstalled" : { "type" : "boolean", + "example" : "One among: true, false", "description" : "Whether the certificate is installed or not" }, "issuedBy" : { "type" : "string", + "example" : "CN=OpenSSL CA, OU=VCF, O=VMware, L=Bengaluru, ST=Karnataka, C=IN", "description" : "The certificate authority that issued the certificate" }, "issuedTo" : { "type" : "string", + "example" : "sfo-vc01.rainpole.io", "description" : "To whom the certificate is issued" }, "keySize" : { "type" : "string", "example" : "One among: 2048, 3072, 4096", - "description" : "The keysize of the certificate" + "description" : "The key size of the certificate" }, "notAfter" : { "type" : "string", + "example" : "2021-02-02T00:00:00.000Z", "description" : "The timestamp after which certificate is not valid" }, "notBefore" : { "type" : "string", + "example" : "2020-01-01T00:00:00.000Z", "description" : "The timestamp before which certificate is not valid" }, "numberOfDaysToExpire" : { "type" : "integer", "format" : "int32", + "example" : "398", "description" : "Number of days left for the certificate to expire" }, "pemEncoded" : { "type" : "string", + "example" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----", "description" : "The PEM encoded certificate content" }, "publicKey" : { "type" : "string", + "example" : "D6:FD:DF:33:F1:...", "description" : "The public key of the certificate" }, "publicKeyAlgorithm" : { @@ -18228,18 +18822,22 @@ }, "serialNumber" : { "type" : "string", + "example" : "46:85:19:77:36:12:67:26", "description" : "The serial number of the certificate" }, "signatureAlgorithm" : { "type" : "string", + "example" : "SHA256withRSA", "description" : "Algorithm used to sign the certificate" }, "subject" : { "type" : "string", + "example" : "CN=sfo-vc01.rainpole.io, OU=VCF, O=VMware, L=Bengaluru, ST=Karnataka, C=IN", "description" : "Complete distinguished name to which the certificate is issued" }, "subjectAlternativeName" : { "type" : "array", + "example" : "sfo-vc01.rainpole.io", "description" : "The alternative names to which the certificate is issued", "items" : { "type" : "string" @@ -18247,14 +18845,17 @@ }, "thumbprint" : { "type" : "string", + "example" : "59:24:D5:18:04:A0:26:B0:A4:05:EA:82:60:95:82:A2:4B:F6:31:FB:81:93:01:F3:29:7D:34:9C:D3:05:39:90", "description" : "Thumbprint generated using certificate content" }, "thumbprintAlgorithm" : { "type" : "string", + "example" : "SHA-256", "description" : "Algorithm used to generate thumbprint" }, "version" : { "type" : "string", + "example" : "V3", "description" : "The X.509 version of the certificate" } }, @@ -19722,6 +20323,18 @@ "type" : "boolean", "description" : "[Deprecated] Whether bundle is applicable or not." }, + "knownIssuesDescription" : { + "type" : "string", + "description" : "know issues of the release, used to display KB link for known issues of the release" + }, + "knownIssuesUrl" : { + "type" : "string", + "description" : "know issues of the release, used to display description for known issues of the release" + }, + "maxCompatibleVcfVersion" : { + "type" : "string", + "description" : "Maximum compatible VCF version, used to represent compatibility of SDDC Manager and VMware BOM components" + }, "minCompatibleVcfVersion" : { "type" : "string", "description" : "Minimum compatible VCF version, used to represent compatibility of SDDC Manager and VMware BOM components" @@ -19849,6 +20462,16 @@ "$ref" : "#/definitions/List" } }, + "SystemUpdateSpec" : { + "properties" : { + "maxAllowedDomainsInSubscription" : { + "type" : "integer", + "format" : "int32", + "description" : "new limit of amount of domains in subscription mode" + } + }, + "description" : "Contains the parameters required to perform update operation on system" + }, "Tag" : { "properties" : { "categoryId" : { @@ -20132,6 +20755,36 @@ }, "description" : "Details of the Identity Source" }, + "ResourceCertificateSpec" : { + "properties" : { + "caCertificate" : { + "type" : "string", + "example" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----", + "description" : "CA Certificate" + }, + "certificateChain" : { + "type" : "string", + "example" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----", + "description" : "Certificate Chain" + }, + "resourceCertificate" : { + "type" : "string", + "example" : "-----BEGIN CERTIFICATE-----\nMIIFq...\n-----END CERTIFICATE-----", + "description" : "Resource Certificate" + }, + "resourceFqdn" : { + "type" : "string", + "example" : "sfo-vc01.rainpole.io", + "description" : "Resource FQDN" + }, + "resourceId" : { + "type" : "string", + "example" : "BE8A5E04-92A0-43F6-A166-AA041F4327CC", + "description" : "Resource ID" + } + }, + "description" : "This specification contains resource certificate details. Either resourceId or resourceFqdn should be provided. Either certificateChain or both resourceCertificate and caCertificate should be provided." + }, "HardwareSupportInfo" : { "required" : [ "packages" ], "properties" : { @@ -20171,6 +20824,22 @@ }, "description" : "Represents a cpu metric with used and total for a resource" }, + "VxRailCustomArrayContext" : { + "properties" : { + "arrayAssociationContext" : { + "description" : "Details that holds the mapping between the custom attributes to the array item", + "$ref" : "#/definitions/VxRailArrayAssociationContext" + }, + "simpleAttributes" : { + "type" : "array", + "description" : "Collection of simple attributes that contains name, value and type for each attribute.", + "items" : { + "$ref" : "#/definitions/VxRailContext" + } + } + }, + "description" : "Contains the details of simple/complex custom attribute on an array item object." + }, "BaseImageDetails" : { "required" : [ "displayName", "displayVersion" ], "properties" : { @@ -20195,6 +20864,7 @@ "properties" : { "fqdn" : { "type" : "string", + "example" : "sfo-vc01.rainpole.io", "description" : "Resource FQDN" }, "name" : { @@ -20203,10 +20873,12 @@ }, "resourceId" : { "type" : "string", + "example" : "BE8A5E04-92A0-43F6-A166-AA041F4327CC", "description" : "Resource ID" }, "sans" : { "type" : "array", + "example" : "sfo-vc01.rainpole.io", "description" : "Subject alternative name(s)", "items" : { "type" : "string" @@ -20214,6 +20886,7 @@ }, "type" : { "type" : "string", + "example" : "One among: SDDC_MANAGER, PSC, VCENTER, NSX_MANAGER, NSXT_MANAGER, VRA, VRLI, VROPS, VRSLCM, VXRAIL_MANAGER", "description" : "Resource type" } }, @@ -20572,6 +21245,18 @@ "type" : "boolean", "description" : "[Deprecated] Whether bundle is applicable or not." }, + "knownIssuesDescription" : { + "type" : "string", + "description" : "know issues of the release, used to display KB link for known issues of the release" + }, + "knownIssuesUrl" : { + "type" : "string", + "description" : "know issues of the release, used to display description for known issues of the release" + }, + "maxCompatibleVcfVersion" : { + "type" : "string", + "description" : "Maximum compatible VCF version, used to represent compatibility of SDDC Manager and VMware BOM components" + }, "minCompatibleVcfVersion" : { "type" : "string", "description" : "Minimum compatible VCF version, used to represent compatibility of SDDC Manager and VMware BOM components" From ea087ef49b36887e9a2ce7742bdba07756cf1b44 Mon Sep 17 00:00:00 2001 From: Dimitar Proynov Date: Tue, 17 Oct 2023 17:46:14 +0300 Subject: [PATCH 2/3] Update CHANGELOG.md for next release. Testing done: go mod tidy go build Signed-off-by: Dimitar Proynov --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4172cb5..0580bd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG +## [v0.2.0](https://github.com/vmware/vcf-sdk-go/releases/tag/v0.2.0) + +> Release Date: 18 Oct 2023 + +Support APIs from VCF 4.5.2 +Note: PUT “/v1/personalities/files” API omitted as it made the swagger file invalid. + ## [v0.1.3](https://github.com/vmware/vcf-sdk-go/releases/tag/v0.1.3) > Release Date: 02 Oct 2023 From f0267b94524ce3f26cc91b687876df4036ceb6a4 Mon Sep 17 00:00:00 2001 From: Dimitar Proynov Date: Wed, 18 Oct 2023 17:23:55 +0300 Subject: [PATCH 3/3] Fixing swagger version. Testing done: go mod tidy go build Signed-off-by: Dimitar Proynov --- swagger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swagger.json b/swagger.json index 1b7eed8..f8b8079 100755 --- a/swagger.json +++ b/swagger.json @@ -2,7 +2,7 @@ "swagger" : "2.0", "info" : { "description" : "VMware Cloud Foundation is an integrated software stack that bundles the VMware virtualization and management components like compute virtualization (vSphere), storage virtualization (vSAN), network virtualization (NSX), and cloud management (vRealize Suite). VCF consists of Cloud Builder - that automates the bringup of the management infrastructure and SDDC Manager - that automates the workload domain management, lifecycle and operations. This API reference guide covers APIs of both Cloud Builder and SDDC Manager", - "version" : "4.5.2-vcf4520RELEASE", + "version" : "4.5.2", "title" : "VMware Cloud Foundation API Reference Guide", "termsOfService" : "http://www.vmware.com/", "contact" : {