diff --git a/cdp-sdk-go/Makefile b/cdp-sdk-go/Makefile index 29ce2ab8..a624b162 100644 --- a/cdp-sdk-go/Makefile +++ b/cdp-sdk-go/Makefile @@ -11,7 +11,7 @@ GO_FLAGS:="" SWAGGER_REPO_RAW=https://raw.githubusercontent.com/cloudera/cdp-dev-docs/ -API_DEFINITION_TAG ?= cdp-api-0.9.92 +API_DEFINITION_TAG ?= cdp-api-0.9.104 SWAGGER=$(SWAGGER_REPO_RAW)/$(API_DEFINITION_TAG)/api-docs-beta/swagger all: check-go test build diff --git a/cdp-sdk-go/gen/datahub/client/operations/create_a_w_s_gov_cloud_cluster_parameters.go b/cdp-sdk-go/gen/datahub/client/operations/create_a_w_s_gov_cloud_cluster_parameters.go new file mode 100644 index 00000000..8c4b7a39 --- /dev/null +++ b/cdp-sdk-go/gen/datahub/client/operations/create_a_w_s_gov_cloud_cluster_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datahub/models" +) + +// NewCreateAWSGovCloudClusterParams creates a new CreateAWSGovCloudClusterParams 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 NewCreateAWSGovCloudClusterParams() *CreateAWSGovCloudClusterParams { + return &CreateAWSGovCloudClusterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateAWSGovCloudClusterParamsWithTimeout creates a new CreateAWSGovCloudClusterParams object +// with the ability to set a timeout on a request. +func NewCreateAWSGovCloudClusterParamsWithTimeout(timeout time.Duration) *CreateAWSGovCloudClusterParams { + return &CreateAWSGovCloudClusterParams{ + timeout: timeout, + } +} + +// NewCreateAWSGovCloudClusterParamsWithContext creates a new CreateAWSGovCloudClusterParams object +// with the ability to set a context for a request. +func NewCreateAWSGovCloudClusterParamsWithContext(ctx context.Context) *CreateAWSGovCloudClusterParams { + return &CreateAWSGovCloudClusterParams{ + Context: ctx, + } +} + +// NewCreateAWSGovCloudClusterParamsWithHTTPClient creates a new CreateAWSGovCloudClusterParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateAWSGovCloudClusterParamsWithHTTPClient(client *http.Client) *CreateAWSGovCloudClusterParams { + return &CreateAWSGovCloudClusterParams{ + HTTPClient: client, + } +} + +/* +CreateAWSGovCloudClusterParams contains all the parameters to send to the API endpoint + + for the create a w s gov cloud cluster operation. + + Typically these are written to a http.Request. +*/ +type CreateAWSGovCloudClusterParams struct { + + // Input. + Input *models.CreateAWSGovCloudClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create a w s gov cloud cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAWSGovCloudClusterParams) WithDefaults() *CreateAWSGovCloudClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create a w s gov cloud cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAWSGovCloudClusterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create a w s gov cloud cluster params +func (o *CreateAWSGovCloudClusterParams) WithTimeout(timeout time.Duration) *CreateAWSGovCloudClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create a w s gov cloud cluster params +func (o *CreateAWSGovCloudClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create a w s gov cloud cluster params +func (o *CreateAWSGovCloudClusterParams) WithContext(ctx context.Context) *CreateAWSGovCloudClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create a w s gov cloud cluster params +func (o *CreateAWSGovCloudClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create a w s gov cloud cluster params +func (o *CreateAWSGovCloudClusterParams) WithHTTPClient(client *http.Client) *CreateAWSGovCloudClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create a w s gov cloud cluster params +func (o *CreateAWSGovCloudClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the create a w s gov cloud cluster params +func (o *CreateAWSGovCloudClusterParams) WithInput(input *models.CreateAWSGovCloudClusterRequest) *CreateAWSGovCloudClusterParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the create a w s gov cloud cluster params +func (o *CreateAWSGovCloudClusterParams) SetInput(input *models.CreateAWSGovCloudClusterRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateAWSGovCloudClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/datahub/client/operations/create_a_w_s_gov_cloud_cluster_responses.go b/cdp-sdk-go/gen/datahub/client/operations/create_a_w_s_gov_cloud_cluster_responses.go new file mode 100644 index 00000000..caebdfdd --- /dev/null +++ b/cdp-sdk-go/gen/datahub/client/operations/create_a_w_s_gov_cloud_cluster_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datahub/models" +) + +// CreateAWSGovCloudClusterReader is a Reader for the CreateAWSGovCloudCluster structure. +type CreateAWSGovCloudClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateAWSGovCloudClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateAWSGovCloudClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreateAWSGovCloudClusterDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCreateAWSGovCloudClusterOK creates a CreateAWSGovCloudClusterOK with default headers values +func NewCreateAWSGovCloudClusterOK() *CreateAWSGovCloudClusterOK { + return &CreateAWSGovCloudClusterOK{} +} + +/* +CreateAWSGovCloudClusterOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type CreateAWSGovCloudClusterOK struct { + Payload *models.CreateAWSGovCloudClusterResponse +} + +// IsSuccess returns true when this create a w s gov cloud cluster o k response has a 2xx status code +func (o *CreateAWSGovCloudClusterOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create a w s gov cloud cluster o k response has a 3xx status code +func (o *CreateAWSGovCloudClusterOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create a w s gov cloud cluster o k response has a 4xx status code +func (o *CreateAWSGovCloudClusterOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create a w s gov cloud cluster o k response has a 5xx status code +func (o *CreateAWSGovCloudClusterOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create a w s gov cloud cluster o k response a status code equal to that given +func (o *CreateAWSGovCloudClusterOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create a w s gov cloud cluster o k response +func (o *CreateAWSGovCloudClusterOK) Code() int { + return 200 +} + +func (o *CreateAWSGovCloudClusterOK) Error() string { + return fmt.Sprintf("[POST /api/v1/datahub/createAWSGovCloudCluster][%d] createAWSGovCloudClusterOK %+v", 200, o.Payload) +} + +func (o *CreateAWSGovCloudClusterOK) String() string { + return fmt.Sprintf("[POST /api/v1/datahub/createAWSGovCloudCluster][%d] createAWSGovCloudClusterOK %+v", 200, o.Payload) +} + +func (o *CreateAWSGovCloudClusterOK) GetPayload() *models.CreateAWSGovCloudClusterResponse { + return o.Payload +} + +func (o *CreateAWSGovCloudClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CreateAWSGovCloudClusterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateAWSGovCloudClusterDefault creates a CreateAWSGovCloudClusterDefault with default headers values +func NewCreateAWSGovCloudClusterDefault(code int) *CreateAWSGovCloudClusterDefault { + return &CreateAWSGovCloudClusterDefault{ + _statusCode: code, + } +} + +/* +CreateAWSGovCloudClusterDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type CreateAWSGovCloudClusterDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this create a w s gov cloud cluster default response has a 2xx status code +func (o *CreateAWSGovCloudClusterDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this create a w s gov cloud cluster default response has a 3xx status code +func (o *CreateAWSGovCloudClusterDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this create a w s gov cloud cluster default response has a 4xx status code +func (o *CreateAWSGovCloudClusterDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this create a w s gov cloud cluster default response has a 5xx status code +func (o *CreateAWSGovCloudClusterDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this create a w s gov cloud cluster default response a status code equal to that given +func (o *CreateAWSGovCloudClusterDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the create a w s gov cloud cluster default response +func (o *CreateAWSGovCloudClusterDefault) Code() int { + return o._statusCode +} + +func (o *CreateAWSGovCloudClusterDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/datahub/createAWSGovCloudCluster][%d] createAWSGovCloudCluster default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAWSGovCloudClusterDefault) String() string { + return fmt.Sprintf("[POST /api/v1/datahub/createAWSGovCloudCluster][%d] createAWSGovCloudCluster default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAWSGovCloudClusterDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *CreateAWSGovCloudClusterDefault) 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/cdp-sdk-go/gen/datahub/client/operations/describe_database_server_parameters.go b/cdp-sdk-go/gen/datahub/client/operations/describe_database_server_parameters.go new file mode 100644 index 00000000..90131eaf --- /dev/null +++ b/cdp-sdk-go/gen/datahub/client/operations/describe_database_server_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datahub/models" +) + +// NewDescribeDatabaseServerParams creates a new DescribeDatabaseServerParams 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 NewDescribeDatabaseServerParams() *DescribeDatabaseServerParams { + return &DescribeDatabaseServerParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDescribeDatabaseServerParamsWithTimeout creates a new DescribeDatabaseServerParams object +// with the ability to set a timeout on a request. +func NewDescribeDatabaseServerParamsWithTimeout(timeout time.Duration) *DescribeDatabaseServerParams { + return &DescribeDatabaseServerParams{ + timeout: timeout, + } +} + +// NewDescribeDatabaseServerParamsWithContext creates a new DescribeDatabaseServerParams object +// with the ability to set a context for a request. +func NewDescribeDatabaseServerParamsWithContext(ctx context.Context) *DescribeDatabaseServerParams { + return &DescribeDatabaseServerParams{ + Context: ctx, + } +} + +// NewDescribeDatabaseServerParamsWithHTTPClient creates a new DescribeDatabaseServerParams object +// with the ability to set a custom HTTPClient for a request. +func NewDescribeDatabaseServerParamsWithHTTPClient(client *http.Client) *DescribeDatabaseServerParams { + return &DescribeDatabaseServerParams{ + HTTPClient: client, + } +} + +/* +DescribeDatabaseServerParams contains all the parameters to send to the API endpoint + + for the describe database server operation. + + Typically these are written to a http.Request. +*/ +type DescribeDatabaseServerParams struct { + + // Input. + Input *models.DescribeDatabaseServerRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the describe database server params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DescribeDatabaseServerParams) WithDefaults() *DescribeDatabaseServerParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the describe database server params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DescribeDatabaseServerParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the describe database server params +func (o *DescribeDatabaseServerParams) WithTimeout(timeout time.Duration) *DescribeDatabaseServerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the describe database server params +func (o *DescribeDatabaseServerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the describe database server params +func (o *DescribeDatabaseServerParams) WithContext(ctx context.Context) *DescribeDatabaseServerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the describe database server params +func (o *DescribeDatabaseServerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the describe database server params +func (o *DescribeDatabaseServerParams) WithHTTPClient(client *http.Client) *DescribeDatabaseServerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the describe database server params +func (o *DescribeDatabaseServerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the describe database server params +func (o *DescribeDatabaseServerParams) WithInput(input *models.DescribeDatabaseServerRequest) *DescribeDatabaseServerParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the describe database server params +func (o *DescribeDatabaseServerParams) SetInput(input *models.DescribeDatabaseServerRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *DescribeDatabaseServerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/datahub/client/operations/describe_database_server_responses.go b/cdp-sdk-go/gen/datahub/client/operations/describe_database_server_responses.go new file mode 100644 index 00000000..b6b60bb3 --- /dev/null +++ b/cdp-sdk-go/gen/datahub/client/operations/describe_database_server_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datahub/models" +) + +// DescribeDatabaseServerReader is a Reader for the DescribeDatabaseServer structure. +type DescribeDatabaseServerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DescribeDatabaseServerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDescribeDatabaseServerOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDescribeDatabaseServerDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDescribeDatabaseServerOK creates a DescribeDatabaseServerOK with default headers values +func NewDescribeDatabaseServerOK() *DescribeDatabaseServerOK { + return &DescribeDatabaseServerOK{} +} + +/* +DescribeDatabaseServerOK describes a response with status code 200, with default header values. + +Database server details for the requested resource. +*/ +type DescribeDatabaseServerOK struct { + Payload *models.DescribeDatabaseServerResponse +} + +// IsSuccess returns true when this describe database server o k response has a 2xx status code +func (o *DescribeDatabaseServerOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this describe database server o k response has a 3xx status code +func (o *DescribeDatabaseServerOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this describe database server o k response has a 4xx status code +func (o *DescribeDatabaseServerOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this describe database server o k response has a 5xx status code +func (o *DescribeDatabaseServerOK) IsServerError() bool { + return false +} + +// IsCode returns true when this describe database server o k response a status code equal to that given +func (o *DescribeDatabaseServerOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the describe database server o k response +func (o *DescribeDatabaseServerOK) Code() int { + return 200 +} + +func (o *DescribeDatabaseServerOK) Error() string { + return fmt.Sprintf("[POST /api/v1/datahub/describeDatabaseServer][%d] describeDatabaseServerOK %+v", 200, o.Payload) +} + +func (o *DescribeDatabaseServerOK) String() string { + return fmt.Sprintf("[POST /api/v1/datahub/describeDatabaseServer][%d] describeDatabaseServerOK %+v", 200, o.Payload) +} + +func (o *DescribeDatabaseServerOK) GetPayload() *models.DescribeDatabaseServerResponse { + return o.Payload +} + +func (o *DescribeDatabaseServerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DescribeDatabaseServerResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDescribeDatabaseServerDefault creates a DescribeDatabaseServerDefault with default headers values +func NewDescribeDatabaseServerDefault(code int) *DescribeDatabaseServerDefault { + return &DescribeDatabaseServerDefault{ + _statusCode: code, + } +} + +/* +DescribeDatabaseServerDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type DescribeDatabaseServerDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this describe database server default response has a 2xx status code +func (o *DescribeDatabaseServerDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this describe database server default response has a 3xx status code +func (o *DescribeDatabaseServerDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this describe database server default response has a 4xx status code +func (o *DescribeDatabaseServerDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this describe database server default response has a 5xx status code +func (o *DescribeDatabaseServerDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this describe database server default response a status code equal to that given +func (o *DescribeDatabaseServerDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the describe database server default response +func (o *DescribeDatabaseServerDefault) Code() int { + return o._statusCode +} + +func (o *DescribeDatabaseServerDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/datahub/describeDatabaseServer][%d] describeDatabaseServer default %+v", o._statusCode, o.Payload) +} + +func (o *DescribeDatabaseServerDefault) String() string { + return fmt.Sprintf("[POST /api/v1/datahub/describeDatabaseServer][%d] describeDatabaseServer default %+v", o._statusCode, o.Payload) +} + +func (o *DescribeDatabaseServerDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *DescribeDatabaseServerDefault) 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/cdp-sdk-go/gen/datahub/client/operations/get_operation_parameters.go b/cdp-sdk-go/gen/datahub/client/operations/get_operation_parameters.go new file mode 100644 index 00000000..9fab6f64 --- /dev/null +++ b/cdp-sdk-go/gen/datahub/client/operations/get_operation_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datahub/models" +) + +// NewGetOperationParams creates a new GetOperationParams 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 NewGetOperationParams() *GetOperationParams { + return &GetOperationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetOperationParamsWithTimeout creates a new GetOperationParams object +// with the ability to set a timeout on a request. +func NewGetOperationParamsWithTimeout(timeout time.Duration) *GetOperationParams { + return &GetOperationParams{ + timeout: timeout, + } +} + +// NewGetOperationParamsWithContext creates a new GetOperationParams object +// with the ability to set a context for a request. +func NewGetOperationParamsWithContext(ctx context.Context) *GetOperationParams { + return &GetOperationParams{ + Context: ctx, + } +} + +// NewGetOperationParamsWithHTTPClient creates a new GetOperationParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetOperationParamsWithHTTPClient(client *http.Client) *GetOperationParams { + return &GetOperationParams{ + HTTPClient: client, + } +} + +/* +GetOperationParams contains all the parameters to send to the API endpoint + + for the get operation operation. + + Typically these are written to a http.Request. +*/ +type GetOperationParams struct { + + // Input. + Input *models.GetOperationRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get operation params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOperationParams) WithDefaults() *GetOperationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get operation params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOperationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get operation params +func (o *GetOperationParams) WithTimeout(timeout time.Duration) *GetOperationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get operation params +func (o *GetOperationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get operation params +func (o *GetOperationParams) WithContext(ctx context.Context) *GetOperationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get operation params +func (o *GetOperationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get operation params +func (o *GetOperationParams) WithHTTPClient(client *http.Client) *GetOperationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get operation params +func (o *GetOperationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the get operation params +func (o *GetOperationParams) WithInput(input *models.GetOperationRequest) *GetOperationParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the get operation params +func (o *GetOperationParams) SetInput(input *models.GetOperationRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *GetOperationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/datahub/client/operations/get_operation_responses.go b/cdp-sdk-go/gen/datahub/client/operations/get_operation_responses.go new file mode 100644 index 00000000..e33bc451 --- /dev/null +++ b/cdp-sdk-go/gen/datahub/client/operations/get_operation_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datahub/models" +) + +// GetOperationReader is a Reader for the GetOperation structure. +type GetOperationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOperationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOperationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetOperationDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetOperationOK creates a GetOperationOK with default headers values +func NewGetOperationOK() *GetOperationOK { + return &GetOperationOK{} +} + +/* +GetOperationOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type GetOperationOK struct { + Payload *models.GetOperationResponse +} + +// IsSuccess returns true when this get operation o k response has a 2xx status code +func (o *GetOperationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get operation o k response has a 3xx status code +func (o *GetOperationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get operation o k response has a 4xx status code +func (o *GetOperationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get operation o k response has a 5xx status code +func (o *GetOperationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get operation o k response a status code equal to that given +func (o *GetOperationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get operation o k response +func (o *GetOperationOK) Code() int { + return 200 +} + +func (o *GetOperationOK) Error() string { + return fmt.Sprintf("[POST /api/v1/datahub/getOperation][%d] getOperationOK %+v", 200, o.Payload) +} + +func (o *GetOperationOK) String() string { + return fmt.Sprintf("[POST /api/v1/datahub/getOperation][%d] getOperationOK %+v", 200, o.Payload) +} + +func (o *GetOperationOK) GetPayload() *models.GetOperationResponse { + return o.Payload +} + +func (o *GetOperationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetOperationResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOperationDefault creates a GetOperationDefault with default headers values +func NewGetOperationDefault(code int) *GetOperationDefault { + return &GetOperationDefault{ + _statusCode: code, + } +} + +/* +GetOperationDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type GetOperationDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this get operation default response has a 2xx status code +func (o *GetOperationDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get operation default response has a 3xx status code +func (o *GetOperationDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get operation default response has a 4xx status code +func (o *GetOperationDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get operation default response has a 5xx status code +func (o *GetOperationDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get operation default response a status code equal to that given +func (o *GetOperationDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the get operation default response +func (o *GetOperationDefault) Code() int { + return o._statusCode +} + +func (o *GetOperationDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/datahub/getOperation][%d] getOperation default %+v", o._statusCode, o.Payload) +} + +func (o *GetOperationDefault) String() string { + return fmt.Sprintf("[POST /api/v1/datahub/getOperation][%d] getOperation default %+v", o._statusCode, o.Payload) +} + +func (o *GetOperationDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetOperationDefault) 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/cdp-sdk-go/gen/datahub/client/operations/get_vm_types_parameters.go b/cdp-sdk-go/gen/datahub/client/operations/get_vm_types_parameters.go new file mode 100644 index 00000000..8c97162e --- /dev/null +++ b/cdp-sdk-go/gen/datahub/client/operations/get_vm_types_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datahub/models" +) + +// NewGetVMTypesParams creates a new GetVMTypesParams 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 NewGetVMTypesParams() *GetVMTypesParams { + return &GetVMTypesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetVMTypesParamsWithTimeout creates a new GetVMTypesParams object +// with the ability to set a timeout on a request. +func NewGetVMTypesParamsWithTimeout(timeout time.Duration) *GetVMTypesParams { + return &GetVMTypesParams{ + timeout: timeout, + } +} + +// NewGetVMTypesParamsWithContext creates a new GetVMTypesParams object +// with the ability to set a context for a request. +func NewGetVMTypesParamsWithContext(ctx context.Context) *GetVMTypesParams { + return &GetVMTypesParams{ + Context: ctx, + } +} + +// NewGetVMTypesParamsWithHTTPClient creates a new GetVMTypesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetVMTypesParamsWithHTTPClient(client *http.Client) *GetVMTypesParams { + return &GetVMTypesParams{ + HTTPClient: client, + } +} + +/* +GetVMTypesParams contains all the parameters to send to the API endpoint + + for the get Vm types operation. + + Typically these are written to a http.Request. +*/ +type GetVMTypesParams struct { + + // Input. + Input *models.GetVMTypesRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get Vm types params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVMTypesParams) WithDefaults() *GetVMTypesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get Vm types params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetVMTypesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get Vm types params +func (o *GetVMTypesParams) WithTimeout(timeout time.Duration) *GetVMTypesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get Vm types params +func (o *GetVMTypesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get Vm types params +func (o *GetVMTypesParams) WithContext(ctx context.Context) *GetVMTypesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get Vm types params +func (o *GetVMTypesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get Vm types params +func (o *GetVMTypesParams) WithHTTPClient(client *http.Client) *GetVMTypesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get Vm types params +func (o *GetVMTypesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the get Vm types params +func (o *GetVMTypesParams) WithInput(input *models.GetVMTypesRequest) *GetVMTypesParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the get Vm types params +func (o *GetVMTypesParams) SetInput(input *models.GetVMTypesRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *GetVMTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/datahub/client/operations/get_vm_types_responses.go b/cdp-sdk-go/gen/datahub/client/operations/get_vm_types_responses.go new file mode 100644 index 00000000..34e00d4a --- /dev/null +++ b/cdp-sdk-go/gen/datahub/client/operations/get_vm_types_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datahub/models" +) + +// GetVMTypesReader is a Reader for the GetVMTypes structure. +type GetVMTypesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetVMTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetVMTypesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetVMTypesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetVMTypesOK creates a GetVMTypesOK with default headers values +func NewGetVMTypesOK() *GetVMTypesOK { + return &GetVMTypesOK{} +} + +/* +GetVMTypesOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type GetVMTypesOK struct { + Payload *models.GetVMTypesResponse +} + +// IsSuccess returns true when this get Vm types o k response has a 2xx status code +func (o *GetVMTypesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get Vm types o k response has a 3xx status code +func (o *GetVMTypesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get Vm types o k response has a 4xx status code +func (o *GetVMTypesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get Vm types o k response has a 5xx status code +func (o *GetVMTypesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get Vm types o k response a status code equal to that given +func (o *GetVMTypesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get Vm types o k response +func (o *GetVMTypesOK) Code() int { + return 200 +} + +func (o *GetVMTypesOK) Error() string { + return fmt.Sprintf("[POST /api/v1/datahub/getVmTypes][%d] getVmTypesOK %+v", 200, o.Payload) +} + +func (o *GetVMTypesOK) String() string { + return fmt.Sprintf("[POST /api/v1/datahub/getVmTypes][%d] getVmTypesOK %+v", 200, o.Payload) +} + +func (o *GetVMTypesOK) GetPayload() *models.GetVMTypesResponse { + return o.Payload +} + +func (o *GetVMTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetVMTypesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetVMTypesDefault creates a GetVMTypesDefault with default headers values +func NewGetVMTypesDefault(code int) *GetVMTypesDefault { + return &GetVMTypesDefault{ + _statusCode: code, + } +} + +/* +GetVMTypesDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type GetVMTypesDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this get Vm types default response has a 2xx status code +func (o *GetVMTypesDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get Vm types default response has a 3xx status code +func (o *GetVMTypesDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get Vm types default response has a 4xx status code +func (o *GetVMTypesDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get Vm types default response has a 5xx status code +func (o *GetVMTypesDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get Vm types default response a status code equal to that given +func (o *GetVMTypesDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the get Vm types default response +func (o *GetVMTypesDefault) Code() int { + return o._statusCode +} + +func (o *GetVMTypesDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/datahub/getVmTypes][%d] getVmTypes default %+v", o._statusCode, o.Payload) +} + +func (o *GetVMTypesDefault) String() string { + return fmt.Sprintf("[POST /api/v1/datahub/getVmTypes][%d] getVmTypes default %+v", o._statusCode, o.Payload) +} + +func (o *GetVMTypesDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetVMTypesDefault) 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/cdp-sdk-go/gen/datahub/client/operations/operations_client.go b/cdp-sdk-go/gen/datahub/client/operations/operations_client.go index c5b3afbc..70815510 100644 --- a/cdp-sdk-go/gen/datahub/client/operations/operations_client.go +++ b/cdp-sdk-go/gen/datahub/client/operations/operations_client.go @@ -36,6 +36,8 @@ type ClientService interface { CreateAWSCluster(params *CreateAWSClusterParams, opts ...ClientOption) (*CreateAWSClusterOK, error) + CreateAWSGovCloudCluster(params *CreateAWSGovCloudClusterParams, opts ...ClientOption) (*CreateAWSGovCloudClusterOK, error) + CreateAutoScaleRules(params *CreateAutoScaleRulesParams, opts ...ClientOption) (*CreateAutoScaleRulesOK, error) CreateAzureCluster(params *CreateAzureClusterParams, opts ...ClientOption) (*CreateAzureClusterOK, error) @@ -74,6 +76,8 @@ type ClientService interface { DescribeCustomConfigurations(params *DescribeCustomConfigurationsParams, opts ...ClientOption) (*DescribeCustomConfigurationsOK, error) + DescribeDatabaseServer(params *DescribeDatabaseServerParams, opts ...ClientOption) (*DescribeDatabaseServerOK, error) + DescribeRecipe(params *DescribeRecipeParams, opts ...ClientOption) (*DescribeRecipeOK, error) DescribeScalingActivity(params *DescribeScalingActivityParams, opts ...ClientOption) (*DescribeScalingActivityOK, error) @@ -86,6 +90,10 @@ type ClientService interface { GetDatahubLogDescriptors(params *GetDatahubLogDescriptorsParams, opts ...ClientOption) (*GetDatahubLogDescriptorsOK, error) + GetOperation(params *GetOperationParams, opts ...ClientOption) (*GetOperationOK, error) + + GetVMTypes(params *GetVMTypesParams, opts ...ClientOption) (*GetVMTypesOK, error) + ListAutoScaleHistory(params *ListAutoScaleHistoryParams, opts ...ClientOption) (*ListAutoScaleHistoryOK, error) ListClusterDefinitions(params *ListClusterDefinitionsParams, opts ...ClientOption) (*ListClusterDefinitionsOK, error) @@ -307,6 +315,45 @@ func (a *Client) CreateAWSCluster(params *CreateAWSClusterParams, opts ...Client return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +CreateAWSGovCloudCluster creates an a w s data hub cluster for gov cloud + +Creates an AWS Data Hub cluster for GovCloud. +*/ +func (a *Client) CreateAWSGovCloudCluster(params *CreateAWSGovCloudClusterParams, opts ...ClientOption) (*CreateAWSGovCloudClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateAWSGovCloudClusterParams() + } + op := &runtime.ClientOperation{ + ID: "createAWSGovCloudCluster", + Method: "POST", + PathPattern: "/api/v1/datahub/createAWSGovCloudCluster", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateAWSGovCloudClusterReader{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.(*CreateAWSGovCloudClusterOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateAWSGovCloudClusterDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* CreateAutoScaleRules creates auto scaling rules for a data hub cluster @@ -1048,6 +1095,45 @@ func (a *Client) DescribeCustomConfigurations(params *DescribeCustomConfiguratio return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +DescribeDatabaseServer gets external database server details + +Gets external database server details for Data Hub cluster by cluster CRN +*/ +func (a *Client) DescribeDatabaseServer(params *DescribeDatabaseServerParams, opts ...ClientOption) (*DescribeDatabaseServerOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDescribeDatabaseServerParams() + } + op := &runtime.ClientOperation{ + ID: "describeDatabaseServer", + Method: "POST", + PathPattern: "/api/v1/datahub/describeDatabaseServer", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DescribeDatabaseServerReader{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.(*DescribeDatabaseServerOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DescribeDatabaseServerDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* DescribeRecipe describes recipe a recipe is a script that runs on all nodes of a specified instance group @@ -1282,6 +1368,84 @@ func (a *Client) GetDatahubLogDescriptors(params *GetDatahubLogDescriptorsParams return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +GetOperation gets the latest in progress or finished operation for the datahub cluster + +Get the latest (in progress or finished) operation for the datahub cluster. +*/ +func (a *Client) GetOperation(params *GetOperationParams, opts ...ClientOption) (*GetOperationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetOperationParams() + } + op := &runtime.ClientOperation{ + ID: "getOperation", + Method: "POST", + PathPattern: "/api/v1/datahub/getOperation", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetOperationReader{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.(*GetOperationOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetOperationDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetVMTypes creates a recommendation that advises virtual machine types for the given cluster template based on the given properties + +Creates a recommendation that advises virtual machine types for the given cluster template based on the given properties. +*/ +func (a *Client) GetVMTypes(params *GetVMTypesParams, opts ...ClientOption) (*GetVMTypesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetVMTypesParams() + } + op := &runtime.ClientOperation{ + ID: "getVmTypes", + Method: "POST", + PathPattern: "/api/v1/datahub/getVmTypes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetVMTypesReader{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.(*GetVMTypesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetVMTypesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* ListAutoScaleHistory lists auto scale history activity for a data hub cluster @@ -2104,7 +2268,7 @@ func (a *Client) StartCluster(params *StartClusterParams, opts ...ClientOption) /* StartClusterVerticalScaling initiates the vertical scaling on data hub cluster -Initiates the vertical scaling on Data Hub cluster. +Initiates the vertical scaling on Data Hub cluster. You have the option to either specify one of 'deleteDisks', 'modifyDisks' or 'addDisks' or 'instanceTemplate' as parameter. */ func (a *Client) StartClusterVerticalScaling(params *StartClusterVerticalScalingParams, opts ...ClientOption) (*StartClusterVerticalScalingOK, error) { // TODO: Validate the params before sending diff --git a/cdp-sdk-go/gen/datahub/models/cluster.go b/cdp-sdk-go/gen/datahub/models/cluster.go index e7bce03a..aa185300 100644 --- a/cdp-sdk-go/gen/datahub/models/cluster.go +++ b/cdp-sdk-go/gen/datahub/models/cluster.go @@ -56,12 +56,18 @@ type Cluster struct { // The CRN of the environment. EnvironmentCrn string `json:"environmentCrn,omitempty"` + // The name of the environment. + EnvironmentName string `json:"environmentName,omitempty"` + // The image details. ImageDetails *ImageDetails `json:"imageDetails,omitempty"` // The instance details. InstanceGroups []*InstanceGroup `json:"instanceGroups"` + // Flag that toggles the multi availability zone for the given datahub cluster when you are not sure what subnet IDs can be used. This way the subnet IDs will be used what the environment suggests. + MultiAz *bool `json:"multiAz,omitempty"` + // The cluster node count. NodeCount int32 `json:"nodeCount,omitempty"` diff --git a/cdp-sdk-go/gen/datahub/models/cluster_summary.go b/cdp-sdk-go/gen/datahub/models/cluster_summary.go index 5b322b24..98050b8a 100644 --- a/cdp-sdk-go/gen/datahub/models/cluster_summary.go +++ b/cdp-sdk-go/gen/datahub/models/cluster_summary.go @@ -48,6 +48,9 @@ type ClusterSummary struct { // The CRN of the environment. EnvironmentCrn string `json:"environmentCrn,omitempty"` + // The name of the environment. + EnvironmentName string `json:"environmentName,omitempty"` + // The cluster node count. NodeCount int32 `json:"nodeCount,omitempty"` diff --git a/cdp-sdk-go/gen/datahub/models/create_a_w_s_gov_cloud_cluster_request.go b/cdp-sdk-go/gen/datahub/models/create_a_w_s_gov_cloud_cluster_request.go new file mode 100644 index 00000000..8ba185c2 --- /dev/null +++ b/cdp-sdk-go/gen/datahub/models/create_a_w_s_gov_cloud_cluster_request.go @@ -0,0 +1,384 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateAWSGovCloudClusterRequest Request object for creating AWS Data Hub cluster request on GovCloud. +// +// swagger:model CreateAWSGovCloudClusterRequest +type CreateAWSGovCloudClusterRequest struct { + + // The name or CRN of the cluster definition to use for cluster creation. + ClusterDefinition string `json:"clusterDefinition,omitempty"` + + // Cluster extensions for the given Data Hub cluster. + ClusterExtension *ClusterExtension `json:"clusterExtension,omitempty"` + + // The name of the cluster. This name must be unique, must have between 5 and 40 characters, and must contain only lowercase letters, numbers, and hyphens. Names are case-sensitive. + // Max Length: 40 + // Min Length: 5 + ClusterName string `json:"clusterName,omitempty"` + + // Name or CRN of the cluster template to use for cluster creation. + ClusterTemplate string `json:"clusterTemplate,omitempty"` + + // Database type for datahub. Currently supported values: NONE, NON_HA, HA + DatahubDatabase DatahubDatabaseType `json:"datahubDatabase,omitempty"` + + // Flag that decides whether to provision a load-balancer to front various service endpoints for the given datahub. This will typically be used for HA cluster shapes. + EnableLoadBalancer bool `json:"enableLoadBalancer,omitempty"` + + // Name or CRN of the environment to use when creating the cluster. The environment must be an AWS GovCloud environment. + Environment string `json:"environment,omitempty"` + + // The image to be used for cluster creation. + Image *ImageRequest `json:"image,omitempty"` + + // Instance group details. + InstanceGroups []*InstanceGroupRequest `json:"instanceGroups"` + + // Configure the major version of Java on the cluster. + JavaVersion int32 `json:"javaVersion,omitempty"` + + // Flag that toggles the multi availability zone for the given Data Hub cluster when you are not sure what subnet IDs can be used. This way the subnet IDs will be used what the environment suggests. + MultiAz bool `json:"multiAz,omitempty"` + + // JSON template to use for cluster creation. This is different from the cluster template and would be removed in the future. + RequestTemplate string `json:"requestTemplate,omitempty"` + + // The subnet ID. + SubnetID string `json:"subnetId,omitempty"` + + // List of subnet IDs in case of multi availability zone setup. + SubnetIds []string `json:"subnetIds"` + + // Tags to be added to Data Hub related resources. + Tags []*DatahubResourceTagRequest `json:"tags"` +} + +// Validate validates this create a w s gov cloud cluster request +func (m *CreateAWSGovCloudClusterRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClusterExtension(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDatahubDatabase(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImage(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstanceGroups(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudClusterRequest) validateClusterExtension(formats strfmt.Registry) error { + if swag.IsZero(m.ClusterExtension) { // not required + return nil + } + + if m.ClusterExtension != nil { + if err := m.ClusterExtension.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clusterExtension") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clusterExtension") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudClusterRequest) validateClusterName(formats strfmt.Registry) error { + if swag.IsZero(m.ClusterName) { // not required + return nil + } + + if err := validate.MinLength("clusterName", "body", m.ClusterName, 5); err != nil { + return err + } + + if err := validate.MaxLength("clusterName", "body", m.ClusterName, 40); err != nil { + return err + } + + return nil +} + +func (m *CreateAWSGovCloudClusterRequest) validateDatahubDatabase(formats strfmt.Registry) error { + if swag.IsZero(m.DatahubDatabase) { // not required + return nil + } + + if err := m.DatahubDatabase.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("datahubDatabase") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("datahubDatabase") + } + return err + } + + return nil +} + +func (m *CreateAWSGovCloudClusterRequest) validateImage(formats strfmt.Registry) error { + if swag.IsZero(m.Image) { // not required + return nil + } + + if m.Image != nil { + if err := m.Image.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("image") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("image") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudClusterRequest) validateInstanceGroups(formats strfmt.Registry) error { + if swag.IsZero(m.InstanceGroups) { // not required + return nil + } + + for i := 0; i < len(m.InstanceGroups); i++ { + if swag.IsZero(m.InstanceGroups[i]) { // not required + continue + } + + if m.InstanceGroups[i] != nil { + if err := m.InstanceGroups[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("instanceGroups" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("instanceGroups" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateAWSGovCloudClusterRequest) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create a w s gov cloud cluster request based on the context it is used +func (m *CreateAWSGovCloudClusterRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateClusterExtension(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDatahubDatabase(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateImage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInstanceGroups(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudClusterRequest) contextValidateClusterExtension(ctx context.Context, formats strfmt.Registry) error { + + if m.ClusterExtension != nil { + + if swag.IsZero(m.ClusterExtension) { // not required + return nil + } + + if err := m.ClusterExtension.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clusterExtension") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("clusterExtension") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudClusterRequest) contextValidateDatahubDatabase(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.DatahubDatabase) { // not required + return nil + } + + if err := m.DatahubDatabase.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("datahubDatabase") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("datahubDatabase") + } + return err + } + + return nil +} + +func (m *CreateAWSGovCloudClusterRequest) contextValidateImage(ctx context.Context, formats strfmt.Registry) error { + + if m.Image != nil { + + if swag.IsZero(m.Image) { // not required + return nil + } + + if err := m.Image.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("image") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("image") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudClusterRequest) contextValidateInstanceGroups(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.InstanceGroups); i++ { + + if m.InstanceGroups[i] != nil { + + if swag.IsZero(m.InstanceGroups[i]) { // not required + return nil + } + + if err := m.InstanceGroups[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("instanceGroups" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("instanceGroups" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateAWSGovCloudClusterRequest) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + + if swag.IsZero(m.Tags[i]) { // not required + return nil + } + + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAWSGovCloudClusterRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAWSGovCloudClusterRequest) UnmarshalBinary(b []byte) error { + var res CreateAWSGovCloudClusterRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datahub/models/create_a_w_s_gov_cloud_cluster_response.go b/cdp-sdk-go/gen/datahub/models/create_a_w_s_gov_cloud_cluster_response.go new file mode 100644 index 00000000..8fa7e760 --- /dev/null +++ b/cdp-sdk-go/gen/datahub/models/create_a_w_s_gov_cloud_cluster_response.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateAWSGovCloudClusterResponse Response object for create AWS cluster request on GovCloud. +// +// swagger:model CreateAWSGovCloudClusterResponse +type CreateAWSGovCloudClusterResponse struct { + + // The cluster. + // Required: true + Cluster *Cluster `json:"cluster"` +} + +// Validate validates this create a w s gov cloud cluster response +func (m *CreateAWSGovCloudClusterResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCluster(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudClusterResponse) validateCluster(formats strfmt.Registry) error { + + if err := validate.Required("cluster", "body", m.Cluster); err != nil { + return err + } + + if m.Cluster != nil { + if err := m.Cluster.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create a w s gov cloud cluster response based on the context it is used +func (m *CreateAWSGovCloudClusterResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCluster(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudClusterResponse) contextValidateCluster(ctx context.Context, formats strfmt.Registry) error { + + if m.Cluster != nil { + + if err := m.Cluster.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cluster") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAWSGovCloudClusterResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAWSGovCloudClusterResponse) UnmarshalBinary(b []byte) error { + var res CreateAWSGovCloudClusterResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datahub/models/create_azure_cluster_request.go b/cdp-sdk-go/gen/datahub/models/create_azure_cluster_request.go index 46546e16..8c3ecd28 100644 --- a/cdp-sdk-go/gen/datahub/models/create_azure_cluster_request.go +++ b/cdp-sdk-go/gen/datahub/models/create_azure_cluster_request.go @@ -7,6 +7,7 @@ package models import ( "context" + "encoding/json" "strconv" "github.com/go-openapi/errors" @@ -37,6 +38,10 @@ type CreateAzureClusterRequest struct { // The name of the custom configurations to use for cluster creation. CustomConfigurationsName string `json:"customConfigurationsName,omitempty"` + // The type of the azure database. FLEXIBLE_SERVER is the next generation managed PostgreSQL service in Azure that provides maximum flexibility over your database, built-in cost-optimizations. SINGLE_SERVER is a fully managed database service with minimal requirements for customizations of the database. + // Enum: [FLEXIBLE_SERVER SINGLE_SERVER] + DatabaseType string `json:"databaseType,omitempty"` + // Database type for datahub. Currently supported values: NONE, NON_HA, HA DatahubDatabase DatahubDatabaseType `json:"datahubDatabase,omitempty"` @@ -58,6 +63,9 @@ type CreateAzureClusterRequest struct { // The SKU for the datahub load balancer. Allowed values are "BASIC", "STANDARD", or "NONE". LoadBalancerSku DatahubLoadBalancerSkuType `json:"loadBalancerSku,omitempty"` + // Flag that toggles the multi availability zone feature for the given datahub cluster when unsure what subnet IDs can be used. When true, the subnet IDs suggested by the environment will be used. + MultiAz *bool `json:"multiAz,omitempty"` + // JSON template to use for cluster creation. This is different from cluster template and would be removed in the future. RequestTemplate string `json:"requestTemplate,omitempty"` @@ -80,6 +88,10 @@ func (m *CreateAzureClusterRequest) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDatabaseType(formats); err != nil { + res = append(res, err) + } + if err := m.validateDatahubDatabase(formats); err != nil { res = append(res, err) } @@ -141,6 +153,48 @@ func (m *CreateAzureClusterRequest) validateClusterName(formats strfmt.Registry) return nil } +var createAzureClusterRequestTypeDatabaseTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["FLEXIBLE_SERVER","SINGLE_SERVER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createAzureClusterRequestTypeDatabaseTypePropEnum = append(createAzureClusterRequestTypeDatabaseTypePropEnum, v) + } +} + +const ( + + // CreateAzureClusterRequestDatabaseTypeFLEXIBLESERVER captures enum value "FLEXIBLE_SERVER" + CreateAzureClusterRequestDatabaseTypeFLEXIBLESERVER string = "FLEXIBLE_SERVER" + + // CreateAzureClusterRequestDatabaseTypeSINGLESERVER captures enum value "SINGLE_SERVER" + CreateAzureClusterRequestDatabaseTypeSINGLESERVER string = "SINGLE_SERVER" +) + +// prop value enum +func (m *CreateAzureClusterRequest) validateDatabaseTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createAzureClusterRequestTypeDatabaseTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateAzureClusterRequest) validateDatabaseType(formats strfmt.Registry) error { + if swag.IsZero(m.DatabaseType) { // not required + return nil + } + + // value enum + if err := m.validateDatabaseTypeEnum("databaseType", "body", m.DatabaseType); err != nil { + return err + } + + return nil +} + func (m *CreateAzureClusterRequest) validateDatahubDatabase(formats strfmt.Registry) error { if swag.IsZero(m.DatahubDatabase) { // not required return nil diff --git a/cdp-sdk-go/gen/datahub/models/database_server_ssl_config.go b/cdp-sdk-go/gen/datahub/models/database_server_ssl_config.go new file mode 100644 index 00000000..fd08711c --- /dev/null +++ b/cdp-sdk-go/gen/datahub/models/database_server_ssl_config.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DatabaseServerSslConfig SSL configuration for the database server +// +// swagger:model DatabaseServerSslConfig +type DatabaseServerSslConfig struct { + + // SSL certificate type + // Enum: [CLOUD_PROVIDER_OWNED BRING_YOUR_OWN NONE] + SslCertificateType string `json:"sslCertificateType,omitempty"` + + // Set of SSL certificates for the actual database server + // Unique: true + SslCertificates []string `json:"sslCertificates"` + + // SSL enforcement mode for the actual database server + // Enum: [ENABLED DISABLED] + SslMode string `json:"sslMode,omitempty"` +} + +// Validate validates this database server ssl config +func (m *DatabaseServerSslConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSslCertificateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSslCertificates(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSslMode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var databaseServerSslConfigTypeSslCertificateTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["CLOUD_PROVIDER_OWNED","BRING_YOUR_OWN","NONE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + databaseServerSslConfigTypeSslCertificateTypePropEnum = append(databaseServerSslConfigTypeSslCertificateTypePropEnum, v) + } +} + +const ( + + // DatabaseServerSslConfigSslCertificateTypeCLOUDPROVIDEROWNED captures enum value "CLOUD_PROVIDER_OWNED" + DatabaseServerSslConfigSslCertificateTypeCLOUDPROVIDEROWNED string = "CLOUD_PROVIDER_OWNED" + + // DatabaseServerSslConfigSslCertificateTypeBRINGYOUROWN captures enum value "BRING_YOUR_OWN" + DatabaseServerSslConfigSslCertificateTypeBRINGYOUROWN string = "BRING_YOUR_OWN" + + // DatabaseServerSslConfigSslCertificateTypeNONE captures enum value "NONE" + DatabaseServerSslConfigSslCertificateTypeNONE string = "NONE" +) + +// prop value enum +func (m *DatabaseServerSslConfig) validateSslCertificateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, databaseServerSslConfigTypeSslCertificateTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DatabaseServerSslConfig) validateSslCertificateType(formats strfmt.Registry) error { + if swag.IsZero(m.SslCertificateType) { // not required + return nil + } + + // value enum + if err := m.validateSslCertificateTypeEnum("sslCertificateType", "body", m.SslCertificateType); err != nil { + return err + } + + return nil +} + +func (m *DatabaseServerSslConfig) validateSslCertificates(formats strfmt.Registry) error { + if swag.IsZero(m.SslCertificates) { // not required + return nil + } + + if err := validate.UniqueItems("sslCertificates", "body", m.SslCertificates); err != nil { + return err + } + + return nil +} + +var databaseServerSslConfigTypeSslModePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ENABLED","DISABLED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + databaseServerSslConfigTypeSslModePropEnum = append(databaseServerSslConfigTypeSslModePropEnum, v) + } +} + +const ( + + // DatabaseServerSslConfigSslModeENABLED captures enum value "ENABLED" + DatabaseServerSslConfigSslModeENABLED string = "ENABLED" + + // DatabaseServerSslConfigSslModeDISABLED captures enum value "DISABLED" + DatabaseServerSslConfigSslModeDISABLED string = "DISABLED" +) + +// prop value enum +func (m *DatabaseServerSslConfig) validateSslModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, databaseServerSslConfigTypeSslModePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DatabaseServerSslConfig) validateSslMode(formats strfmt.Registry) error { + if swag.IsZero(m.SslMode) { // not required + return nil + } + + // value enum + if err := m.validateSslModeEnum("sslMode", "body", m.SslMode); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this database server ssl config based on context it is used +func (m *DatabaseServerSslConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DatabaseServerSslConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DatabaseServerSslConfig) UnmarshalBinary(b []byte) error { + var res DatabaseServerSslConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datahub/models/describe_database_server_request.go b/cdp-sdk-go/gen/datahub/models/describe_database_server_request.go new file mode 100644 index 00000000..5fe7323b --- /dev/null +++ b/cdp-sdk-go/gen/datahub/models/describe_database_server_request.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DescribeDatabaseServerRequest Request object for obtaining Database Server details. +// +// swagger:model DescribeDatabaseServerRequest +type DescribeDatabaseServerRequest struct { + + // CRN of the Data Hub cluster + ClusterCrn string `json:"clusterCrn,omitempty"` +} + +// Validate validates this describe database server request +func (m *DescribeDatabaseServerRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this describe database server request based on context it is used +func (m *DescribeDatabaseServerRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DescribeDatabaseServerRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DescribeDatabaseServerRequest) UnmarshalBinary(b []byte) error { + var res DescribeDatabaseServerRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datahub/models/describe_database_server_response.go b/cdp-sdk-go/gen/datahub/models/describe_database_server_response.go new file mode 100644 index 00000000..e72625be --- /dev/null +++ b/cdp-sdk-go/gen/datahub/models/describe_database_server_response.go @@ -0,0 +1,327 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DescribeDatabaseServerResponse Response object for obtaining Database Server details. +// +// swagger:model DescribeDatabaseServerResponse +type DescribeDatabaseServerResponse struct { + + // CRN of the cluster of the database server + ClusterCrn string `json:"clusterCrn,omitempty"` + + // Creation date of the database server + // Format: date-time + CreationDate strfmt.DateTime `json:"creationDate,omitempty"` + + // CRN of the database server + Crn string `json:"crn,omitempty"` + + // Name of the database vendor (MYSQL, POSTGRES, ...) + DatabaseVendor string `json:"databaseVendor,omitempty"` + + // Display name of the database vendor (MySQL, PostgreSQL, ...) + DatabaseVendorDisplayName string `json:"databaseVendorDisplayName,omitempty"` + + // Description of the database server + Description string `json:"description,omitempty"` + + // CRN of the environment of the database server + EnvironmentCrn string `json:"environmentCrn,omitempty"` + + // Host of the database server + Host string `json:"host,omitempty"` + + // Name of the database server + Name string `json:"name,omitempty"` + + // Port of the database server + Port int32 `json:"port,omitempty"` + + // Ownership status of the database server + // Enum: [UNKNOWN SERVICE_MANAGED USER_MANAGED] + ResourceStatus string `json:"resourceStatus,omitempty"` + + // SSL configuration of the database server + SslConfig *DatabaseServerSslConfig `json:"sslConfig,omitempty"` + + // Status of the database server stack + // Enum: [REQUESTED CREATE_IN_PROGRESS AVAILABLE UPDATE_IN_PROGRESS UPDATE_REQUESTED UPDATE_FAILED CREATE_FAILED ENABLE_SECURITY_FAILED DELETE_REQUESTED PRE_DELETE_IN_PROGRESS DELETE_IN_PROGRESS DELETE_FAILED DELETE_COMPLETED STOPPED STOP_REQUESTED START_REQUESTED STOP_IN_PROGRESS START_IN_PROGRESS START_FAILED STOP_FAILED WAIT_FOR_SYNC MAINTENANCE_MODE_ENABLED UNKNOWN] + Status string `json:"status,omitempty"` + + // Additional status information about the database server stack + StatusReason string `json:"statusReason,omitempty"` +} + +// Validate validates this describe database server response +func (m *DescribeDatabaseServerResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreationDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResourceStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSslConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DescribeDatabaseServerResponse) validateCreationDate(formats strfmt.Registry) error { + if swag.IsZero(m.CreationDate) { // not required + return nil + } + + if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { + return err + } + + return nil +} + +var describeDatabaseServerResponseTypeResourceStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["UNKNOWN","SERVICE_MANAGED","USER_MANAGED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + describeDatabaseServerResponseTypeResourceStatusPropEnum = append(describeDatabaseServerResponseTypeResourceStatusPropEnum, v) + } +} + +const ( + + // DescribeDatabaseServerResponseResourceStatusUNKNOWN captures enum value "UNKNOWN" + DescribeDatabaseServerResponseResourceStatusUNKNOWN string = "UNKNOWN" + + // DescribeDatabaseServerResponseResourceStatusSERVICEMANAGED captures enum value "SERVICE_MANAGED" + DescribeDatabaseServerResponseResourceStatusSERVICEMANAGED string = "SERVICE_MANAGED" + + // DescribeDatabaseServerResponseResourceStatusUSERMANAGED captures enum value "USER_MANAGED" + DescribeDatabaseServerResponseResourceStatusUSERMANAGED string = "USER_MANAGED" +) + +// prop value enum +func (m *DescribeDatabaseServerResponse) validateResourceStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, describeDatabaseServerResponseTypeResourceStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DescribeDatabaseServerResponse) validateResourceStatus(formats strfmt.Registry) error { + if swag.IsZero(m.ResourceStatus) { // not required + return nil + } + + // value enum + if err := m.validateResourceStatusEnum("resourceStatus", "body", m.ResourceStatus); err != nil { + return err + } + + return nil +} + +func (m *DescribeDatabaseServerResponse) validateSslConfig(formats strfmt.Registry) error { + if swag.IsZero(m.SslConfig) { // not required + return nil + } + + if m.SslConfig != nil { + if err := m.SslConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sslConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sslConfig") + } + return err + } + } + + return nil +} + +var describeDatabaseServerResponseTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["REQUESTED","CREATE_IN_PROGRESS","AVAILABLE","UPDATE_IN_PROGRESS","UPDATE_REQUESTED","UPDATE_FAILED","CREATE_FAILED","ENABLE_SECURITY_FAILED","DELETE_REQUESTED","PRE_DELETE_IN_PROGRESS","DELETE_IN_PROGRESS","DELETE_FAILED","DELETE_COMPLETED","STOPPED","STOP_REQUESTED","START_REQUESTED","STOP_IN_PROGRESS","START_IN_PROGRESS","START_FAILED","STOP_FAILED","WAIT_FOR_SYNC","MAINTENANCE_MODE_ENABLED","UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + describeDatabaseServerResponseTypeStatusPropEnum = append(describeDatabaseServerResponseTypeStatusPropEnum, v) + } +} + +const ( + + // DescribeDatabaseServerResponseStatusREQUESTED captures enum value "REQUESTED" + DescribeDatabaseServerResponseStatusREQUESTED string = "REQUESTED" + + // DescribeDatabaseServerResponseStatusCREATEINPROGRESS captures enum value "CREATE_IN_PROGRESS" + DescribeDatabaseServerResponseStatusCREATEINPROGRESS string = "CREATE_IN_PROGRESS" + + // DescribeDatabaseServerResponseStatusAVAILABLE captures enum value "AVAILABLE" + DescribeDatabaseServerResponseStatusAVAILABLE string = "AVAILABLE" + + // DescribeDatabaseServerResponseStatusUPDATEINPROGRESS captures enum value "UPDATE_IN_PROGRESS" + DescribeDatabaseServerResponseStatusUPDATEINPROGRESS string = "UPDATE_IN_PROGRESS" + + // DescribeDatabaseServerResponseStatusUPDATEREQUESTED captures enum value "UPDATE_REQUESTED" + DescribeDatabaseServerResponseStatusUPDATEREQUESTED string = "UPDATE_REQUESTED" + + // DescribeDatabaseServerResponseStatusUPDATEFAILED captures enum value "UPDATE_FAILED" + DescribeDatabaseServerResponseStatusUPDATEFAILED string = "UPDATE_FAILED" + + // DescribeDatabaseServerResponseStatusCREATEFAILED captures enum value "CREATE_FAILED" + DescribeDatabaseServerResponseStatusCREATEFAILED string = "CREATE_FAILED" + + // DescribeDatabaseServerResponseStatusENABLESECURITYFAILED captures enum value "ENABLE_SECURITY_FAILED" + DescribeDatabaseServerResponseStatusENABLESECURITYFAILED string = "ENABLE_SECURITY_FAILED" + + // DescribeDatabaseServerResponseStatusDELETEREQUESTED captures enum value "DELETE_REQUESTED" + DescribeDatabaseServerResponseStatusDELETEREQUESTED string = "DELETE_REQUESTED" + + // DescribeDatabaseServerResponseStatusPREDELETEINPROGRESS captures enum value "PRE_DELETE_IN_PROGRESS" + DescribeDatabaseServerResponseStatusPREDELETEINPROGRESS string = "PRE_DELETE_IN_PROGRESS" + + // DescribeDatabaseServerResponseStatusDELETEINPROGRESS captures enum value "DELETE_IN_PROGRESS" + DescribeDatabaseServerResponseStatusDELETEINPROGRESS string = "DELETE_IN_PROGRESS" + + // DescribeDatabaseServerResponseStatusDELETEFAILED captures enum value "DELETE_FAILED" + DescribeDatabaseServerResponseStatusDELETEFAILED string = "DELETE_FAILED" + + // DescribeDatabaseServerResponseStatusDELETECOMPLETED captures enum value "DELETE_COMPLETED" + DescribeDatabaseServerResponseStatusDELETECOMPLETED string = "DELETE_COMPLETED" + + // DescribeDatabaseServerResponseStatusSTOPPED captures enum value "STOPPED" + DescribeDatabaseServerResponseStatusSTOPPED string = "STOPPED" + + // DescribeDatabaseServerResponseStatusSTOPREQUESTED captures enum value "STOP_REQUESTED" + DescribeDatabaseServerResponseStatusSTOPREQUESTED string = "STOP_REQUESTED" + + // DescribeDatabaseServerResponseStatusSTARTREQUESTED captures enum value "START_REQUESTED" + DescribeDatabaseServerResponseStatusSTARTREQUESTED string = "START_REQUESTED" + + // DescribeDatabaseServerResponseStatusSTOPINPROGRESS captures enum value "STOP_IN_PROGRESS" + DescribeDatabaseServerResponseStatusSTOPINPROGRESS string = "STOP_IN_PROGRESS" + + // DescribeDatabaseServerResponseStatusSTARTINPROGRESS captures enum value "START_IN_PROGRESS" + DescribeDatabaseServerResponseStatusSTARTINPROGRESS string = "START_IN_PROGRESS" + + // DescribeDatabaseServerResponseStatusSTARTFAILED captures enum value "START_FAILED" + DescribeDatabaseServerResponseStatusSTARTFAILED string = "START_FAILED" + + // DescribeDatabaseServerResponseStatusSTOPFAILED captures enum value "STOP_FAILED" + DescribeDatabaseServerResponseStatusSTOPFAILED string = "STOP_FAILED" + + // DescribeDatabaseServerResponseStatusWAITFORSYNC captures enum value "WAIT_FOR_SYNC" + DescribeDatabaseServerResponseStatusWAITFORSYNC string = "WAIT_FOR_SYNC" + + // DescribeDatabaseServerResponseStatusMAINTENANCEMODEENABLED captures enum value "MAINTENANCE_MODE_ENABLED" + DescribeDatabaseServerResponseStatusMAINTENANCEMODEENABLED string = "MAINTENANCE_MODE_ENABLED" + + // DescribeDatabaseServerResponseStatusUNKNOWN captures enum value "UNKNOWN" + DescribeDatabaseServerResponseStatusUNKNOWN string = "UNKNOWN" +) + +// prop value enum +func (m *DescribeDatabaseServerResponse) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, describeDatabaseServerResponseTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DescribeDatabaseServerResponse) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this describe database server response based on the context it is used +func (m *DescribeDatabaseServerResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSslConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DescribeDatabaseServerResponse) contextValidateSslConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.SslConfig != nil { + + if swag.IsZero(m.SslConfig) { // not required + return nil + } + + if err := m.SslConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sslConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sslConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DescribeDatabaseServerResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DescribeDatabaseServerResponse) UnmarshalBinary(b []byte) error { + var res DescribeDatabaseServerResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datahub/models/disk_options.go b/cdp-sdk-go/gen/datahub/models/disk_options.go new file mode 100644 index 00000000..8a3d4911 --- /dev/null +++ b/cdp-sdk-go/gen/datahub/models/disk_options.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DiskOptions Attached disk configuration(s). +// +// swagger:model DiskOptions +type DiskOptions struct { + + // Modifies all the disks attached to all instances in a group. + ModifyDisks *ModifyDisks `json:"modifyDisks,omitempty"` +} + +// Validate validates this disk options +func (m *DiskOptions) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateModifyDisks(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DiskOptions) validateModifyDisks(formats strfmt.Registry) error { + if swag.IsZero(m.ModifyDisks) { // not required + return nil + } + + if m.ModifyDisks != nil { + if err := m.ModifyDisks.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modifyDisks") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modifyDisks") + } + return err + } + } + + return nil +} + +// ContextValidate validate this disk options based on the context it is used +func (m *DiskOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateModifyDisks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DiskOptions) contextValidateModifyDisks(ctx context.Context, formats strfmt.Registry) error { + + if m.ModifyDisks != nil { + + if swag.IsZero(m.ModifyDisks) { // not required + return nil + } + + if err := m.ModifyDisks.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modifyDisks") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modifyDisks") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DiskOptions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DiskOptions) UnmarshalBinary(b []byte) error { + var res DiskOptions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datahub/models/get_operation_request.go b/cdp-sdk-go/gen/datahub/models/get_operation_request.go new file mode 100644 index 00000000..0ffef419 --- /dev/null +++ b/cdp-sdk-go/gen/datahub/models/get_operation_request.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GetOperationRequest Request object for tracking the latest (current/last) operation on the datahub resource. +// +// swagger:model GetOperationRequest +type GetOperationRequest struct { + + // CRN of the datahub resource. + // Required: true + Crn *string `json:"crn"` + + // Filter by operation id. + OperationID string `json:"operationId,omitempty"` +} + +// Validate validates this get operation request +func (m *GetOperationRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCrn(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetOperationRequest) validateCrn(formats strfmt.Registry) error { + + if err := validate.Required("crn", "body", m.Crn); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this get operation request based on context it is used +func (m *GetOperationRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetOperationRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetOperationRequest) UnmarshalBinary(b []byte) error { + var res GetOperationRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datahub/models/get_operation_response.go b/cdp-sdk-go/gen/datahub/models/get_operation_response.go new file mode 100644 index 00000000..c53c08ee --- /dev/null +++ b/cdp-sdk-go/gen/datahub/models/get_operation_response.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GetOperationResponse Response object for tracking the latest (current/last) operation on the datahub resource. +// +// swagger:model GetOperationResponse +type GetOperationResponse struct { + + // Identifier of the operation. + OperationID string `json:"operationId,omitempty"` + + // Status of the operation. + // Enum: [UNKNOWN RUNNING FAILED FINISHED CANCELLED] + OperationStatus string `json:"operationStatus,omitempty"` + + // Type of the operation. + OperationType string `json:"operationType,omitempty"` + + // Progress percentage of the operation. + Progress int32 `json:"progress,omitempty"` +} + +// Validate validates this get operation response +func (m *GetOperationResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperationStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var getOperationResponseTypeOperationStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["UNKNOWN","RUNNING","FAILED","FINISHED","CANCELLED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + getOperationResponseTypeOperationStatusPropEnum = append(getOperationResponseTypeOperationStatusPropEnum, v) + } +} + +const ( + + // GetOperationResponseOperationStatusUNKNOWN captures enum value "UNKNOWN" + GetOperationResponseOperationStatusUNKNOWN string = "UNKNOWN" + + // GetOperationResponseOperationStatusRUNNING captures enum value "RUNNING" + GetOperationResponseOperationStatusRUNNING string = "RUNNING" + + // GetOperationResponseOperationStatusFAILED captures enum value "FAILED" + GetOperationResponseOperationStatusFAILED string = "FAILED" + + // GetOperationResponseOperationStatusFINISHED captures enum value "FINISHED" + GetOperationResponseOperationStatusFINISHED string = "FINISHED" + + // GetOperationResponseOperationStatusCANCELLED captures enum value "CANCELLED" + GetOperationResponseOperationStatusCANCELLED string = "CANCELLED" +) + +// prop value enum +func (m *GetOperationResponse) validateOperationStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, getOperationResponseTypeOperationStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *GetOperationResponse) validateOperationStatus(formats strfmt.Registry) error { + if swag.IsZero(m.OperationStatus) { // not required + return nil + } + + // value enum + if err := m.validateOperationStatusEnum("operationStatus", "body", m.OperationStatus); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this get operation response based on context it is used +func (m *GetOperationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetOperationResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetOperationResponse) UnmarshalBinary(b []byte) error { + var res GetOperationResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datahub/models/get_vm_types_request.go b/cdp-sdk-go/gen/datahub/models/get_vm_types_request.go new file mode 100644 index 00000000..745092b6 --- /dev/null +++ b/cdp-sdk-go/gen/datahub/models/get_vm_types_request.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GetVMTypesRequest Request object for fetching the available virtual machine types based on the given parameters. +// +// swagger:model GetVmTypesRequest +type GetVMTypesRequest struct { + + // The selected availability zone. + AvailabilityZone string `json:"availabilityZone,omitempty"` + + // The name of the cluster definition. + ClusterDefinitionName string `json:"clusterDefinitionName,omitempty"` + + // The name of the given cluster template. + // Required: true + ClusterTemplate *string `json:"clusterTemplate"` + + // The name or CRN of the credential that is required to access the cloud provider. + // Required: true + Credential *string `json:"credential"` + + // The region where we should look for the supported VM types. + // Required: true + Region *string `json:"region"` +} + +// Validate validates this get Vm types request +func (m *GetVMTypesRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClusterTemplate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCredential(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetVMTypesRequest) validateClusterTemplate(formats strfmt.Registry) error { + + if err := validate.Required("clusterTemplate", "body", m.ClusterTemplate); err != nil { + return err + } + + return nil +} + +func (m *GetVMTypesRequest) validateCredential(formats strfmt.Registry) error { + + if err := validate.Required("credential", "body", m.Credential); err != nil { + return err + } + + return nil +} + +func (m *GetVMTypesRequest) validateRegion(formats strfmt.Registry) error { + + if err := validate.Required("region", "body", m.Region); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this get Vm types request based on context it is used +func (m *GetVMTypesRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetVMTypesRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetVMTypesRequest) UnmarshalBinary(b []byte) error { + var res GetVMTypesRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datahub/models/get_vm_types_response.go b/cdp-sdk-go/gen/datahub/models/get_vm_types_response.go new file mode 100644 index 00000000..84aeaa06 --- /dev/null +++ b/cdp-sdk-go/gen/datahub/models/get_vm_types_response.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetVMTypesResponse Response object from the VM type fetch operation. +// +// swagger:model GetVmTypesResponse +type GetVMTypesResponse struct { + + // The supported VM types based on the given parameters. + VMTypes []string `json:"vmTypes"` +} + +// Validate validates this get Vm types response +func (m *GetVMTypesResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get Vm types response based on context it is used +func (m *GetVMTypesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetVMTypesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetVMTypesResponse) UnmarshalBinary(b []byte) error { + var res GetVMTypesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datahub/models/image_details.go b/cdp-sdk-go/gen/datahub/models/image_details.go index 394116c2..0e1ead8f 100644 --- a/cdp-sdk-go/gen/datahub/models/image_details.go +++ b/cdp-sdk-go/gen/datahub/models/image_details.go @@ -28,6 +28,9 @@ type ImageDetails struct { // The name of the image used for cluster instances. Name string `json:"name,omitempty"` + + // The OS of the image used for cluster instances. + Os string `json:"os,omitempty"` } // Validate validates this image details diff --git a/cdp-sdk-go/gen/datahub/models/image_request.go b/cdp-sdk-go/gen/datahub/models/image_request.go index a16c2ed4..3ee1aa60 100644 --- a/cdp-sdk-go/gen/datahub/models/image_request.go +++ b/cdp-sdk-go/gen/datahub/models/image_request.go @@ -8,10 +8,8 @@ package models import ( "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/go-openapi/validate" ) // ImageRequest The details of the image used for cluster instances. @@ -20,47 +18,17 @@ import ( type ImageRequest struct { // The image catalog name. - // Required: true - CatalogName *string `json:"catalogName"` + CatalogName string `json:"catalogName,omitempty"` // The ID of the image used for cluster instances. This is generated by the cloud provider to uniquely identify the image. - // Required: true - ID *string `json:"id"` + ID string `json:"id,omitempty"` + + // The OS of the image used for cluster instances. + Os string `json:"os,omitempty"` } // Validate validates this image request func (m *ImageRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCatalogName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ImageRequest) validateCatalogName(formats strfmt.Registry) error { - - if err := validate.Required("catalogName", "body", m.CatalogName); err != nil { - return err - } - - return nil -} - -func (m *ImageRequest) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - return nil } diff --git a/cdp-sdk-go/gen/datahub/models/modify_disks.go b/cdp-sdk-go/gen/datahub/models/modify_disks.go new file mode 100644 index 00000000..798d9677 --- /dev/null +++ b/cdp-sdk-go/gen/datahub/models/modify_disks.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModifyDisks Attached volume configuration. +// +// swagger:model ModifyDisks +type ModifyDisks struct { + + // Size of disks to modify on all the instances in a group in GB. + // Required: true + Size *int32 `json:"size"` + + // Type of disks to modify on all the instances in a group. + // Required: true + VolumeType *string `json:"volumeType"` +} + +// Validate validates this modify disks +func (m *ModifyDisks) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSize(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVolumeType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModifyDisks) validateSize(formats strfmt.Registry) error { + + if err := validate.Required("size", "body", m.Size); err != nil { + return err + } + + return nil +} + +func (m *ModifyDisks) validateVolumeType(formats strfmt.Registry) error { + + if err := validate.Required("volumeType", "body", m.VolumeType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this modify disks based on context it is used +func (m *ModifyDisks) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModifyDisks) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModifyDisks) UnmarshalBinary(b []byte) error { + var res ModifyDisks + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datahub/models/start_cluster_vertical_scaling_request.go b/cdp-sdk-go/gen/datahub/models/start_cluster_vertical_scaling_request.go index c49aa980..99f760bc 100644 --- a/cdp-sdk-go/gen/datahub/models/start_cluster_vertical_scaling_request.go +++ b/cdp-sdk-go/gen/datahub/models/start_cluster_vertical_scaling_request.go @@ -23,13 +23,15 @@ type StartClusterVerticalScalingRequest struct { // Required: true Datahub *string `json:"datahub"` + // Disk options for vertical scaling. Available options are - add, remove, or modify. + DiskOptions *DiskOptions `json:"diskOptions,omitempty"` + // The target group that reqested for vertical scaling. // Required: true Group *string `json:"group"` // Instance template that specifies the core information for the vertical scale. - // Required: true - InstanceTemplate *InstanceTemplate `json:"instanceTemplate"` + InstanceTemplate *InstanceTemplate `json:"instanceTemplate,omitempty"` } // Validate validates this start cluster vertical scaling request @@ -40,6 +42,10 @@ func (m *StartClusterVerticalScalingRequest) Validate(formats strfmt.Registry) e res = append(res, err) } + if err := m.validateDiskOptions(formats); err != nil { + res = append(res, err) + } + if err := m.validateGroup(formats); err != nil { res = append(res, err) } @@ -63,6 +69,25 @@ func (m *StartClusterVerticalScalingRequest) validateDatahub(formats strfmt.Regi return nil } +func (m *StartClusterVerticalScalingRequest) validateDiskOptions(formats strfmt.Registry) error { + if swag.IsZero(m.DiskOptions) { // not required + return nil + } + + if m.DiskOptions != nil { + if err := m.DiskOptions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("diskOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("diskOptions") + } + return err + } + } + + return nil +} + func (m *StartClusterVerticalScalingRequest) validateGroup(formats strfmt.Registry) error { if err := validate.Required("group", "body", m.Group); err != nil { @@ -73,9 +98,8 @@ func (m *StartClusterVerticalScalingRequest) validateGroup(formats strfmt.Regist } func (m *StartClusterVerticalScalingRequest) validateInstanceTemplate(formats strfmt.Registry) error { - - if err := validate.Required("instanceTemplate", "body", m.InstanceTemplate); err != nil { - return err + if swag.IsZero(m.InstanceTemplate) { // not required + return nil } if m.InstanceTemplate != nil { @@ -96,6 +120,10 @@ func (m *StartClusterVerticalScalingRequest) validateInstanceTemplate(formats st func (m *StartClusterVerticalScalingRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateDiskOptions(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateInstanceTemplate(ctx, formats); err != nil { res = append(res, err) } @@ -106,10 +134,35 @@ func (m *StartClusterVerticalScalingRequest) ContextValidate(ctx context.Context return nil } +func (m *StartClusterVerticalScalingRequest) contextValidateDiskOptions(ctx context.Context, formats strfmt.Registry) error { + + if m.DiskOptions != nil { + + if swag.IsZero(m.DiskOptions) { // not required + return nil + } + + if err := m.DiskOptions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("diskOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("diskOptions") + } + return err + } + } + + return nil +} + func (m *StartClusterVerticalScalingRequest) contextValidateInstanceTemplate(ctx context.Context, formats strfmt.Registry) error { if m.InstanceTemplate != nil { + if swag.IsZero(m.InstanceTemplate) { // not required + return nil + } + if err := m.InstanceTemplate.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("instanceTemplate") diff --git a/cdp-sdk-go/gen/datahub/models/start_database_upgrade_request.go b/cdp-sdk-go/gen/datahub/models/start_database_upgrade_request.go index 205d9bc6..8ca42c2b 100644 --- a/cdp-sdk-go/gen/datahub/models/start_database_upgrade_request.go +++ b/cdp-sdk-go/gen/datahub/models/start_database_upgrade_request.go @@ -24,8 +24,11 @@ type StartDatabaseUpgradeRequest struct { // Required: true Cluster *string `json:"cluster"` + // Start the database upgrade flow even if the source and target versions are the same. Can be used to reinitiate an upgrade after a failure. + Force bool `json:"force,omitempty"` + // The database engine major version to upgrade to. - // Enum: [VERSION_11] + // Enum: [VERSION_11 VERSION_14] TargetVersion string `json:"targetVersion,omitempty"` } @@ -60,7 +63,7 @@ var startDatabaseUpgradeRequestTypeTargetVersionPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["VERSION_11"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["VERSION_11","VERSION_14"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -72,6 +75,9 @@ const ( // StartDatabaseUpgradeRequestTargetVersionVERSION11 captures enum value "VERSION_11" StartDatabaseUpgradeRequestTargetVersionVERSION11 string = "VERSION_11" + + // StartDatabaseUpgradeRequestTargetVersionVERSION14 captures enum value "VERSION_14" + StartDatabaseUpgradeRequestTargetVersionVERSION14 string = "VERSION_14" ) // prop value enum diff --git a/cdp-sdk-go/gen/datahub/models/start_database_upgrade_response.go b/cdp-sdk-go/gen/datahub/models/start_database_upgrade_response.go index 3ea4f4d8..74cbb449 100644 --- a/cdp-sdk-go/gen/datahub/models/start_database_upgrade_response.go +++ b/cdp-sdk-go/gen/datahub/models/start_database_upgrade_response.go @@ -7,12 +7,9 @@ package models import ( "context" - "encoding/json" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/go-openapi/validate" ) // StartDatabaseUpgradeResponse Response object to Data Hub database upgrade. @@ -21,60 +18,11 @@ import ( type StartDatabaseUpgradeResponse struct { // The database engine major version to upgrade to. - // Enum: [VERSION_11] TargetVersion string `json:"targetVersion,omitempty"` } // Validate validates this start database upgrade response func (m *StartDatabaseUpgradeResponse) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTargetVersion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var startDatabaseUpgradeResponseTypeTargetVersionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["VERSION_11"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - startDatabaseUpgradeResponseTypeTargetVersionPropEnum = append(startDatabaseUpgradeResponseTypeTargetVersionPropEnum, v) - } -} - -const ( - - // StartDatabaseUpgradeResponseTargetVersionVERSION11 captures enum value "VERSION_11" - StartDatabaseUpgradeResponseTargetVersionVERSION11 string = "VERSION_11" -) - -// prop value enum -func (m *StartDatabaseUpgradeResponse) validateTargetVersionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, startDatabaseUpgradeResponseTypeTargetVersionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *StartDatabaseUpgradeResponse) validateTargetVersion(formats strfmt.Registry) error { - if swag.IsZero(m.TargetVersion) { // not required - return nil - } - - // value enum - if err := m.validateTargetVersionEnum("targetVersion", "body", m.TargetVersion); err != nil { - return err - } - return nil } diff --git a/cdp-sdk-go/gen/datalake/client/operations/create_a_w_s_gov_cloud_datalake_parameters.go b/cdp-sdk-go/gen/datalake/client/operations/create_a_w_s_gov_cloud_datalake_parameters.go new file mode 100644 index 00000000..f2ae1a58 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/client/operations/create_a_w_s_gov_cloud_datalake_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datalake/models" +) + +// NewCreateAWSGovCloudDatalakeParams creates a new CreateAWSGovCloudDatalakeParams 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 NewCreateAWSGovCloudDatalakeParams() *CreateAWSGovCloudDatalakeParams { + return &CreateAWSGovCloudDatalakeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateAWSGovCloudDatalakeParamsWithTimeout creates a new CreateAWSGovCloudDatalakeParams object +// with the ability to set a timeout on a request. +func NewCreateAWSGovCloudDatalakeParamsWithTimeout(timeout time.Duration) *CreateAWSGovCloudDatalakeParams { + return &CreateAWSGovCloudDatalakeParams{ + timeout: timeout, + } +} + +// NewCreateAWSGovCloudDatalakeParamsWithContext creates a new CreateAWSGovCloudDatalakeParams object +// with the ability to set a context for a request. +func NewCreateAWSGovCloudDatalakeParamsWithContext(ctx context.Context) *CreateAWSGovCloudDatalakeParams { + return &CreateAWSGovCloudDatalakeParams{ + Context: ctx, + } +} + +// NewCreateAWSGovCloudDatalakeParamsWithHTTPClient creates a new CreateAWSGovCloudDatalakeParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateAWSGovCloudDatalakeParamsWithHTTPClient(client *http.Client) *CreateAWSGovCloudDatalakeParams { + return &CreateAWSGovCloudDatalakeParams{ + HTTPClient: client, + } +} + +/* +CreateAWSGovCloudDatalakeParams contains all the parameters to send to the API endpoint + + for the create a w s gov cloud datalake operation. + + Typically these are written to a http.Request. +*/ +type CreateAWSGovCloudDatalakeParams struct { + + // Input. + Input *models.CreateAWSGovCloudDatalakeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create a w s gov cloud datalake params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAWSGovCloudDatalakeParams) WithDefaults() *CreateAWSGovCloudDatalakeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create a w s gov cloud datalake params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAWSGovCloudDatalakeParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create a w s gov cloud datalake params +func (o *CreateAWSGovCloudDatalakeParams) WithTimeout(timeout time.Duration) *CreateAWSGovCloudDatalakeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create a w s gov cloud datalake params +func (o *CreateAWSGovCloudDatalakeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create a w s gov cloud datalake params +func (o *CreateAWSGovCloudDatalakeParams) WithContext(ctx context.Context) *CreateAWSGovCloudDatalakeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create a w s gov cloud datalake params +func (o *CreateAWSGovCloudDatalakeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create a w s gov cloud datalake params +func (o *CreateAWSGovCloudDatalakeParams) WithHTTPClient(client *http.Client) *CreateAWSGovCloudDatalakeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create a w s gov cloud datalake params +func (o *CreateAWSGovCloudDatalakeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the create a w s gov cloud datalake params +func (o *CreateAWSGovCloudDatalakeParams) WithInput(input *models.CreateAWSGovCloudDatalakeRequest) *CreateAWSGovCloudDatalakeParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the create a w s gov cloud datalake params +func (o *CreateAWSGovCloudDatalakeParams) SetInput(input *models.CreateAWSGovCloudDatalakeRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateAWSGovCloudDatalakeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/datalake/client/operations/create_a_w_s_gov_cloud_datalake_responses.go b/cdp-sdk-go/gen/datalake/client/operations/create_a_w_s_gov_cloud_datalake_responses.go new file mode 100644 index 00000000..00bb8c6a --- /dev/null +++ b/cdp-sdk-go/gen/datalake/client/operations/create_a_w_s_gov_cloud_datalake_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datalake/models" +) + +// CreateAWSGovCloudDatalakeReader is a Reader for the CreateAWSGovCloudDatalake structure. +type CreateAWSGovCloudDatalakeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateAWSGovCloudDatalakeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateAWSGovCloudDatalakeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreateAWSGovCloudDatalakeDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCreateAWSGovCloudDatalakeOK creates a CreateAWSGovCloudDatalakeOK with default headers values +func NewCreateAWSGovCloudDatalakeOK() *CreateAWSGovCloudDatalakeOK { + return &CreateAWSGovCloudDatalakeOK{} +} + +/* +CreateAWSGovCloudDatalakeOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type CreateAWSGovCloudDatalakeOK struct { + Payload *models.CreateAWSGovCloudDatalakeResponse +} + +// IsSuccess returns true when this create a w s gov cloud datalake o k response has a 2xx status code +func (o *CreateAWSGovCloudDatalakeOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create a w s gov cloud datalake o k response has a 3xx status code +func (o *CreateAWSGovCloudDatalakeOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create a w s gov cloud datalake o k response has a 4xx status code +func (o *CreateAWSGovCloudDatalakeOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create a w s gov cloud datalake o k response has a 5xx status code +func (o *CreateAWSGovCloudDatalakeOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create a w s gov cloud datalake o k response a status code equal to that given +func (o *CreateAWSGovCloudDatalakeOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create a w s gov cloud datalake o k response +func (o *CreateAWSGovCloudDatalakeOK) Code() int { + return 200 +} + +func (o *CreateAWSGovCloudDatalakeOK) Error() string { + return fmt.Sprintf("[POST /api/v1/datalake/createAWSGovCloudDatalake][%d] createAWSGovCloudDatalakeOK %+v", 200, o.Payload) +} + +func (o *CreateAWSGovCloudDatalakeOK) String() string { + return fmt.Sprintf("[POST /api/v1/datalake/createAWSGovCloudDatalake][%d] createAWSGovCloudDatalakeOK %+v", 200, o.Payload) +} + +func (o *CreateAWSGovCloudDatalakeOK) GetPayload() *models.CreateAWSGovCloudDatalakeResponse { + return o.Payload +} + +func (o *CreateAWSGovCloudDatalakeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CreateAWSGovCloudDatalakeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateAWSGovCloudDatalakeDefault creates a CreateAWSGovCloudDatalakeDefault with default headers values +func NewCreateAWSGovCloudDatalakeDefault(code int) *CreateAWSGovCloudDatalakeDefault { + return &CreateAWSGovCloudDatalakeDefault{ + _statusCode: code, + } +} + +/* +CreateAWSGovCloudDatalakeDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type CreateAWSGovCloudDatalakeDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this create a w s gov cloud datalake default response has a 2xx status code +func (o *CreateAWSGovCloudDatalakeDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this create a w s gov cloud datalake default response has a 3xx status code +func (o *CreateAWSGovCloudDatalakeDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this create a w s gov cloud datalake default response has a 4xx status code +func (o *CreateAWSGovCloudDatalakeDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this create a w s gov cloud datalake default response has a 5xx status code +func (o *CreateAWSGovCloudDatalakeDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this create a w s gov cloud datalake default response a status code equal to that given +func (o *CreateAWSGovCloudDatalakeDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the create a w s gov cloud datalake default response +func (o *CreateAWSGovCloudDatalakeDefault) Code() int { + return o._statusCode +} + +func (o *CreateAWSGovCloudDatalakeDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/datalake/createAWSGovCloudDatalake][%d] createAWSGovCloudDatalake default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAWSGovCloudDatalakeDefault) String() string { + return fmt.Sprintf("[POST /api/v1/datalake/createAWSGovCloudDatalake][%d] createAWSGovCloudDatalake default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAWSGovCloudDatalakeDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *CreateAWSGovCloudDatalakeDefault) 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/cdp-sdk-go/gen/datalake/client/operations/describe_database_server_parameters.go b/cdp-sdk-go/gen/datalake/client/operations/describe_database_server_parameters.go new file mode 100644 index 00000000..1fa53307 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/client/operations/describe_database_server_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datalake/models" +) + +// NewDescribeDatabaseServerParams creates a new DescribeDatabaseServerParams 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 NewDescribeDatabaseServerParams() *DescribeDatabaseServerParams { + return &DescribeDatabaseServerParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDescribeDatabaseServerParamsWithTimeout creates a new DescribeDatabaseServerParams object +// with the ability to set a timeout on a request. +func NewDescribeDatabaseServerParamsWithTimeout(timeout time.Duration) *DescribeDatabaseServerParams { + return &DescribeDatabaseServerParams{ + timeout: timeout, + } +} + +// NewDescribeDatabaseServerParamsWithContext creates a new DescribeDatabaseServerParams object +// with the ability to set a context for a request. +func NewDescribeDatabaseServerParamsWithContext(ctx context.Context) *DescribeDatabaseServerParams { + return &DescribeDatabaseServerParams{ + Context: ctx, + } +} + +// NewDescribeDatabaseServerParamsWithHTTPClient creates a new DescribeDatabaseServerParams object +// with the ability to set a custom HTTPClient for a request. +func NewDescribeDatabaseServerParamsWithHTTPClient(client *http.Client) *DescribeDatabaseServerParams { + return &DescribeDatabaseServerParams{ + HTTPClient: client, + } +} + +/* +DescribeDatabaseServerParams contains all the parameters to send to the API endpoint + + for the describe database server operation. + + Typically these are written to a http.Request. +*/ +type DescribeDatabaseServerParams struct { + + // Input. + Input *models.DescribeDatabaseServerRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the describe database server params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DescribeDatabaseServerParams) WithDefaults() *DescribeDatabaseServerParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the describe database server params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DescribeDatabaseServerParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the describe database server params +func (o *DescribeDatabaseServerParams) WithTimeout(timeout time.Duration) *DescribeDatabaseServerParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the describe database server params +func (o *DescribeDatabaseServerParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the describe database server params +func (o *DescribeDatabaseServerParams) WithContext(ctx context.Context) *DescribeDatabaseServerParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the describe database server params +func (o *DescribeDatabaseServerParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the describe database server params +func (o *DescribeDatabaseServerParams) WithHTTPClient(client *http.Client) *DescribeDatabaseServerParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the describe database server params +func (o *DescribeDatabaseServerParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the describe database server params +func (o *DescribeDatabaseServerParams) WithInput(input *models.DescribeDatabaseServerRequest) *DescribeDatabaseServerParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the describe database server params +func (o *DescribeDatabaseServerParams) SetInput(input *models.DescribeDatabaseServerRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *DescribeDatabaseServerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/datalake/client/operations/describe_database_server_responses.go b/cdp-sdk-go/gen/datalake/client/operations/describe_database_server_responses.go new file mode 100644 index 00000000..e3f1cc3e --- /dev/null +++ b/cdp-sdk-go/gen/datalake/client/operations/describe_database_server_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datalake/models" +) + +// DescribeDatabaseServerReader is a Reader for the DescribeDatabaseServer structure. +type DescribeDatabaseServerReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DescribeDatabaseServerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDescribeDatabaseServerOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDescribeDatabaseServerDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDescribeDatabaseServerOK creates a DescribeDatabaseServerOK with default headers values +func NewDescribeDatabaseServerOK() *DescribeDatabaseServerOK { + return &DescribeDatabaseServerOK{} +} + +/* +DescribeDatabaseServerOK describes a response with status code 200, with default header values. + +Database server details for the requested resource. +*/ +type DescribeDatabaseServerOK struct { + Payload *models.DescribeDatabaseServerResponse +} + +// IsSuccess returns true when this describe database server o k response has a 2xx status code +func (o *DescribeDatabaseServerOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this describe database server o k response has a 3xx status code +func (o *DescribeDatabaseServerOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this describe database server o k response has a 4xx status code +func (o *DescribeDatabaseServerOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this describe database server o k response has a 5xx status code +func (o *DescribeDatabaseServerOK) IsServerError() bool { + return false +} + +// IsCode returns true when this describe database server o k response a status code equal to that given +func (o *DescribeDatabaseServerOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the describe database server o k response +func (o *DescribeDatabaseServerOK) Code() int { + return 200 +} + +func (o *DescribeDatabaseServerOK) Error() string { + return fmt.Sprintf("[POST /api/v1/datalake/describeDatabaseServer][%d] describeDatabaseServerOK %+v", 200, o.Payload) +} + +func (o *DescribeDatabaseServerOK) String() string { + return fmt.Sprintf("[POST /api/v1/datalake/describeDatabaseServer][%d] describeDatabaseServerOK %+v", 200, o.Payload) +} + +func (o *DescribeDatabaseServerOK) GetPayload() *models.DescribeDatabaseServerResponse { + return o.Payload +} + +func (o *DescribeDatabaseServerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DescribeDatabaseServerResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDescribeDatabaseServerDefault creates a DescribeDatabaseServerDefault with default headers values +func NewDescribeDatabaseServerDefault(code int) *DescribeDatabaseServerDefault { + return &DescribeDatabaseServerDefault{ + _statusCode: code, + } +} + +/* +DescribeDatabaseServerDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type DescribeDatabaseServerDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this describe database server default response has a 2xx status code +func (o *DescribeDatabaseServerDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this describe database server default response has a 3xx status code +func (o *DescribeDatabaseServerDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this describe database server default response has a 4xx status code +func (o *DescribeDatabaseServerDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this describe database server default response has a 5xx status code +func (o *DescribeDatabaseServerDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this describe database server default response a status code equal to that given +func (o *DescribeDatabaseServerDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the describe database server default response +func (o *DescribeDatabaseServerDefault) Code() int { + return o._statusCode +} + +func (o *DescribeDatabaseServerDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/datalake/describeDatabaseServer][%d] describeDatabaseServer default %+v", o._statusCode, o.Payload) +} + +func (o *DescribeDatabaseServerDefault) String() string { + return fmt.Sprintf("[POST /api/v1/datalake/describeDatabaseServer][%d] describeDatabaseServer default %+v", o._statusCode, o.Payload) +} + +func (o *DescribeDatabaseServerDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *DescribeDatabaseServerDefault) 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/cdp-sdk-go/gen/datalake/client/operations/operations_client.go b/cdp-sdk-go/gen/datalake/client/operations/operations_client.go index 3b525e9c..53ca798d 100644 --- a/cdp-sdk-go/gen/datalake/client/operations/operations_client.go +++ b/cdp-sdk-go/gen/datalake/client/operations/operations_client.go @@ -42,12 +42,16 @@ type ClientService interface { CreateAWSDatalake(params *CreateAWSDatalakeParams, opts ...ClientOption) (*CreateAWSDatalakeOK, error) + CreateAWSGovCloudDatalake(params *CreateAWSGovCloudDatalakeParams, opts ...ClientOption) (*CreateAWSGovCloudDatalakeOK, error) + CreateAzureDatalake(params *CreateAzureDatalakeParams, opts ...ClientOption) (*CreateAzureDatalakeOK, error) CreateGCPDatalake(params *CreateGCPDatalakeParams, opts ...ClientOption) (*CreateGCPDatalakeOK, error) DeleteDatalake(params *DeleteDatalakeParams, opts ...ClientOption) (*DeleteDatalakeOK, error) + DescribeDatabaseServer(params *DescribeDatabaseServerParams, opts ...ClientOption) (*DescribeDatabaseServerOK, error) + DescribeDatalake(params *DescribeDatalakeParams, opts ...ClientOption) (*DescribeDatalakeOK, error) EnableRangerRaz(params *EnableRangerRazParams, opts ...ClientOption) (*EnableRangerRazOK, error) @@ -94,6 +98,8 @@ type ClientService interface { RotateSaltPassword(params *RotateSaltPasswordParams, opts ...ClientOption) (*RotateSaltPasswordOK, error) + ScaleHorizontally(params *ScaleHorizontallyParams, opts ...ClientOption) (*ScaleHorizontallyOK, error) + SetCatalog(params *SetCatalogParams, opts ...ClientOption) (*SetCatalogOK, error) StartDatabaseUpgrade(params *StartDatabaseUpgradeParams, opts ...ClientOption) (*StartDatabaseUpgradeOK, error) @@ -110,6 +116,10 @@ type ClientService interface { UpgradeDatalake(params *UpgradeDatalakeParams, opts ...ClientOption) (*UpgradeDatalakeOK, error) + ValidateAwsCloudStorage(params *ValidateAwsCloudStorageParams, opts ...ClientOption) (*ValidateAwsCloudStorageOK, error) + + ValidateAzureCloudStorage(params *ValidateAzureCloudStorageParams, opts ...ClientOption) (*ValidateAzureCloudStorageOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -386,6 +396,45 @@ func (a *Client) CreateAWSDatalake(params *CreateAWSDatalakeParams, opts ...Clie return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +CreateAWSGovCloudDatalake creates a data lake on a w s gov cloud + +Creates a Data Lake on AWS GovCloud. +*/ +func (a *Client) CreateAWSGovCloudDatalake(params *CreateAWSGovCloudDatalakeParams, opts ...ClientOption) (*CreateAWSGovCloudDatalakeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateAWSGovCloudDatalakeParams() + } + op := &runtime.ClientOperation{ + ID: "createAWSGovCloudDatalake", + Method: "POST", + PathPattern: "/api/v1/datalake/createAWSGovCloudDatalake", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateAWSGovCloudDatalakeReader{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.(*CreateAWSGovCloudDatalakeOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateAWSGovCloudDatalakeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* CreateAzureDatalake creates an azure datalake @@ -503,6 +552,45 @@ func (a *Client) DeleteDatalake(params *DeleteDatalakeParams, opts ...ClientOpti return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +DescribeDatabaseServer gets external database server details + +Gets external database server details for Data Lake by cluster CRN +*/ +func (a *Client) DescribeDatabaseServer(params *DescribeDatabaseServerParams, opts ...ClientOption) (*DescribeDatabaseServerOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDescribeDatabaseServerParams() + } + op := &runtime.ClientOperation{ + ID: "describeDatabaseServer", + Method: "POST", + PathPattern: "/api/v1/datalake/describeDatabaseServer", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DescribeDatabaseServerReader{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.(*DescribeDatabaseServerOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DescribeDatabaseServerDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* DescribeDatalake describes a datalake @@ -1400,6 +1488,45 @@ func (a *Client) RotateSaltPassword(params *RotateSaltPasswordParams, opts ...Cl return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ScaleHorizontally horizontallies scale the data lake nodes to add additional compute nodes to the cluster + +Horizontally scale the target host group in the Data Lake cluster. The possible option for the instance group are raz_scale_out, hms_scale_out, kafka_scale_out, solr_scale_out, storage_scale_out +*/ +func (a *Client) ScaleHorizontally(params *ScaleHorizontallyParams, opts ...ClientOption) (*ScaleHorizontallyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewScaleHorizontallyParams() + } + op := &runtime.ClientOperation{ + ID: "scaleHorizontally", + Method: "POST", + PathPattern: "/api/v1/datalake/scaleHorizontally", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ScaleHorizontallyReader{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.(*ScaleHorizontallyOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ScaleHorizontallyDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* SetCatalog sets a catalog for a data lake @@ -1520,7 +1647,7 @@ func (a *Client) StartDatalake(params *StartDatalakeParams, opts ...ClientOption /* StartDatalakeVerticalScaling initiates the vertical scaling on data lake -Initiates the vertical scaling on Data Lake. +Initiates the vertical scaling on Data Lake. You have the option to specify 'modifyDisks' or 'instanceTemplate' as parameter. */ func (a *Client) StartDatalakeVerticalScaling(params *StartDatalakeVerticalScalingParams, opts ...ClientOption) (*StartDatalakeVerticalScalingOK, error) { // TODO: Validate the params before sending @@ -1712,6 +1839,84 @@ func (a *Client) UpgradeDatalake(params *UpgradeDatalakeParams, opts ...ClientOp return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ValidateAwsCloudStorage validates a w s cloud storage + +Validates AWS cloud storage for Data Lake. +*/ +func (a *Client) ValidateAwsCloudStorage(params *ValidateAwsCloudStorageParams, opts ...ClientOption) (*ValidateAwsCloudStorageOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewValidateAwsCloudStorageParams() + } + op := &runtime.ClientOperation{ + ID: "validateAwsCloudStorage", + Method: "POST", + PathPattern: "/api/v1/datalake/validateAwsCloudStorage", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ValidateAwsCloudStorageReader{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.(*ValidateAwsCloudStorageOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ValidateAwsCloudStorageDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ValidateAzureCloudStorage validates azure cloud storage + +Validates Azure cloud storage for Data Lake. +*/ +func (a *Client) ValidateAzureCloudStorage(params *ValidateAzureCloudStorageParams, opts ...ClientOption) (*ValidateAzureCloudStorageOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewValidateAzureCloudStorageParams() + } + op := &runtime.ClientOperation{ + ID: "validateAzureCloudStorage", + Method: "POST", + PathPattern: "/api/v1/datalake/validateAzureCloudStorage", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ValidateAzureCloudStorageReader{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.(*ValidateAzureCloudStorageOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ValidateAzureCloudStorageDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/cdp-sdk-go/gen/datalake/client/operations/scale_horizontally_parameters.go b/cdp-sdk-go/gen/datalake/client/operations/scale_horizontally_parameters.go new file mode 100644 index 00000000..4317f96a --- /dev/null +++ b/cdp-sdk-go/gen/datalake/client/operations/scale_horizontally_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datalake/models" +) + +// NewScaleHorizontallyParams creates a new ScaleHorizontallyParams 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 NewScaleHorizontallyParams() *ScaleHorizontallyParams { + return &ScaleHorizontallyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewScaleHorizontallyParamsWithTimeout creates a new ScaleHorizontallyParams object +// with the ability to set a timeout on a request. +func NewScaleHorizontallyParamsWithTimeout(timeout time.Duration) *ScaleHorizontallyParams { + return &ScaleHorizontallyParams{ + timeout: timeout, + } +} + +// NewScaleHorizontallyParamsWithContext creates a new ScaleHorizontallyParams object +// with the ability to set a context for a request. +func NewScaleHorizontallyParamsWithContext(ctx context.Context) *ScaleHorizontallyParams { + return &ScaleHorizontallyParams{ + Context: ctx, + } +} + +// NewScaleHorizontallyParamsWithHTTPClient creates a new ScaleHorizontallyParams object +// with the ability to set a custom HTTPClient for a request. +func NewScaleHorizontallyParamsWithHTTPClient(client *http.Client) *ScaleHorizontallyParams { + return &ScaleHorizontallyParams{ + HTTPClient: client, + } +} + +/* +ScaleHorizontallyParams contains all the parameters to send to the API endpoint + + for the scale horizontally operation. + + Typically these are written to a http.Request. +*/ +type ScaleHorizontallyParams struct { + + // Input. + Input *models.ScaleHorizontallyRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the scale horizontally params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScaleHorizontallyParams) WithDefaults() *ScaleHorizontallyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the scale horizontally params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ScaleHorizontallyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the scale horizontally params +func (o *ScaleHorizontallyParams) WithTimeout(timeout time.Duration) *ScaleHorizontallyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the scale horizontally params +func (o *ScaleHorizontallyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the scale horizontally params +func (o *ScaleHorizontallyParams) WithContext(ctx context.Context) *ScaleHorizontallyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the scale horizontally params +func (o *ScaleHorizontallyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the scale horizontally params +func (o *ScaleHorizontallyParams) WithHTTPClient(client *http.Client) *ScaleHorizontallyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the scale horizontally params +func (o *ScaleHorizontallyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the scale horizontally params +func (o *ScaleHorizontallyParams) WithInput(input *models.ScaleHorizontallyRequest) *ScaleHorizontallyParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the scale horizontally params +func (o *ScaleHorizontallyParams) SetInput(input *models.ScaleHorizontallyRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *ScaleHorizontallyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/datalake/client/operations/scale_horizontally_responses.go b/cdp-sdk-go/gen/datalake/client/operations/scale_horizontally_responses.go new file mode 100644 index 00000000..74b506cb --- /dev/null +++ b/cdp-sdk-go/gen/datalake/client/operations/scale_horizontally_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datalake/models" +) + +// ScaleHorizontallyReader is a Reader for the ScaleHorizontally structure. +type ScaleHorizontallyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ScaleHorizontallyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewScaleHorizontallyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewScaleHorizontallyDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewScaleHorizontallyOK creates a ScaleHorizontallyOK with default headers values +func NewScaleHorizontallyOK() *ScaleHorizontallyOK { + return &ScaleHorizontallyOK{} +} + +/* +ScaleHorizontallyOK describes a response with status code 200, with default header values. + +Successful response to a valid Data Lake horizontal scaling request. +*/ +type ScaleHorizontallyOK struct { + Payload *models.ScaleHorizontallyResponse +} + +// IsSuccess returns true when this scale horizontally o k response has a 2xx status code +func (o *ScaleHorizontallyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this scale horizontally o k response has a 3xx status code +func (o *ScaleHorizontallyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this scale horizontally o k response has a 4xx status code +func (o *ScaleHorizontallyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this scale horizontally o k response has a 5xx status code +func (o *ScaleHorizontallyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this scale horizontally o k response a status code equal to that given +func (o *ScaleHorizontallyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the scale horizontally o k response +func (o *ScaleHorizontallyOK) Code() int { + return 200 +} + +func (o *ScaleHorizontallyOK) Error() string { + return fmt.Sprintf("[POST /api/v1/datalake/scaleHorizontally][%d] scaleHorizontallyOK %+v", 200, o.Payload) +} + +func (o *ScaleHorizontallyOK) String() string { + return fmt.Sprintf("[POST /api/v1/datalake/scaleHorizontally][%d] scaleHorizontallyOK %+v", 200, o.Payload) +} + +func (o *ScaleHorizontallyOK) GetPayload() *models.ScaleHorizontallyResponse { + return o.Payload +} + +func (o *ScaleHorizontallyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ScaleHorizontallyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewScaleHorizontallyDefault creates a ScaleHorizontallyDefault with default headers values +func NewScaleHorizontallyDefault(code int) *ScaleHorizontallyDefault { + return &ScaleHorizontallyDefault{ + _statusCode: code, + } +} + +/* +ScaleHorizontallyDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type ScaleHorizontallyDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this scale horizontally default response has a 2xx status code +func (o *ScaleHorizontallyDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this scale horizontally default response has a 3xx status code +func (o *ScaleHorizontallyDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this scale horizontally default response has a 4xx status code +func (o *ScaleHorizontallyDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this scale horizontally default response has a 5xx status code +func (o *ScaleHorizontallyDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this scale horizontally default response a status code equal to that given +func (o *ScaleHorizontallyDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the scale horizontally default response +func (o *ScaleHorizontallyDefault) Code() int { + return o._statusCode +} + +func (o *ScaleHorizontallyDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/datalake/scaleHorizontally][%d] scaleHorizontally default %+v", o._statusCode, o.Payload) +} + +func (o *ScaleHorizontallyDefault) String() string { + return fmt.Sprintf("[POST /api/v1/datalake/scaleHorizontally][%d] scaleHorizontally default %+v", o._statusCode, o.Payload) +} + +func (o *ScaleHorizontallyDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ScaleHorizontallyDefault) 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/cdp-sdk-go/gen/datalake/client/operations/validate_aws_cloud_storage_parameters.go b/cdp-sdk-go/gen/datalake/client/operations/validate_aws_cloud_storage_parameters.go new file mode 100644 index 00000000..f5028044 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/client/operations/validate_aws_cloud_storage_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datalake/models" +) + +// NewValidateAwsCloudStorageParams creates a new ValidateAwsCloudStorageParams 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 NewValidateAwsCloudStorageParams() *ValidateAwsCloudStorageParams { + return &ValidateAwsCloudStorageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewValidateAwsCloudStorageParamsWithTimeout creates a new ValidateAwsCloudStorageParams object +// with the ability to set a timeout on a request. +func NewValidateAwsCloudStorageParamsWithTimeout(timeout time.Duration) *ValidateAwsCloudStorageParams { + return &ValidateAwsCloudStorageParams{ + timeout: timeout, + } +} + +// NewValidateAwsCloudStorageParamsWithContext creates a new ValidateAwsCloudStorageParams object +// with the ability to set a context for a request. +func NewValidateAwsCloudStorageParamsWithContext(ctx context.Context) *ValidateAwsCloudStorageParams { + return &ValidateAwsCloudStorageParams{ + Context: ctx, + } +} + +// NewValidateAwsCloudStorageParamsWithHTTPClient creates a new ValidateAwsCloudStorageParams object +// with the ability to set a custom HTTPClient for a request. +func NewValidateAwsCloudStorageParamsWithHTTPClient(client *http.Client) *ValidateAwsCloudStorageParams { + return &ValidateAwsCloudStorageParams{ + HTTPClient: client, + } +} + +/* +ValidateAwsCloudStorageParams contains all the parameters to send to the API endpoint + + for the validate aws cloud storage operation. + + Typically these are written to a http.Request. +*/ +type ValidateAwsCloudStorageParams struct { + + // Input. + Input *models.ValidateAwsCloudStorageRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the validate aws cloud storage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateAwsCloudStorageParams) WithDefaults() *ValidateAwsCloudStorageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the validate aws cloud storage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateAwsCloudStorageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) WithTimeout(timeout time.Duration) *ValidateAwsCloudStorageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) WithContext(ctx context.Context) *ValidateAwsCloudStorageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) WithHTTPClient(client *http.Client) *ValidateAwsCloudStorageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) WithInput(input *models.ValidateAwsCloudStorageRequest) *ValidateAwsCloudStorageParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) SetInput(input *models.ValidateAwsCloudStorageRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *ValidateAwsCloudStorageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/datalake/client/operations/validate_aws_cloud_storage_responses.go b/cdp-sdk-go/gen/datalake/client/operations/validate_aws_cloud_storage_responses.go new file mode 100644 index 00000000..8356ed5d --- /dev/null +++ b/cdp-sdk-go/gen/datalake/client/operations/validate_aws_cloud_storage_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datalake/models" +) + +// ValidateAwsCloudStorageReader is a Reader for the ValidateAwsCloudStorage structure. +type ValidateAwsCloudStorageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ValidateAwsCloudStorageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewValidateAwsCloudStorageOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewValidateAwsCloudStorageDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewValidateAwsCloudStorageOK creates a ValidateAwsCloudStorageOK with default headers values +func NewValidateAwsCloudStorageOK() *ValidateAwsCloudStorageOK { + return &ValidateAwsCloudStorageOK{} +} + +/* +ValidateAwsCloudStorageOK describes a response with status code 200, with default header values. + +AWS cloud storage validation result for Data Lake. +*/ +type ValidateAwsCloudStorageOK struct { + Payload *models.ValidateAwsCloudStorageResponse +} + +// IsSuccess returns true when this validate aws cloud storage o k response has a 2xx status code +func (o *ValidateAwsCloudStorageOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate aws cloud storage o k response has a 3xx status code +func (o *ValidateAwsCloudStorageOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate aws cloud storage o k response has a 4xx status code +func (o *ValidateAwsCloudStorageOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate aws cloud storage o k response has a 5xx status code +func (o *ValidateAwsCloudStorageOK) IsServerError() bool { + return false +} + +// IsCode returns true when this validate aws cloud storage o k response a status code equal to that given +func (o *ValidateAwsCloudStorageOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the validate aws cloud storage o k response +func (o *ValidateAwsCloudStorageOK) Code() int { + return 200 +} + +func (o *ValidateAwsCloudStorageOK) Error() string { + return fmt.Sprintf("[POST /api/v1/datalake/validateAwsCloudStorage][%d] validateAwsCloudStorageOK %+v", 200, o.Payload) +} + +func (o *ValidateAwsCloudStorageOK) String() string { + return fmt.Sprintf("[POST /api/v1/datalake/validateAwsCloudStorage][%d] validateAwsCloudStorageOK %+v", 200, o.Payload) +} + +func (o *ValidateAwsCloudStorageOK) GetPayload() *models.ValidateAwsCloudStorageResponse { + return o.Payload +} + +func (o *ValidateAwsCloudStorageOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ValidateAwsCloudStorageResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateAwsCloudStorageDefault creates a ValidateAwsCloudStorageDefault with default headers values +func NewValidateAwsCloudStorageDefault(code int) *ValidateAwsCloudStorageDefault { + return &ValidateAwsCloudStorageDefault{ + _statusCode: code, + } +} + +/* +ValidateAwsCloudStorageDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type ValidateAwsCloudStorageDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this validate aws cloud storage default response has a 2xx status code +func (o *ValidateAwsCloudStorageDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this validate aws cloud storage default response has a 3xx status code +func (o *ValidateAwsCloudStorageDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this validate aws cloud storage default response has a 4xx status code +func (o *ValidateAwsCloudStorageDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this validate aws cloud storage default response has a 5xx status code +func (o *ValidateAwsCloudStorageDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this validate aws cloud storage default response a status code equal to that given +func (o *ValidateAwsCloudStorageDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the validate aws cloud storage default response +func (o *ValidateAwsCloudStorageDefault) Code() int { + return o._statusCode +} + +func (o *ValidateAwsCloudStorageDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/datalake/validateAwsCloudStorage][%d] validateAwsCloudStorage default %+v", o._statusCode, o.Payload) +} + +func (o *ValidateAwsCloudStorageDefault) String() string { + return fmt.Sprintf("[POST /api/v1/datalake/validateAwsCloudStorage][%d] validateAwsCloudStorage default %+v", o._statusCode, o.Payload) +} + +func (o *ValidateAwsCloudStorageDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ValidateAwsCloudStorageDefault) 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/cdp-sdk-go/gen/datalake/client/operations/validate_azure_cloud_storage_parameters.go b/cdp-sdk-go/gen/datalake/client/operations/validate_azure_cloud_storage_parameters.go new file mode 100644 index 00000000..07cd6f30 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/client/operations/validate_azure_cloud_storage_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datalake/models" +) + +// NewValidateAzureCloudStorageParams creates a new ValidateAzureCloudStorageParams 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 NewValidateAzureCloudStorageParams() *ValidateAzureCloudStorageParams { + return &ValidateAzureCloudStorageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewValidateAzureCloudStorageParamsWithTimeout creates a new ValidateAzureCloudStorageParams object +// with the ability to set a timeout on a request. +func NewValidateAzureCloudStorageParamsWithTimeout(timeout time.Duration) *ValidateAzureCloudStorageParams { + return &ValidateAzureCloudStorageParams{ + timeout: timeout, + } +} + +// NewValidateAzureCloudStorageParamsWithContext creates a new ValidateAzureCloudStorageParams object +// with the ability to set a context for a request. +func NewValidateAzureCloudStorageParamsWithContext(ctx context.Context) *ValidateAzureCloudStorageParams { + return &ValidateAzureCloudStorageParams{ + Context: ctx, + } +} + +// NewValidateAzureCloudStorageParamsWithHTTPClient creates a new ValidateAzureCloudStorageParams object +// with the ability to set a custom HTTPClient for a request. +func NewValidateAzureCloudStorageParamsWithHTTPClient(client *http.Client) *ValidateAzureCloudStorageParams { + return &ValidateAzureCloudStorageParams{ + HTTPClient: client, + } +} + +/* +ValidateAzureCloudStorageParams contains all the parameters to send to the API endpoint + + for the validate azure cloud storage operation. + + Typically these are written to a http.Request. +*/ +type ValidateAzureCloudStorageParams struct { + + // Input. + Input *models.ValidateAzureCloudStorageRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the validate azure cloud storage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateAzureCloudStorageParams) WithDefaults() *ValidateAzureCloudStorageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the validate azure cloud storage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateAzureCloudStorageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) WithTimeout(timeout time.Duration) *ValidateAzureCloudStorageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) WithContext(ctx context.Context) *ValidateAzureCloudStorageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) WithHTTPClient(client *http.Client) *ValidateAzureCloudStorageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) WithInput(input *models.ValidateAzureCloudStorageRequest) *ValidateAzureCloudStorageParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) SetInput(input *models.ValidateAzureCloudStorageRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *ValidateAzureCloudStorageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/datalake/client/operations/validate_azure_cloud_storage_responses.go b/cdp-sdk-go/gen/datalake/client/operations/validate_azure_cloud_storage_responses.go new file mode 100644 index 00000000..ba6f5f50 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/client/operations/validate_azure_cloud_storage_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/datalake/models" +) + +// ValidateAzureCloudStorageReader is a Reader for the ValidateAzureCloudStorage structure. +type ValidateAzureCloudStorageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ValidateAzureCloudStorageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewValidateAzureCloudStorageOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewValidateAzureCloudStorageDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewValidateAzureCloudStorageOK creates a ValidateAzureCloudStorageOK with default headers values +func NewValidateAzureCloudStorageOK() *ValidateAzureCloudStorageOK { + return &ValidateAzureCloudStorageOK{} +} + +/* +ValidateAzureCloudStorageOK describes a response with status code 200, with default header values. + +Azure cloud storage validation result for Data Lake. +*/ +type ValidateAzureCloudStorageOK struct { + Payload *models.ValidateAzureCloudStorageResponse +} + +// IsSuccess returns true when this validate azure cloud storage o k response has a 2xx status code +func (o *ValidateAzureCloudStorageOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate azure cloud storage o k response has a 3xx status code +func (o *ValidateAzureCloudStorageOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate azure cloud storage o k response has a 4xx status code +func (o *ValidateAzureCloudStorageOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate azure cloud storage o k response has a 5xx status code +func (o *ValidateAzureCloudStorageOK) IsServerError() bool { + return false +} + +// IsCode returns true when this validate azure cloud storage o k response a status code equal to that given +func (o *ValidateAzureCloudStorageOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the validate azure cloud storage o k response +func (o *ValidateAzureCloudStorageOK) Code() int { + return 200 +} + +func (o *ValidateAzureCloudStorageOK) Error() string { + return fmt.Sprintf("[POST /api/v1/datalake/validateAzureCloudStorage][%d] validateAzureCloudStorageOK %+v", 200, o.Payload) +} + +func (o *ValidateAzureCloudStorageOK) String() string { + return fmt.Sprintf("[POST /api/v1/datalake/validateAzureCloudStorage][%d] validateAzureCloudStorageOK %+v", 200, o.Payload) +} + +func (o *ValidateAzureCloudStorageOK) GetPayload() *models.ValidateAzureCloudStorageResponse { + return o.Payload +} + +func (o *ValidateAzureCloudStorageOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ValidateAzureCloudStorageResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateAzureCloudStorageDefault creates a ValidateAzureCloudStorageDefault with default headers values +func NewValidateAzureCloudStorageDefault(code int) *ValidateAzureCloudStorageDefault { + return &ValidateAzureCloudStorageDefault{ + _statusCode: code, + } +} + +/* +ValidateAzureCloudStorageDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type ValidateAzureCloudStorageDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this validate azure cloud storage default response has a 2xx status code +func (o *ValidateAzureCloudStorageDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this validate azure cloud storage default response has a 3xx status code +func (o *ValidateAzureCloudStorageDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this validate azure cloud storage default response has a 4xx status code +func (o *ValidateAzureCloudStorageDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this validate azure cloud storage default response has a 5xx status code +func (o *ValidateAzureCloudStorageDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this validate azure cloud storage default response a status code equal to that given +func (o *ValidateAzureCloudStorageDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the validate azure cloud storage default response +func (o *ValidateAzureCloudStorageDefault) Code() int { + return o._statusCode +} + +func (o *ValidateAzureCloudStorageDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/datalake/validateAzureCloudStorage][%d] validateAzureCloudStorage default %+v", o._statusCode, o.Payload) +} + +func (o *ValidateAzureCloudStorageDefault) String() string { + return fmt.Sprintf("[POST /api/v1/datalake/validateAzureCloudStorage][%d] validateAzureCloudStorage default %+v", o._statusCode, o.Payload) +} + +func (o *ValidateAzureCloudStorageDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ValidateAzureCloudStorageDefault) 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/cdp-sdk-go/gen/datalake/models/create_a_w_s_gov_cloud_datalake_request.go b/cdp-sdk-go/gen/datalake/models/create_a_w_s_gov_cloud_datalake_request.go new file mode 100644 index 00000000..27d6e93d --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/create_a_w_s_gov_cloud_datalake_request.go @@ -0,0 +1,448 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateAWSGovCloudDatalakeRequest Request object for createing AWS Data Lake request on GovCloud. +// +// swagger:model CreateAWSGovCloudDatalakeRequest +type CreateAWSGovCloudDatalakeRequest struct { + + // AWS configuration. + // Required: true + CloudProviderConfiguration *AWSConfigurationRequest `json:"cloudProviderConfiguration"` + + // Configure custom properties on an instance group level. + CustomInstanceGroups []*SdxInstanceGroupRequest `json:"customInstanceGroups"` + + // The Data Lake name. This name must be unique, must have between 5 and 100 characters, and must contain only lowercase letters, numbers and hyphens. Names are case-sensitive. + // Required: true + // Max Length: 100 + // Min Length: 5 + DatalakeName *string `json:"datalakeName"` + + // Whether to enable Ranger RAZ for the datalake. Defaults to not being enabled. + EnableRangerRaz bool `json:"enableRangerRaz,omitempty"` + + // The environment name or CRN. + // Required: true + EnvironmentName *string `json:"environmentName"` + + // The image to use for the datalake. This must not be set if the runtime parameter is provided. + Image *ImageRequest `json:"image,omitempty"` + + // Configure the major version of Java on the cluster. + JavaVersion int32 `json:"javaVersion,omitempty"` + + // Controls if the datalake is deployed in a multi-availability zone way. + MultiAz bool `json:"multiAz,omitempty"` + + // Additional recipes that will be attached on the datalake instances (by instance groups, most common ones are like 'master' or 'idbroker'). + Recipes []*InstanceGroupRecipeRequest `json:"recipes"` + + // Cloudera Runtime version. + Runtime string `json:"runtime,omitempty"` + + // The scale of the datalake. Allowed values are "LIGHT_DUTY" or "MEDIUM_DUTY_HA". Defaults to "LIGHT_DUTY" if not set. + Scale DatalakeScaleType `json:"scale,omitempty"` + + // Tags to be added to Data Lake related resources. + Tags []*DatalakeResourceTagRequest `json:"tags"` +} + +// Validate validates this create a w s gov cloud datalake request +func (m *CreateAWSGovCloudDatalakeRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCloudProviderConfiguration(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomInstanceGroups(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDatalakeName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvironmentName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImage(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRecipes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScale(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) validateCloudProviderConfiguration(formats strfmt.Registry) error { + + if err := validate.Required("cloudProviderConfiguration", "body", m.CloudProviderConfiguration); err != nil { + return err + } + + if m.CloudProviderConfiguration != nil { + if err := m.CloudProviderConfiguration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cloudProviderConfiguration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cloudProviderConfiguration") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) validateCustomInstanceGroups(formats strfmt.Registry) error { + if swag.IsZero(m.CustomInstanceGroups) { // not required + return nil + } + + for i := 0; i < len(m.CustomInstanceGroups); i++ { + if swag.IsZero(m.CustomInstanceGroups[i]) { // not required + continue + } + + if m.CustomInstanceGroups[i] != nil { + if err := m.CustomInstanceGroups[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customInstanceGroups" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customInstanceGroups" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) validateDatalakeName(formats strfmt.Registry) error { + + if err := validate.Required("datalakeName", "body", m.DatalakeName); err != nil { + return err + } + + if err := validate.MinLength("datalakeName", "body", *m.DatalakeName, 5); err != nil { + return err + } + + if err := validate.MaxLength("datalakeName", "body", *m.DatalakeName, 100); err != nil { + return err + } + + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) validateEnvironmentName(formats strfmt.Registry) error { + + if err := validate.Required("environmentName", "body", m.EnvironmentName); err != nil { + return err + } + + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) validateImage(formats strfmt.Registry) error { + if swag.IsZero(m.Image) { // not required + return nil + } + + if m.Image != nil { + if err := m.Image.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("image") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("image") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) validateRecipes(formats strfmt.Registry) error { + if swag.IsZero(m.Recipes) { // not required + return nil + } + + for i := 0; i < len(m.Recipes); i++ { + if swag.IsZero(m.Recipes[i]) { // not required + continue + } + + if m.Recipes[i] != nil { + if err := m.Recipes[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("recipes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("recipes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) validateScale(formats strfmt.Registry) error { + if swag.IsZero(m.Scale) { // not required + return nil + } + + if err := m.Scale.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("scale") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("scale") + } + return err + } + + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create a w s gov cloud datalake request based on the context it is used +func (m *CreateAWSGovCloudDatalakeRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCloudProviderConfiguration(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustomInstanceGroups(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateImage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRecipes(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateScale(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) contextValidateCloudProviderConfiguration(ctx context.Context, formats strfmt.Registry) error { + + if m.CloudProviderConfiguration != nil { + + if err := m.CloudProviderConfiguration.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cloudProviderConfiguration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cloudProviderConfiguration") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) contextValidateCustomInstanceGroups(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CustomInstanceGroups); i++ { + + if m.CustomInstanceGroups[i] != nil { + + if swag.IsZero(m.CustomInstanceGroups[i]) { // not required + return nil + } + + if err := m.CustomInstanceGroups[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customInstanceGroups" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customInstanceGroups" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) contextValidateImage(ctx context.Context, formats strfmt.Registry) error { + + if m.Image != nil { + + if swag.IsZero(m.Image) { // not required + return nil + } + + if err := m.Image.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("image") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("image") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) contextValidateRecipes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Recipes); i++ { + + if m.Recipes[i] != nil { + + if swag.IsZero(m.Recipes[i]) { // not required + return nil + } + + if err := m.Recipes[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("recipes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("recipes" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) contextValidateScale(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Scale) { // not required + return nil + } + + if err := m.Scale.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("scale") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("scale") + } + return err + } + + return nil +} + +func (m *CreateAWSGovCloudDatalakeRequest) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + + if swag.IsZero(m.Tags[i]) { // not required + return nil + } + + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAWSGovCloudDatalakeRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAWSGovCloudDatalakeRequest) UnmarshalBinary(b []byte) error { + var res CreateAWSGovCloudDatalakeRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datalake/models/create_a_w_s_gov_cloud_datalake_response.go b/cdp-sdk-go/gen/datalake/models/create_a_w_s_gov_cloud_datalake_response.go new file mode 100644 index 00000000..6b8a0fc5 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/create_a_w_s_gov_cloud_datalake_response.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateAWSGovCloudDatalakeResponse Response object for creating AWS Data Lake request on GovCloud. +// +// swagger:model CreateAWSGovCloudDatalakeResponse +type CreateAWSGovCloudDatalakeResponse struct { + + // The Data Lake. + // Required: true + Datalake *Datalake `json:"datalake"` +} + +// Validate validates this create a w s gov cloud datalake response +func (m *CreateAWSGovCloudDatalakeResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDatalake(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudDatalakeResponse) validateDatalake(formats strfmt.Registry) error { + + if err := validate.Required("datalake", "body", m.Datalake); err != nil { + return err + } + + if m.Datalake != nil { + if err := m.Datalake.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("datalake") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("datalake") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create a w s gov cloud datalake response based on the context it is used +func (m *CreateAWSGovCloudDatalakeResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDatalake(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudDatalakeResponse) contextValidateDatalake(ctx context.Context, formats strfmt.Registry) error { + + if m.Datalake != nil { + + if err := m.Datalake.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("datalake") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("datalake") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAWSGovCloudDatalakeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAWSGovCloudDatalakeResponse) UnmarshalBinary(b []byte) error { + var res CreateAWSGovCloudDatalakeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datalake/models/create_azure_datalake_request.go b/cdp-sdk-go/gen/datalake/models/create_azure_datalake_request.go index a6c10370..6e0c1bb9 100644 --- a/cdp-sdk-go/gen/datalake/models/create_azure_datalake_request.go +++ b/cdp-sdk-go/gen/datalake/models/create_azure_datalake_request.go @@ -7,6 +7,7 @@ package models import ( "context" + "encoding/json" "strconv" "github.com/go-openapi/errors" @@ -27,6 +28,10 @@ type CreateAzureDatalakeRequest struct { // Configure custom properties on an instance group level. CustomInstanceGroups []*SdxInstanceGroupRequest `json:"customInstanceGroups"` + // The type of the azure database. FLEXIBLE_SERVER is the next generation managed PostgreSQL service in Azure that provides maximum flexibility over your database, built-in cost-optimizations. SINGLE_SERVER is a fully managed database service with minimal requirements for customizations of the database. + // Enum: [FLEXIBLE_SERVER SINGLE_SERVER] + DatabaseType string `json:"databaseType,omitempty"` + // The datalake name. This name must be unique, must have between 5 and 100 characters, and must contain only lowercase letters, numbers and hyphens. Names are case-sensitive. // Required: true // Max Length: 100 @@ -49,6 +54,9 @@ type CreateAzureDatalakeRequest struct { // The SKU for the datalake load balancer. Allowed values are "BASIC", "STANDARD", or "NONE". LoadBalancerSku DatalakeLoadBalancerSkuType `json:"loadBalancerSku,omitempty"` + // Creates CDP datalake distributed across multiple availability zones in an Azure region. + MultiAz *bool `json:"multiAz,omitempty"` + // Additional recipes that will be attached on the datalake instances (by instance groups, most common ones are like 'master' or 'idbroker'). Recipes []*InstanceGroupRecipeRequest `json:"recipes"` @@ -74,6 +82,10 @@ func (m *CreateAzureDatalakeRequest) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDatabaseType(formats); err != nil { + res = append(res, err) + } + if err := m.validateDatalakeName(formats); err != nil { res = append(res, err) } @@ -154,6 +166,48 @@ func (m *CreateAzureDatalakeRequest) validateCustomInstanceGroups(formats strfmt return nil } +var createAzureDatalakeRequestTypeDatabaseTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["FLEXIBLE_SERVER","SINGLE_SERVER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createAzureDatalakeRequestTypeDatabaseTypePropEnum = append(createAzureDatalakeRequestTypeDatabaseTypePropEnum, v) + } +} + +const ( + + // CreateAzureDatalakeRequestDatabaseTypeFLEXIBLESERVER captures enum value "FLEXIBLE_SERVER" + CreateAzureDatalakeRequestDatabaseTypeFLEXIBLESERVER string = "FLEXIBLE_SERVER" + + // CreateAzureDatalakeRequestDatabaseTypeSINGLESERVER captures enum value "SINGLE_SERVER" + CreateAzureDatalakeRequestDatabaseTypeSINGLESERVER string = "SINGLE_SERVER" +) + +// prop value enum +func (m *CreateAzureDatalakeRequest) validateDatabaseTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createAzureDatalakeRequestTypeDatabaseTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateAzureDatalakeRequest) validateDatabaseType(formats strfmt.Registry) error { + if swag.IsZero(m.DatabaseType) { // not required + return nil + } + + // value enum + if err := m.validateDatabaseTypeEnum("databaseType", "body", m.DatabaseType); err != nil { + return err + } + + return nil +} + func (m *CreateAzureDatalakeRequest) validateDatalakeName(formats strfmt.Registry) error { if err := validate.Required("datalakeName", "body", m.DatalakeName); err != nil { diff --git a/cdp-sdk-go/gen/datalake/models/database_server_ssl_config.go b/cdp-sdk-go/gen/datalake/models/database_server_ssl_config.go new file mode 100644 index 00000000..fd08711c --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/database_server_ssl_config.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DatabaseServerSslConfig SSL configuration for the database server +// +// swagger:model DatabaseServerSslConfig +type DatabaseServerSslConfig struct { + + // SSL certificate type + // Enum: [CLOUD_PROVIDER_OWNED BRING_YOUR_OWN NONE] + SslCertificateType string `json:"sslCertificateType,omitempty"` + + // Set of SSL certificates for the actual database server + // Unique: true + SslCertificates []string `json:"sslCertificates"` + + // SSL enforcement mode for the actual database server + // Enum: [ENABLED DISABLED] + SslMode string `json:"sslMode,omitempty"` +} + +// Validate validates this database server ssl config +func (m *DatabaseServerSslConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSslCertificateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSslCertificates(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSslMode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var databaseServerSslConfigTypeSslCertificateTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["CLOUD_PROVIDER_OWNED","BRING_YOUR_OWN","NONE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + databaseServerSslConfigTypeSslCertificateTypePropEnum = append(databaseServerSslConfigTypeSslCertificateTypePropEnum, v) + } +} + +const ( + + // DatabaseServerSslConfigSslCertificateTypeCLOUDPROVIDEROWNED captures enum value "CLOUD_PROVIDER_OWNED" + DatabaseServerSslConfigSslCertificateTypeCLOUDPROVIDEROWNED string = "CLOUD_PROVIDER_OWNED" + + // DatabaseServerSslConfigSslCertificateTypeBRINGYOUROWN captures enum value "BRING_YOUR_OWN" + DatabaseServerSslConfigSslCertificateTypeBRINGYOUROWN string = "BRING_YOUR_OWN" + + // DatabaseServerSslConfigSslCertificateTypeNONE captures enum value "NONE" + DatabaseServerSslConfigSslCertificateTypeNONE string = "NONE" +) + +// prop value enum +func (m *DatabaseServerSslConfig) validateSslCertificateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, databaseServerSslConfigTypeSslCertificateTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DatabaseServerSslConfig) validateSslCertificateType(formats strfmt.Registry) error { + if swag.IsZero(m.SslCertificateType) { // not required + return nil + } + + // value enum + if err := m.validateSslCertificateTypeEnum("sslCertificateType", "body", m.SslCertificateType); err != nil { + return err + } + + return nil +} + +func (m *DatabaseServerSslConfig) validateSslCertificates(formats strfmt.Registry) error { + if swag.IsZero(m.SslCertificates) { // not required + return nil + } + + if err := validate.UniqueItems("sslCertificates", "body", m.SslCertificates); err != nil { + return err + } + + return nil +} + +var databaseServerSslConfigTypeSslModePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ENABLED","DISABLED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + databaseServerSslConfigTypeSslModePropEnum = append(databaseServerSslConfigTypeSslModePropEnum, v) + } +} + +const ( + + // DatabaseServerSslConfigSslModeENABLED captures enum value "ENABLED" + DatabaseServerSslConfigSslModeENABLED string = "ENABLED" + + // DatabaseServerSslConfigSslModeDISABLED captures enum value "DISABLED" + DatabaseServerSslConfigSslModeDISABLED string = "DISABLED" +) + +// prop value enum +func (m *DatabaseServerSslConfig) validateSslModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, databaseServerSslConfigTypeSslModePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DatabaseServerSslConfig) validateSslMode(formats strfmt.Registry) error { + if swag.IsZero(m.SslMode) { // not required + return nil + } + + // value enum + if err := m.validateSslModeEnum("sslMode", "body", m.SslMode); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this database server ssl config based on context it is used +func (m *DatabaseServerSslConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DatabaseServerSslConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DatabaseServerSslConfig) UnmarshalBinary(b []byte) error { + var res DatabaseServerSslConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datalake/models/datalake_scale_type.go b/cdp-sdk-go/gen/datalake/models/datalake_scale_type.go index 2cee56b2..f0a76012 100644 --- a/cdp-sdk-go/gen/datalake/models/datalake_scale_type.go +++ b/cdp-sdk-go/gen/datalake/models/datalake_scale_type.go @@ -35,6 +35,9 @@ const ( // DatalakeScaleTypeMEDIUMDUTYHA captures enum value "MEDIUM_DUTY_HA" DatalakeScaleTypeMEDIUMDUTYHA DatalakeScaleType = "MEDIUM_DUTY_HA" + + // DatalakeScaleTypeENTERPRISE captures enum value "ENTERPRISE" + DatalakeScaleTypeENTERPRISE DatalakeScaleType = "ENTERPRISE" ) // for schema @@ -42,7 +45,7 @@ var datalakeScaleTypeEnum []interface{} func init() { var res []DatalakeScaleType - if err := json.Unmarshal([]byte(`["LIGHT_DUTY","MEDIUM_DUTY_HA"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["LIGHT_DUTY","MEDIUM_DUTY_HA","ENTERPRISE"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/cdp-sdk-go/gen/datalake/models/describe_database_server_request.go b/cdp-sdk-go/gen/datalake/models/describe_database_server_request.go new file mode 100644 index 00000000..e4b0a30d --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/describe_database_server_request.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DescribeDatabaseServerRequest Request object for obtaining Database Server details. +// +// swagger:model DescribeDatabaseServerRequest +type DescribeDatabaseServerRequest struct { + + // Stack CRN of the Data Lake + ClusterCrn string `json:"clusterCrn,omitempty"` +} + +// Validate validates this describe database server request +func (m *DescribeDatabaseServerRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this describe database server request based on context it is used +func (m *DescribeDatabaseServerRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DescribeDatabaseServerRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DescribeDatabaseServerRequest) UnmarshalBinary(b []byte) error { + var res DescribeDatabaseServerRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datalake/models/describe_database_server_response.go b/cdp-sdk-go/gen/datalake/models/describe_database_server_response.go new file mode 100644 index 00000000..e72625be --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/describe_database_server_response.go @@ -0,0 +1,327 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DescribeDatabaseServerResponse Response object for obtaining Database Server details. +// +// swagger:model DescribeDatabaseServerResponse +type DescribeDatabaseServerResponse struct { + + // CRN of the cluster of the database server + ClusterCrn string `json:"clusterCrn,omitempty"` + + // Creation date of the database server + // Format: date-time + CreationDate strfmt.DateTime `json:"creationDate,omitempty"` + + // CRN of the database server + Crn string `json:"crn,omitempty"` + + // Name of the database vendor (MYSQL, POSTGRES, ...) + DatabaseVendor string `json:"databaseVendor,omitempty"` + + // Display name of the database vendor (MySQL, PostgreSQL, ...) + DatabaseVendorDisplayName string `json:"databaseVendorDisplayName,omitempty"` + + // Description of the database server + Description string `json:"description,omitempty"` + + // CRN of the environment of the database server + EnvironmentCrn string `json:"environmentCrn,omitempty"` + + // Host of the database server + Host string `json:"host,omitempty"` + + // Name of the database server + Name string `json:"name,omitempty"` + + // Port of the database server + Port int32 `json:"port,omitempty"` + + // Ownership status of the database server + // Enum: [UNKNOWN SERVICE_MANAGED USER_MANAGED] + ResourceStatus string `json:"resourceStatus,omitempty"` + + // SSL configuration of the database server + SslConfig *DatabaseServerSslConfig `json:"sslConfig,omitempty"` + + // Status of the database server stack + // Enum: [REQUESTED CREATE_IN_PROGRESS AVAILABLE UPDATE_IN_PROGRESS UPDATE_REQUESTED UPDATE_FAILED CREATE_FAILED ENABLE_SECURITY_FAILED DELETE_REQUESTED PRE_DELETE_IN_PROGRESS DELETE_IN_PROGRESS DELETE_FAILED DELETE_COMPLETED STOPPED STOP_REQUESTED START_REQUESTED STOP_IN_PROGRESS START_IN_PROGRESS START_FAILED STOP_FAILED WAIT_FOR_SYNC MAINTENANCE_MODE_ENABLED UNKNOWN] + Status string `json:"status,omitempty"` + + // Additional status information about the database server stack + StatusReason string `json:"statusReason,omitempty"` +} + +// Validate validates this describe database server response +func (m *DescribeDatabaseServerResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreationDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResourceStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSslConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DescribeDatabaseServerResponse) validateCreationDate(formats strfmt.Registry) error { + if swag.IsZero(m.CreationDate) { // not required + return nil + } + + if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { + return err + } + + return nil +} + +var describeDatabaseServerResponseTypeResourceStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["UNKNOWN","SERVICE_MANAGED","USER_MANAGED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + describeDatabaseServerResponseTypeResourceStatusPropEnum = append(describeDatabaseServerResponseTypeResourceStatusPropEnum, v) + } +} + +const ( + + // DescribeDatabaseServerResponseResourceStatusUNKNOWN captures enum value "UNKNOWN" + DescribeDatabaseServerResponseResourceStatusUNKNOWN string = "UNKNOWN" + + // DescribeDatabaseServerResponseResourceStatusSERVICEMANAGED captures enum value "SERVICE_MANAGED" + DescribeDatabaseServerResponseResourceStatusSERVICEMANAGED string = "SERVICE_MANAGED" + + // DescribeDatabaseServerResponseResourceStatusUSERMANAGED captures enum value "USER_MANAGED" + DescribeDatabaseServerResponseResourceStatusUSERMANAGED string = "USER_MANAGED" +) + +// prop value enum +func (m *DescribeDatabaseServerResponse) validateResourceStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, describeDatabaseServerResponseTypeResourceStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DescribeDatabaseServerResponse) validateResourceStatus(formats strfmt.Registry) error { + if swag.IsZero(m.ResourceStatus) { // not required + return nil + } + + // value enum + if err := m.validateResourceStatusEnum("resourceStatus", "body", m.ResourceStatus); err != nil { + return err + } + + return nil +} + +func (m *DescribeDatabaseServerResponse) validateSslConfig(formats strfmt.Registry) error { + if swag.IsZero(m.SslConfig) { // not required + return nil + } + + if m.SslConfig != nil { + if err := m.SslConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sslConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sslConfig") + } + return err + } + } + + return nil +} + +var describeDatabaseServerResponseTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["REQUESTED","CREATE_IN_PROGRESS","AVAILABLE","UPDATE_IN_PROGRESS","UPDATE_REQUESTED","UPDATE_FAILED","CREATE_FAILED","ENABLE_SECURITY_FAILED","DELETE_REQUESTED","PRE_DELETE_IN_PROGRESS","DELETE_IN_PROGRESS","DELETE_FAILED","DELETE_COMPLETED","STOPPED","STOP_REQUESTED","START_REQUESTED","STOP_IN_PROGRESS","START_IN_PROGRESS","START_FAILED","STOP_FAILED","WAIT_FOR_SYNC","MAINTENANCE_MODE_ENABLED","UNKNOWN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + describeDatabaseServerResponseTypeStatusPropEnum = append(describeDatabaseServerResponseTypeStatusPropEnum, v) + } +} + +const ( + + // DescribeDatabaseServerResponseStatusREQUESTED captures enum value "REQUESTED" + DescribeDatabaseServerResponseStatusREQUESTED string = "REQUESTED" + + // DescribeDatabaseServerResponseStatusCREATEINPROGRESS captures enum value "CREATE_IN_PROGRESS" + DescribeDatabaseServerResponseStatusCREATEINPROGRESS string = "CREATE_IN_PROGRESS" + + // DescribeDatabaseServerResponseStatusAVAILABLE captures enum value "AVAILABLE" + DescribeDatabaseServerResponseStatusAVAILABLE string = "AVAILABLE" + + // DescribeDatabaseServerResponseStatusUPDATEINPROGRESS captures enum value "UPDATE_IN_PROGRESS" + DescribeDatabaseServerResponseStatusUPDATEINPROGRESS string = "UPDATE_IN_PROGRESS" + + // DescribeDatabaseServerResponseStatusUPDATEREQUESTED captures enum value "UPDATE_REQUESTED" + DescribeDatabaseServerResponseStatusUPDATEREQUESTED string = "UPDATE_REQUESTED" + + // DescribeDatabaseServerResponseStatusUPDATEFAILED captures enum value "UPDATE_FAILED" + DescribeDatabaseServerResponseStatusUPDATEFAILED string = "UPDATE_FAILED" + + // DescribeDatabaseServerResponseStatusCREATEFAILED captures enum value "CREATE_FAILED" + DescribeDatabaseServerResponseStatusCREATEFAILED string = "CREATE_FAILED" + + // DescribeDatabaseServerResponseStatusENABLESECURITYFAILED captures enum value "ENABLE_SECURITY_FAILED" + DescribeDatabaseServerResponseStatusENABLESECURITYFAILED string = "ENABLE_SECURITY_FAILED" + + // DescribeDatabaseServerResponseStatusDELETEREQUESTED captures enum value "DELETE_REQUESTED" + DescribeDatabaseServerResponseStatusDELETEREQUESTED string = "DELETE_REQUESTED" + + // DescribeDatabaseServerResponseStatusPREDELETEINPROGRESS captures enum value "PRE_DELETE_IN_PROGRESS" + DescribeDatabaseServerResponseStatusPREDELETEINPROGRESS string = "PRE_DELETE_IN_PROGRESS" + + // DescribeDatabaseServerResponseStatusDELETEINPROGRESS captures enum value "DELETE_IN_PROGRESS" + DescribeDatabaseServerResponseStatusDELETEINPROGRESS string = "DELETE_IN_PROGRESS" + + // DescribeDatabaseServerResponseStatusDELETEFAILED captures enum value "DELETE_FAILED" + DescribeDatabaseServerResponseStatusDELETEFAILED string = "DELETE_FAILED" + + // DescribeDatabaseServerResponseStatusDELETECOMPLETED captures enum value "DELETE_COMPLETED" + DescribeDatabaseServerResponseStatusDELETECOMPLETED string = "DELETE_COMPLETED" + + // DescribeDatabaseServerResponseStatusSTOPPED captures enum value "STOPPED" + DescribeDatabaseServerResponseStatusSTOPPED string = "STOPPED" + + // DescribeDatabaseServerResponseStatusSTOPREQUESTED captures enum value "STOP_REQUESTED" + DescribeDatabaseServerResponseStatusSTOPREQUESTED string = "STOP_REQUESTED" + + // DescribeDatabaseServerResponseStatusSTARTREQUESTED captures enum value "START_REQUESTED" + DescribeDatabaseServerResponseStatusSTARTREQUESTED string = "START_REQUESTED" + + // DescribeDatabaseServerResponseStatusSTOPINPROGRESS captures enum value "STOP_IN_PROGRESS" + DescribeDatabaseServerResponseStatusSTOPINPROGRESS string = "STOP_IN_PROGRESS" + + // DescribeDatabaseServerResponseStatusSTARTINPROGRESS captures enum value "START_IN_PROGRESS" + DescribeDatabaseServerResponseStatusSTARTINPROGRESS string = "START_IN_PROGRESS" + + // DescribeDatabaseServerResponseStatusSTARTFAILED captures enum value "START_FAILED" + DescribeDatabaseServerResponseStatusSTARTFAILED string = "START_FAILED" + + // DescribeDatabaseServerResponseStatusSTOPFAILED captures enum value "STOP_FAILED" + DescribeDatabaseServerResponseStatusSTOPFAILED string = "STOP_FAILED" + + // DescribeDatabaseServerResponseStatusWAITFORSYNC captures enum value "WAIT_FOR_SYNC" + DescribeDatabaseServerResponseStatusWAITFORSYNC string = "WAIT_FOR_SYNC" + + // DescribeDatabaseServerResponseStatusMAINTENANCEMODEENABLED captures enum value "MAINTENANCE_MODE_ENABLED" + DescribeDatabaseServerResponseStatusMAINTENANCEMODEENABLED string = "MAINTENANCE_MODE_ENABLED" + + // DescribeDatabaseServerResponseStatusUNKNOWN captures enum value "UNKNOWN" + DescribeDatabaseServerResponseStatusUNKNOWN string = "UNKNOWN" +) + +// prop value enum +func (m *DescribeDatabaseServerResponse) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, describeDatabaseServerResponseTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DescribeDatabaseServerResponse) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this describe database server response based on the context it is used +func (m *DescribeDatabaseServerResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSslConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DescribeDatabaseServerResponse) contextValidateSslConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.SslConfig != nil { + + if swag.IsZero(m.SslConfig) { // not required + return nil + } + + if err := m.SslConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sslConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sslConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DescribeDatabaseServerResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DescribeDatabaseServerResponse) UnmarshalBinary(b []byte) error { + var res DescribeDatabaseServerResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datalake/models/disk_options.go b/cdp-sdk-go/gen/datalake/models/disk_options.go new file mode 100644 index 00000000..8a3d4911 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/disk_options.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DiskOptions Attached disk configuration(s). +// +// swagger:model DiskOptions +type DiskOptions struct { + + // Modifies all the disks attached to all instances in a group. + ModifyDisks *ModifyDisks `json:"modifyDisks,omitempty"` +} + +// Validate validates this disk options +func (m *DiskOptions) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateModifyDisks(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DiskOptions) validateModifyDisks(formats strfmt.Registry) error { + if swag.IsZero(m.ModifyDisks) { // not required + return nil + } + + if m.ModifyDisks != nil { + if err := m.ModifyDisks.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modifyDisks") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modifyDisks") + } + return err + } + } + + return nil +} + +// ContextValidate validate this disk options based on the context it is used +func (m *DiskOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateModifyDisks(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DiskOptions) contextValidateModifyDisks(ctx context.Context, formats strfmt.Registry) error { + + if m.ModifyDisks != nil { + + if swag.IsZero(m.ModifyDisks) { // not required + return nil + } + + if err := m.ModifyDisks.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modifyDisks") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modifyDisks") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DiskOptions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DiskOptions) UnmarshalBinary(b []byte) error { + var res DiskOptions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datalake/models/image_request.go b/cdp-sdk-go/gen/datalake/models/image_request.go index d80e5b62..5de9de33 100644 --- a/cdp-sdk-go/gen/datalake/models/image_request.go +++ b/cdp-sdk-go/gen/datalake/models/image_request.go @@ -8,45 +8,27 @@ package models import ( "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/go-openapi/validate" ) -// ImageRequest The image request for the datalake. This must not be set if the runtime parameter is provided. The image ID parameter is required if this is present, but the image catalog name is optional, defaulting to 'cdp-default' if not present. +// ImageRequest The image request for the datalake. When the 'runtime' parameter is set, only the 'os' parameter can be provided. Otherwise, you can use 'catalog name' and/or 'id' for selecting an image. // // swagger:model ImageRequest type ImageRequest struct { - // The name of the custom image catalog to use. + // The name of the custom image catalog to use, defaulting to 'cdp-default' if not present. CatalogName *string `json:"catalogName,omitempty"` // The image ID from the catalog. The corresponding image will be used for the created cluster machines. - // Required: true - ID *string `json:"id"` + ID string `json:"id,omitempty"` + + // The OS of the image used for cluster instances. + Os string `json:"os,omitempty"` } // Validate validates this image request func (m *ImageRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ImageRequest) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - return nil } diff --git a/cdp-sdk-go/gen/datalake/models/modify_disks.go b/cdp-sdk-go/gen/datalake/models/modify_disks.go new file mode 100644 index 00000000..67f8c737 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/modify_disks.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModifyDisks Attached volume configuration. +// +// swagger:model ModifyDisks +type ModifyDisks struct { + + // Size of disks to modify to on all the instances in a group in GB. + // Required: true + Size *int32 `json:"size"` + + // Type of disks to modify to on all the instances in a group. + // Required: true + VolumeType *string `json:"volumeType"` +} + +// Validate validates this modify disks +func (m *ModifyDisks) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSize(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVolumeType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModifyDisks) validateSize(formats strfmt.Registry) error { + + if err := validate.Required("size", "body", m.Size); err != nil { + return err + } + + return nil +} + +func (m *ModifyDisks) validateVolumeType(formats strfmt.Registry) error { + + if err := validate.Required("volumeType", "body", m.VolumeType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this modify disks based on context it is used +func (m *ModifyDisks) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModifyDisks) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModifyDisks) UnmarshalBinary(b []byte) error { + var res ModifyDisks + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datalake/models/resize_datalake_request.go b/cdp-sdk-go/gen/datalake/models/resize_datalake_request.go index 9fe0eabc..669049dd 100644 --- a/cdp-sdk-go/gen/datalake/models/resize_datalake_request.go +++ b/cdp-sdk-go/gen/datalake/models/resize_datalake_request.go @@ -24,9 +24,12 @@ type ResizeDatalakeRequest struct { // Required: true DatalakeName *string `json:"datalakeName"` + // Whether to deploy a new datalake in a multi-availability zone way. + MultiAz *bool `json:"multiAz,omitempty"` + // The target size for the datalake. // Required: true - // Enum: [MEDIUM_DUTY_HA] + // Enum: [MEDIUM_DUTY_HA ENTERPRISE] TargetSize *string `json:"targetSize"` } @@ -61,7 +64,7 @@ var resizeDatalakeRequestTypeTargetSizePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["MEDIUM_DUTY_HA"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["MEDIUM_DUTY_HA","ENTERPRISE"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -73,6 +76,9 @@ const ( // ResizeDatalakeRequestTargetSizeMEDIUMDUTYHA captures enum value "MEDIUM_DUTY_HA" ResizeDatalakeRequestTargetSizeMEDIUMDUTYHA string = "MEDIUM_DUTY_HA" + + // ResizeDatalakeRequestTargetSizeENTERPRISE captures enum value "ENTERPRISE" + ResizeDatalakeRequestTargetSizeENTERPRISE string = "ENTERPRISE" ) // prop value enum diff --git a/cdp-sdk-go/gen/datalake/models/scale_horizontally_request.go b/cdp-sdk-go/gen/datalake/models/scale_horizontally_request.go new file mode 100644 index 00000000..0679c726 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/scale_horizontally_request.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ScaleHorizontallyRequest Data lake horizontal scaling request. +// +// swagger:model ScaleHorizontallyRequest +type ScaleHorizontallyRequest struct { + + // the name of the Data Lake + // Required: true + DatalakeName *string `json:"datalakeName"` + + // The target number of the scaling operation. If the desired count is less than the actual node count the scaling action will be a downscale operation. + // Required: true + // Maximum: 40 + // Minimum: 0 + InstanceGroupDesiredCount *int32 `json:"instanceGroupDesiredCount"` + + // The target host group name to be scaled. + // Required: true + // Enum: [solr_scale_out hms_scale_out raz_scale_out kafka_scale_out storage_scale_out] + InstanceGroupName *string `json:"instanceGroupName"` +} + +// Validate validates this scale horizontally request +func (m *ScaleHorizontallyRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDatalakeName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstanceGroupDesiredCount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstanceGroupName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ScaleHorizontallyRequest) validateDatalakeName(formats strfmt.Registry) error { + + if err := validate.Required("datalakeName", "body", m.DatalakeName); err != nil { + return err + } + + return nil +} + +func (m *ScaleHorizontallyRequest) validateInstanceGroupDesiredCount(formats strfmt.Registry) error { + + if err := validate.Required("instanceGroupDesiredCount", "body", m.InstanceGroupDesiredCount); err != nil { + return err + } + + if err := validate.MinimumInt("instanceGroupDesiredCount", "body", int64(*m.InstanceGroupDesiredCount), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("instanceGroupDesiredCount", "body", int64(*m.InstanceGroupDesiredCount), 40, false); err != nil { + return err + } + + return nil +} + +var scaleHorizontallyRequestTypeInstanceGroupNamePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["solr_scale_out","hms_scale_out","raz_scale_out","kafka_scale_out","storage_scale_out"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + scaleHorizontallyRequestTypeInstanceGroupNamePropEnum = append(scaleHorizontallyRequestTypeInstanceGroupNamePropEnum, v) + } +} + +const ( + + // ScaleHorizontallyRequestInstanceGroupNameSolrScaleOut captures enum value "solr_scale_out" + ScaleHorizontallyRequestInstanceGroupNameSolrScaleOut string = "solr_scale_out" + + // ScaleHorizontallyRequestInstanceGroupNameHmsScaleOut captures enum value "hms_scale_out" + ScaleHorizontallyRequestInstanceGroupNameHmsScaleOut string = "hms_scale_out" + + // ScaleHorizontallyRequestInstanceGroupNameRazScaleOut captures enum value "raz_scale_out" + ScaleHorizontallyRequestInstanceGroupNameRazScaleOut string = "raz_scale_out" + + // ScaleHorizontallyRequestInstanceGroupNameKafkaScaleOut captures enum value "kafka_scale_out" + ScaleHorizontallyRequestInstanceGroupNameKafkaScaleOut string = "kafka_scale_out" + + // ScaleHorizontallyRequestInstanceGroupNameStorageScaleOut captures enum value "storage_scale_out" + ScaleHorizontallyRequestInstanceGroupNameStorageScaleOut string = "storage_scale_out" +) + +// prop value enum +func (m *ScaleHorizontallyRequest) validateInstanceGroupNameEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, scaleHorizontallyRequestTypeInstanceGroupNamePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ScaleHorizontallyRequest) validateInstanceGroupName(formats strfmt.Registry) error { + + if err := validate.Required("instanceGroupName", "body", m.InstanceGroupName); err != nil { + return err + } + + // value enum + if err := m.validateInstanceGroupNameEnum("instanceGroupName", "body", *m.InstanceGroupName); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this scale horizontally request based on context it is used +func (m *ScaleHorizontallyRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ScaleHorizontallyRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ScaleHorizontallyRequest) UnmarshalBinary(b []byte) error { + var res ScaleHorizontallyRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datalake/models/scale_horizontally_response.go b/cdp-sdk-go/gen/datalake/models/scale_horizontally_response.go new file mode 100644 index 00000000..74035d25 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/scale_horizontally_response.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ScaleHorizontallyResponse Data Lake horizontal scaling response +// +// swagger:model ScaleHorizontallyResponse +type ScaleHorizontallyResponse struct { + + // The name of the datalake. + DatalakeName string `json:"datalakeName,omitempty"` +} + +// Validate validates this scale horizontally response +func (m *ScaleHorizontallyResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this scale horizontally response based on context it is used +func (m *ScaleHorizontallyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ScaleHorizontallyResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ScaleHorizontallyResponse) UnmarshalBinary(b []byte) error { + var res ScaleHorizontallyResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datalake/models/start_database_upgrade_request.go b/cdp-sdk-go/gen/datalake/models/start_database_upgrade_request.go index c5fcb132..5a20597b 100644 --- a/cdp-sdk-go/gen/datalake/models/start_database_upgrade_request.go +++ b/cdp-sdk-go/gen/datalake/models/start_database_upgrade_request.go @@ -24,8 +24,11 @@ type StartDatabaseUpgradeRequest struct { // Required: true Datalake *string `json:"datalake"` + // Start the database upgrade flow even if the source and target versions are the same. Can be used to reinitiate an upgrade after a failure. + Force bool `json:"force,omitempty"` + // The database engine major version to upgrade to. - // Enum: [VERSION_11] + // Enum: [VERSION_11 VERSION_14] TargetVersion string `json:"targetVersion,omitempty"` } @@ -60,7 +63,7 @@ var startDatabaseUpgradeRequestTypeTargetVersionPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["VERSION_11"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["VERSION_11","VERSION_14"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -72,6 +75,9 @@ const ( // StartDatabaseUpgradeRequestTargetVersionVERSION11 captures enum value "VERSION_11" StartDatabaseUpgradeRequestTargetVersionVERSION11 string = "VERSION_11" + + // StartDatabaseUpgradeRequestTargetVersionVERSION14 captures enum value "VERSION_14" + StartDatabaseUpgradeRequestTargetVersionVERSION14 string = "VERSION_14" ) // prop value enum diff --git a/cdp-sdk-go/gen/datalake/models/start_database_upgrade_response.go b/cdp-sdk-go/gen/datalake/models/start_database_upgrade_response.go index 773b3f7c..8b2858c6 100644 --- a/cdp-sdk-go/gen/datalake/models/start_database_upgrade_response.go +++ b/cdp-sdk-go/gen/datalake/models/start_database_upgrade_response.go @@ -7,12 +7,9 @@ package models import ( "context" - "encoding/json" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/go-openapi/validate" ) // StartDatabaseUpgradeResponse Response object to Data Lake database upgrade. @@ -21,60 +18,11 @@ import ( type StartDatabaseUpgradeResponse struct { // The database engine major version to upgrade to. - // Enum: [VERSION_11] TargetVersion string `json:"targetVersion,omitempty"` } // Validate validates this start database upgrade response func (m *StartDatabaseUpgradeResponse) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTargetVersion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var startDatabaseUpgradeResponseTypeTargetVersionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["VERSION_11"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - startDatabaseUpgradeResponseTypeTargetVersionPropEnum = append(startDatabaseUpgradeResponseTypeTargetVersionPropEnum, v) - } -} - -const ( - - // StartDatabaseUpgradeResponseTargetVersionVERSION11 captures enum value "VERSION_11" - StartDatabaseUpgradeResponseTargetVersionVERSION11 string = "VERSION_11" -) - -// prop value enum -func (m *StartDatabaseUpgradeResponse) validateTargetVersionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, startDatabaseUpgradeResponseTypeTargetVersionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *StartDatabaseUpgradeResponse) validateTargetVersion(formats strfmt.Registry) error { - if swag.IsZero(m.TargetVersion) { // not required - return nil - } - - // value enum - if err := m.validateTargetVersionEnum("targetVersion", "body", m.TargetVersion); err != nil { - return err - } - return nil } diff --git a/cdp-sdk-go/gen/datalake/models/start_datalake_vertical_scaling_request.go b/cdp-sdk-go/gen/datalake/models/start_datalake_vertical_scaling_request.go index b774d17b..ec46a877 100644 --- a/cdp-sdk-go/gen/datalake/models/start_datalake_vertical_scaling_request.go +++ b/cdp-sdk-go/gen/datalake/models/start_datalake_vertical_scaling_request.go @@ -23,13 +23,15 @@ type StartDatalakeVerticalScalingRequest struct { // Required: true Datalake *string `json:"datalake"` + // Disk options for vertical scaling - modify disks. + DiskOptions *DiskOptions `json:"diskOptions,omitempty"` + // The target group that requested vertical scaling. // Required: true Group *string `json:"group"` // Instance template that specifies the core information for the vertical scale. - // Required: true - InstanceTemplate *InstanceTemplate `json:"instanceTemplate"` + InstanceTemplate *InstanceTemplate `json:"instanceTemplate,omitempty"` } // Validate validates this start datalake vertical scaling request @@ -40,6 +42,10 @@ func (m *StartDatalakeVerticalScalingRequest) Validate(formats strfmt.Registry) res = append(res, err) } + if err := m.validateDiskOptions(formats); err != nil { + res = append(res, err) + } + if err := m.validateGroup(formats); err != nil { res = append(res, err) } @@ -63,6 +69,25 @@ func (m *StartDatalakeVerticalScalingRequest) validateDatalake(formats strfmt.Re return nil } +func (m *StartDatalakeVerticalScalingRequest) validateDiskOptions(formats strfmt.Registry) error { + if swag.IsZero(m.DiskOptions) { // not required + return nil + } + + if m.DiskOptions != nil { + if err := m.DiskOptions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("diskOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("diskOptions") + } + return err + } + } + + return nil +} + func (m *StartDatalakeVerticalScalingRequest) validateGroup(formats strfmt.Registry) error { if err := validate.Required("group", "body", m.Group); err != nil { @@ -73,9 +98,8 @@ func (m *StartDatalakeVerticalScalingRequest) validateGroup(formats strfmt.Regis } func (m *StartDatalakeVerticalScalingRequest) validateInstanceTemplate(formats strfmt.Registry) error { - - if err := validate.Required("instanceTemplate", "body", m.InstanceTemplate); err != nil { - return err + if swag.IsZero(m.InstanceTemplate) { // not required + return nil } if m.InstanceTemplate != nil { @@ -96,6 +120,10 @@ func (m *StartDatalakeVerticalScalingRequest) validateInstanceTemplate(formats s func (m *StartDatalakeVerticalScalingRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateDiskOptions(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateInstanceTemplate(ctx, formats); err != nil { res = append(res, err) } @@ -106,10 +134,35 @@ func (m *StartDatalakeVerticalScalingRequest) ContextValidate(ctx context.Contex return nil } +func (m *StartDatalakeVerticalScalingRequest) contextValidateDiskOptions(ctx context.Context, formats strfmt.Registry) error { + + if m.DiskOptions != nil { + + if swag.IsZero(m.DiskOptions) { // not required + return nil + } + + if err := m.DiskOptions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("diskOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("diskOptions") + } + return err + } + } + + return nil +} + func (m *StartDatalakeVerticalScalingRequest) contextValidateInstanceTemplate(ctx context.Context, formats strfmt.Registry) error { if m.InstanceTemplate != nil { + if swag.IsZero(m.InstanceTemplate) { // not required + return nil + } + if err := m.InstanceTemplate.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("instanceTemplate") diff --git a/cdp-sdk-go/gen/datalake/models/validate_aws_cloud_storage_request.go b/cdp-sdk-go/gen/datalake/models/validate_aws_cloud_storage_request.go new file mode 100644 index 00000000..0e05ac84 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/validate_aws_cloud_storage_request.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ValidateAwsCloudStorageRequest Request object for AWS cloud storage validation. +// +// swagger:model ValidateAwsCloudStorageRequest +type ValidateAwsCloudStorageRequest struct { + + // Name of the blueprint. + // Required: true + BlueprintName *string `json:"blueprintName"` + + // Datalake cluster name. + // Required: true + ClusterName *string `json:"clusterName"` + + // Credential CRN. + // Required: true + CredentialCrn *string `json:"credentialCrn"` + + // Data access role. + // Required: true + DataAccessRole *string `json:"dataAccessRole"` + + // AWS instance profile. + // Required: true + InstanceProfile *string `json:"instanceProfile"` + + // Ranger audit role. + // Required: true + RangerAuditRole *string `json:"rangerAuditRole"` + + // AWS S3 storage bucket base location. + // Required: true + StorageLocation *string `json:"storageLocation"` +} + +// Validate validates this validate aws cloud storage request +func (m *ValidateAwsCloudStorageRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBlueprintName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCredentialCrn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDataAccessRole(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstanceProfile(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRangerAuditRole(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ValidateAwsCloudStorageRequest) validateBlueprintName(formats strfmt.Registry) error { + + if err := validate.Required("blueprintName", "body", m.BlueprintName); err != nil { + return err + } + + return nil +} + +func (m *ValidateAwsCloudStorageRequest) validateClusterName(formats strfmt.Registry) error { + + if err := validate.Required("clusterName", "body", m.ClusterName); err != nil { + return err + } + + return nil +} + +func (m *ValidateAwsCloudStorageRequest) validateCredentialCrn(formats strfmt.Registry) error { + + if err := validate.Required("credentialCrn", "body", m.CredentialCrn); err != nil { + return err + } + + return nil +} + +func (m *ValidateAwsCloudStorageRequest) validateDataAccessRole(formats strfmt.Registry) error { + + if err := validate.Required("dataAccessRole", "body", m.DataAccessRole); err != nil { + return err + } + + return nil +} + +func (m *ValidateAwsCloudStorageRequest) validateInstanceProfile(formats strfmt.Registry) error { + + if err := validate.Required("instanceProfile", "body", m.InstanceProfile); err != nil { + return err + } + + return nil +} + +func (m *ValidateAwsCloudStorageRequest) validateRangerAuditRole(formats strfmt.Registry) error { + + if err := validate.Required("rangerAuditRole", "body", m.RangerAuditRole); err != nil { + return err + } + + return nil +} + +func (m *ValidateAwsCloudStorageRequest) validateStorageLocation(formats strfmt.Registry) error { + + if err := validate.Required("storageLocation", "body", m.StorageLocation); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this validate aws cloud storage request based on context it is used +func (m *ValidateAwsCloudStorageRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ValidateAwsCloudStorageRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidateAwsCloudStorageRequest) UnmarshalBinary(b []byte) error { + var res ValidateAwsCloudStorageRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datalake/models/validate_aws_cloud_storage_response.go b/cdp-sdk-go/gen/datalake/models/validate_aws_cloud_storage_response.go new file mode 100644 index 00000000..f16f96a5 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/validate_aws_cloud_storage_response.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ValidateAwsCloudStorageResponse AWS cloud storage validation response. +// +// swagger:model ValidateAwsCloudStorageResponse +type ValidateAwsCloudStorageResponse struct { + + // Error message if validation failed. + Error string `json:"error,omitempty"` + + // Validation result. Allowed values are "OK", "ACCESS_DENIED", "ERROR", "RESOURCE_NOT_FOUND". + Status string `json:"status,omitempty"` +} + +// Validate validates this validate aws cloud storage response +func (m *ValidateAwsCloudStorageResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this validate aws cloud storage response based on context it is used +func (m *ValidateAwsCloudStorageResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ValidateAwsCloudStorageResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidateAwsCloudStorageResponse) UnmarshalBinary(b []byte) error { + var res ValidateAwsCloudStorageResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datalake/models/validate_azure_cloud_storage_request.go b/cdp-sdk-go/gen/datalake/models/validate_azure_cloud_storage_request.go new file mode 100644 index 00000000..daf65d14 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/validate_azure_cloud_storage_request.go @@ -0,0 +1,168 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ValidateAzureCloudStorageRequest Request object for Azure cloud storage validation. +// +// swagger:model ValidateAzureCloudStorageRequest +type ValidateAzureCloudStorageRequest struct { + + // Azure account key. + AccountKey string `json:"accountKey,omitempty"` + + // Azure account name. + AccountName string `json:"accountName,omitempty"` + + // Name of the blueprint. + // Required: true + BlueprintName *string `json:"blueprintName"` + + // Datalake cluster name. + // Required: true + ClusterName *string `json:"clusterName"` + + // Credential CRN. + // Required: true + CredentialCrn *string `json:"credentialCrn"` + + // Data access role. + // Required: true + DataAccessRole *string `json:"dataAccessRole"` + + // Azure managed identity. + ManagedIdentity string `json:"managedIdentity,omitempty"` + + // Ranger audit role. + // Required: true + RangerAuditRole *string `json:"rangerAuditRole"` + + // Azure secure flag. + Secure bool `json:"secure,omitempty"` + + // Azure storage base location. + // Required: true + StorageLocation *string `json:"storageLocation"` +} + +// Validate validates this validate azure cloud storage request +func (m *ValidateAzureCloudStorageRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBlueprintName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateClusterName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCredentialCrn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDataAccessRole(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRangerAuditRole(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ValidateAzureCloudStorageRequest) validateBlueprintName(formats strfmt.Registry) error { + + if err := validate.Required("blueprintName", "body", m.BlueprintName); err != nil { + return err + } + + return nil +} + +func (m *ValidateAzureCloudStorageRequest) validateClusterName(formats strfmt.Registry) error { + + if err := validate.Required("clusterName", "body", m.ClusterName); err != nil { + return err + } + + return nil +} + +func (m *ValidateAzureCloudStorageRequest) validateCredentialCrn(formats strfmt.Registry) error { + + if err := validate.Required("credentialCrn", "body", m.CredentialCrn); err != nil { + return err + } + + return nil +} + +func (m *ValidateAzureCloudStorageRequest) validateDataAccessRole(formats strfmt.Registry) error { + + if err := validate.Required("dataAccessRole", "body", m.DataAccessRole); err != nil { + return err + } + + return nil +} + +func (m *ValidateAzureCloudStorageRequest) validateRangerAuditRole(formats strfmt.Registry) error { + + if err := validate.Required("rangerAuditRole", "body", m.RangerAuditRole); err != nil { + return err + } + + return nil +} + +func (m *ValidateAzureCloudStorageRequest) validateStorageLocation(formats strfmt.Registry) error { + + if err := validate.Required("storageLocation", "body", m.StorageLocation); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this validate azure cloud storage request based on context it is used +func (m *ValidateAzureCloudStorageRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ValidateAzureCloudStorageRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidateAzureCloudStorageRequest) UnmarshalBinary(b []byte) error { + var res ValidateAzureCloudStorageRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/datalake/models/validate_azure_cloud_storage_response.go b/cdp-sdk-go/gen/datalake/models/validate_azure_cloud_storage_response.go new file mode 100644 index 00000000..fc0e8b73 --- /dev/null +++ b/cdp-sdk-go/gen/datalake/models/validate_azure_cloud_storage_response.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ValidateAzureCloudStorageResponse Azure cloud storage validation response. +// +// swagger:model ValidateAzureCloudStorageResponse +type ValidateAzureCloudStorageResponse struct { + + // Error message if validation failed. + Error string `json:"error,omitempty"` + + // Validation result. Allowed values are "OK", "ACCESS_DENIED", "ERROR", "RESOURCE_NOT_FOUND". + Status string `json:"status,omitempty"` +} + +// Validate validates this validate azure cloud storage response +func (m *ValidateAzureCloudStorageResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this validate azure cloud storage response based on context it is used +func (m *ValidateAzureCloudStorageResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ValidateAzureCloudStorageResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidateAzureCloudStorageResponse) UnmarshalBinary(b []byte) error { + var res ValidateAzureCloudStorageResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/client/operations/create_aws_cluster_parameters.go b/cdp-sdk-go/gen/dw/client/operations/create_aws_cluster_parameters.go new file mode 100644 index 00000000..970df35e --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/create_aws_cluster_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// NewCreateAwsClusterParams creates a new CreateAwsClusterParams 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 NewCreateAwsClusterParams() *CreateAwsClusterParams { + return &CreateAwsClusterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateAwsClusterParamsWithTimeout creates a new CreateAwsClusterParams object +// with the ability to set a timeout on a request. +func NewCreateAwsClusterParamsWithTimeout(timeout time.Duration) *CreateAwsClusterParams { + return &CreateAwsClusterParams{ + timeout: timeout, + } +} + +// NewCreateAwsClusterParamsWithContext creates a new CreateAwsClusterParams object +// with the ability to set a context for a request. +func NewCreateAwsClusterParamsWithContext(ctx context.Context) *CreateAwsClusterParams { + return &CreateAwsClusterParams{ + Context: ctx, + } +} + +// NewCreateAwsClusterParamsWithHTTPClient creates a new CreateAwsClusterParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateAwsClusterParamsWithHTTPClient(client *http.Client) *CreateAwsClusterParams { + return &CreateAwsClusterParams{ + HTTPClient: client, + } +} + +/* +CreateAwsClusterParams contains all the parameters to send to the API endpoint + + for the create aws cluster operation. + + Typically these are written to a http.Request. +*/ +type CreateAwsClusterParams struct { + + // Input. + Input *models.CreateAwsClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create aws cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAwsClusterParams) WithDefaults() *CreateAwsClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create aws cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAwsClusterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create aws cluster params +func (o *CreateAwsClusterParams) WithTimeout(timeout time.Duration) *CreateAwsClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create aws cluster params +func (o *CreateAwsClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create aws cluster params +func (o *CreateAwsClusterParams) WithContext(ctx context.Context) *CreateAwsClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create aws cluster params +func (o *CreateAwsClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create aws cluster params +func (o *CreateAwsClusterParams) WithHTTPClient(client *http.Client) *CreateAwsClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create aws cluster params +func (o *CreateAwsClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the create aws cluster params +func (o *CreateAwsClusterParams) WithInput(input *models.CreateAwsClusterRequest) *CreateAwsClusterParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the create aws cluster params +func (o *CreateAwsClusterParams) SetInput(input *models.CreateAwsClusterRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateAwsClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/dw/client/operations/create_aws_cluster_responses.go b/cdp-sdk-go/gen/dw/client/operations/create_aws_cluster_responses.go new file mode 100644 index 00000000..563b1465 --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/create_aws_cluster_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// CreateAwsClusterReader is a Reader for the CreateAwsCluster structure. +type CreateAwsClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateAwsClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateAwsClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreateAwsClusterDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCreateAwsClusterOK creates a CreateAwsClusterOK with default headers values +func NewCreateAwsClusterOK() *CreateAwsClusterOK { + return &CreateAwsClusterOK{} +} + +/* +CreateAwsClusterOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type CreateAwsClusterOK struct { + Payload *models.CreateAwsClusterResponse +} + +// IsSuccess returns true when this create aws cluster o k response has a 2xx status code +func (o *CreateAwsClusterOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create aws cluster o k response has a 3xx status code +func (o *CreateAwsClusterOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create aws cluster o k response has a 4xx status code +func (o *CreateAwsClusterOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create aws cluster o k response has a 5xx status code +func (o *CreateAwsClusterOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create aws cluster o k response a status code equal to that given +func (o *CreateAwsClusterOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create aws cluster o k response +func (o *CreateAwsClusterOK) Code() int { + return 200 +} + +func (o *CreateAwsClusterOK) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/createAwsCluster][%d] createAwsClusterOK %+v", 200, o.Payload) +} + +func (o *CreateAwsClusterOK) String() string { + return fmt.Sprintf("[POST /api/v1/dw/createAwsCluster][%d] createAwsClusterOK %+v", 200, o.Payload) +} + +func (o *CreateAwsClusterOK) GetPayload() *models.CreateAwsClusterResponse { + return o.Payload +} + +func (o *CreateAwsClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CreateAwsClusterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateAwsClusterDefault creates a CreateAwsClusterDefault with default headers values +func NewCreateAwsClusterDefault(code int) *CreateAwsClusterDefault { + return &CreateAwsClusterDefault{ + _statusCode: code, + } +} + +/* +CreateAwsClusterDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type CreateAwsClusterDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this create aws cluster default response has a 2xx status code +func (o *CreateAwsClusterDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this create aws cluster default response has a 3xx status code +func (o *CreateAwsClusterDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this create aws cluster default response has a 4xx status code +func (o *CreateAwsClusterDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this create aws cluster default response has a 5xx status code +func (o *CreateAwsClusterDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this create aws cluster default response a status code equal to that given +func (o *CreateAwsClusterDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the create aws cluster default response +func (o *CreateAwsClusterDefault) Code() int { + return o._statusCode +} + +func (o *CreateAwsClusterDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/createAwsCluster][%d] createAwsCluster default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAwsClusterDefault) String() string { + return fmt.Sprintf("[POST /api/v1/dw/createAwsCluster][%d] createAwsCluster default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAwsClusterDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *CreateAwsClusterDefault) 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/cdp-sdk-go/gen/dw/client/operations/create_azure_cluster_parameters.go b/cdp-sdk-go/gen/dw/client/operations/create_azure_cluster_parameters.go new file mode 100644 index 00000000..77e78250 --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/create_azure_cluster_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// NewCreateAzureClusterParams creates a new CreateAzureClusterParams 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 NewCreateAzureClusterParams() *CreateAzureClusterParams { + return &CreateAzureClusterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateAzureClusterParamsWithTimeout creates a new CreateAzureClusterParams object +// with the ability to set a timeout on a request. +func NewCreateAzureClusterParamsWithTimeout(timeout time.Duration) *CreateAzureClusterParams { + return &CreateAzureClusterParams{ + timeout: timeout, + } +} + +// NewCreateAzureClusterParamsWithContext creates a new CreateAzureClusterParams object +// with the ability to set a context for a request. +func NewCreateAzureClusterParamsWithContext(ctx context.Context) *CreateAzureClusterParams { + return &CreateAzureClusterParams{ + Context: ctx, + } +} + +// NewCreateAzureClusterParamsWithHTTPClient creates a new CreateAzureClusterParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateAzureClusterParamsWithHTTPClient(client *http.Client) *CreateAzureClusterParams { + return &CreateAzureClusterParams{ + HTTPClient: client, + } +} + +/* +CreateAzureClusterParams contains all the parameters to send to the API endpoint + + for the create azure cluster operation. + + Typically these are written to a http.Request. +*/ +type CreateAzureClusterParams struct { + + // Input. + Input *models.CreateAzureClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create azure cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAzureClusterParams) WithDefaults() *CreateAzureClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create azure cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAzureClusterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create azure cluster params +func (o *CreateAzureClusterParams) WithTimeout(timeout time.Duration) *CreateAzureClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create azure cluster params +func (o *CreateAzureClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create azure cluster params +func (o *CreateAzureClusterParams) WithContext(ctx context.Context) *CreateAzureClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create azure cluster params +func (o *CreateAzureClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create azure cluster params +func (o *CreateAzureClusterParams) WithHTTPClient(client *http.Client) *CreateAzureClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create azure cluster params +func (o *CreateAzureClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the create azure cluster params +func (o *CreateAzureClusterParams) WithInput(input *models.CreateAzureClusterRequest) *CreateAzureClusterParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the create azure cluster params +func (o *CreateAzureClusterParams) SetInput(input *models.CreateAzureClusterRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateAzureClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/dw/client/operations/create_azure_cluster_responses.go b/cdp-sdk-go/gen/dw/client/operations/create_azure_cluster_responses.go new file mode 100644 index 00000000..3a934204 --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/create_azure_cluster_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// CreateAzureClusterReader is a Reader for the CreateAzureCluster structure. +type CreateAzureClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateAzureClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateAzureClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreateAzureClusterDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCreateAzureClusterOK creates a CreateAzureClusterOK with default headers values +func NewCreateAzureClusterOK() *CreateAzureClusterOK { + return &CreateAzureClusterOK{} +} + +/* +CreateAzureClusterOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type CreateAzureClusterOK struct { + Payload *models.CreateAzureClusterResponse +} + +// IsSuccess returns true when this create azure cluster o k response has a 2xx status code +func (o *CreateAzureClusterOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create azure cluster o k response has a 3xx status code +func (o *CreateAzureClusterOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create azure cluster o k response has a 4xx status code +func (o *CreateAzureClusterOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create azure cluster o k response has a 5xx status code +func (o *CreateAzureClusterOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create azure cluster o k response a status code equal to that given +func (o *CreateAzureClusterOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create azure cluster o k response +func (o *CreateAzureClusterOK) Code() int { + return 200 +} + +func (o *CreateAzureClusterOK) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/createAzureCluster][%d] createAzureClusterOK %+v", 200, o.Payload) +} + +func (o *CreateAzureClusterOK) String() string { + return fmt.Sprintf("[POST /api/v1/dw/createAzureCluster][%d] createAzureClusterOK %+v", 200, o.Payload) +} + +func (o *CreateAzureClusterOK) GetPayload() *models.CreateAzureClusterResponse { + return o.Payload +} + +func (o *CreateAzureClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CreateAzureClusterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateAzureClusterDefault creates a CreateAzureClusterDefault with default headers values +func NewCreateAzureClusterDefault(code int) *CreateAzureClusterDefault { + return &CreateAzureClusterDefault{ + _statusCode: code, + } +} + +/* +CreateAzureClusterDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type CreateAzureClusterDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this create azure cluster default response has a 2xx status code +func (o *CreateAzureClusterDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this create azure cluster default response has a 3xx status code +func (o *CreateAzureClusterDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this create azure cluster default response has a 4xx status code +func (o *CreateAzureClusterDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this create azure cluster default response has a 5xx status code +func (o *CreateAzureClusterDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this create azure cluster default response a status code equal to that given +func (o *CreateAzureClusterDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the create azure cluster default response +func (o *CreateAzureClusterDefault) Code() int { + return o._statusCode +} + +func (o *CreateAzureClusterDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/createAzureCluster][%d] createAzureCluster default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAzureClusterDefault) String() string { + return fmt.Sprintf("[POST /api/v1/dw/createAzureCluster][%d] createAzureCluster default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAzureClusterDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *CreateAzureClusterDefault) 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/cdp-sdk-go/gen/dw/client/operations/create_private_cluster_parameters.go b/cdp-sdk-go/gen/dw/client/operations/create_private_cluster_parameters.go new file mode 100644 index 00000000..731560b7 --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/create_private_cluster_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// NewCreatePrivateClusterParams creates a new CreatePrivateClusterParams 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 NewCreatePrivateClusterParams() *CreatePrivateClusterParams { + return &CreatePrivateClusterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreatePrivateClusterParamsWithTimeout creates a new CreatePrivateClusterParams object +// with the ability to set a timeout on a request. +func NewCreatePrivateClusterParamsWithTimeout(timeout time.Duration) *CreatePrivateClusterParams { + return &CreatePrivateClusterParams{ + timeout: timeout, + } +} + +// NewCreatePrivateClusterParamsWithContext creates a new CreatePrivateClusterParams object +// with the ability to set a context for a request. +func NewCreatePrivateClusterParamsWithContext(ctx context.Context) *CreatePrivateClusterParams { + return &CreatePrivateClusterParams{ + Context: ctx, + } +} + +// NewCreatePrivateClusterParamsWithHTTPClient creates a new CreatePrivateClusterParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreatePrivateClusterParamsWithHTTPClient(client *http.Client) *CreatePrivateClusterParams { + return &CreatePrivateClusterParams{ + HTTPClient: client, + } +} + +/* +CreatePrivateClusterParams contains all the parameters to send to the API endpoint + + for the create private cluster operation. + + Typically these are written to a http.Request. +*/ +type CreatePrivateClusterParams struct { + + // Input. + Input *models.CreatePrivateClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create private cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePrivateClusterParams) WithDefaults() *CreatePrivateClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create private cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePrivateClusterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create private cluster params +func (o *CreatePrivateClusterParams) WithTimeout(timeout time.Duration) *CreatePrivateClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create private cluster params +func (o *CreatePrivateClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create private cluster params +func (o *CreatePrivateClusterParams) WithContext(ctx context.Context) *CreatePrivateClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create private cluster params +func (o *CreatePrivateClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create private cluster params +func (o *CreatePrivateClusterParams) WithHTTPClient(client *http.Client) *CreatePrivateClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create private cluster params +func (o *CreatePrivateClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the create private cluster params +func (o *CreatePrivateClusterParams) WithInput(input *models.CreatePrivateClusterRequest) *CreatePrivateClusterParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the create private cluster params +func (o *CreatePrivateClusterParams) SetInput(input *models.CreatePrivateClusterRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *CreatePrivateClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/dw/client/operations/create_private_cluster_responses.go b/cdp-sdk-go/gen/dw/client/operations/create_private_cluster_responses.go new file mode 100644 index 00000000..74771bf4 --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/create_private_cluster_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// CreatePrivateClusterReader is a Reader for the CreatePrivateCluster structure. +type CreatePrivateClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreatePrivateClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreatePrivateClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreatePrivateClusterDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCreatePrivateClusterOK creates a CreatePrivateClusterOK with default headers values +func NewCreatePrivateClusterOK() *CreatePrivateClusterOK { + return &CreatePrivateClusterOK{} +} + +/* +CreatePrivateClusterOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type CreatePrivateClusterOK struct { + Payload *models.CreatePrivateClusterResponse +} + +// IsSuccess returns true when this create private cluster o k response has a 2xx status code +func (o *CreatePrivateClusterOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create private cluster o k response has a 3xx status code +func (o *CreatePrivateClusterOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create private cluster o k response has a 4xx status code +func (o *CreatePrivateClusterOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create private cluster o k response has a 5xx status code +func (o *CreatePrivateClusterOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create private cluster o k response a status code equal to that given +func (o *CreatePrivateClusterOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create private cluster o k response +func (o *CreatePrivateClusterOK) Code() int { + return 200 +} + +func (o *CreatePrivateClusterOK) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/createPrivateCluster][%d] createPrivateClusterOK %+v", 200, o.Payload) +} + +func (o *CreatePrivateClusterOK) String() string { + return fmt.Sprintf("[POST /api/v1/dw/createPrivateCluster][%d] createPrivateClusterOK %+v", 200, o.Payload) +} + +func (o *CreatePrivateClusterOK) GetPayload() *models.CreatePrivateClusterResponse { + return o.Payload +} + +func (o *CreatePrivateClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CreatePrivateClusterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreatePrivateClusterDefault creates a CreatePrivateClusterDefault with default headers values +func NewCreatePrivateClusterDefault(code int) *CreatePrivateClusterDefault { + return &CreatePrivateClusterDefault{ + _statusCode: code, + } +} + +/* +CreatePrivateClusterDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type CreatePrivateClusterDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this create private cluster default response has a 2xx status code +func (o *CreatePrivateClusterDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this create private cluster default response has a 3xx status code +func (o *CreatePrivateClusterDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this create private cluster default response has a 4xx status code +func (o *CreatePrivateClusterDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this create private cluster default response has a 5xx status code +func (o *CreatePrivateClusterDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this create private cluster default response a status code equal to that given +func (o *CreatePrivateClusterDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the create private cluster default response +func (o *CreatePrivateClusterDefault) Code() int { + return o._statusCode +} + +func (o *CreatePrivateClusterDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/createPrivateCluster][%d] createPrivateCluster default %+v", o._statusCode, o.Payload) +} + +func (o *CreatePrivateClusterDefault) String() string { + return fmt.Sprintf("[POST /api/v1/dw/createPrivateCluster][%d] createPrivateCluster default %+v", o._statusCode, o.Payload) +} + +func (o *CreatePrivateClusterDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *CreatePrivateClusterDefault) 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/cdp-sdk-go/gen/dw/client/operations/list_events_parameters.go b/cdp-sdk-go/gen/dw/client/operations/list_events_parameters.go new file mode 100644 index 00000000..f2a09328 --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/list_events_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// NewListEventsParams creates a new ListEventsParams 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 NewListEventsParams() *ListEventsParams { + return &ListEventsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListEventsParamsWithTimeout creates a new ListEventsParams object +// with the ability to set a timeout on a request. +func NewListEventsParamsWithTimeout(timeout time.Duration) *ListEventsParams { + return &ListEventsParams{ + timeout: timeout, + } +} + +// NewListEventsParamsWithContext creates a new ListEventsParams object +// with the ability to set a context for a request. +func NewListEventsParamsWithContext(ctx context.Context) *ListEventsParams { + return &ListEventsParams{ + Context: ctx, + } +} + +// NewListEventsParamsWithHTTPClient creates a new ListEventsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListEventsParamsWithHTTPClient(client *http.Client) *ListEventsParams { + return &ListEventsParams{ + HTTPClient: client, + } +} + +/* +ListEventsParams contains all the parameters to send to the API endpoint + + for the list events operation. + + Typically these are written to a http.Request. +*/ +type ListEventsParams struct { + + // Input. + Input *models.ListEventsRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list events params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListEventsParams) WithDefaults() *ListEventsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list events params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListEventsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list events params +func (o *ListEventsParams) WithTimeout(timeout time.Duration) *ListEventsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list events params +func (o *ListEventsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list events params +func (o *ListEventsParams) WithContext(ctx context.Context) *ListEventsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list events params +func (o *ListEventsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list events params +func (o *ListEventsParams) WithHTTPClient(client *http.Client) *ListEventsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list events params +func (o *ListEventsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the list events params +func (o *ListEventsParams) WithInput(input *models.ListEventsRequest) *ListEventsParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the list events params +func (o *ListEventsParams) SetInput(input *models.ListEventsRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *ListEventsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/dw/client/operations/list_events_responses.go b/cdp-sdk-go/gen/dw/client/operations/list_events_responses.go new file mode 100644 index 00000000..37e613d1 --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/list_events_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// ListEventsReader is a Reader for the ListEvents structure. +type ListEventsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListEventsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListEventsDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewListEventsOK creates a ListEventsOK with default headers values +func NewListEventsOK() *ListEventsOK { + return &ListEventsOK{} +} + +/* +ListEventsOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type ListEventsOK struct { + Payload *models.ListEventsResponse +} + +// IsSuccess returns true when this list events o k response has a 2xx status code +func (o *ListEventsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list events o k response has a 3xx status code +func (o *ListEventsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list events o k response has a 4xx status code +func (o *ListEventsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list events o k response has a 5xx status code +func (o *ListEventsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list events o k response a status code equal to that given +func (o *ListEventsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list events o k response +func (o *ListEventsOK) Code() int { + return 200 +} + +func (o *ListEventsOK) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/listEvents][%d] listEventsOK %+v", 200, o.Payload) +} + +func (o *ListEventsOK) String() string { + return fmt.Sprintf("[POST /api/v1/dw/listEvents][%d] listEventsOK %+v", 200, o.Payload) +} + +func (o *ListEventsOK) GetPayload() *models.ListEventsResponse { + return o.Payload +} + +func (o *ListEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ListEventsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListEventsDefault creates a ListEventsDefault with default headers values +func NewListEventsDefault(code int) *ListEventsDefault { + return &ListEventsDefault{ + _statusCode: code, + } +} + +/* +ListEventsDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type ListEventsDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this list events default response has a 2xx status code +func (o *ListEventsDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this list events default response has a 3xx status code +func (o *ListEventsDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this list events default response has a 4xx status code +func (o *ListEventsDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this list events default response has a 5xx status code +func (o *ListEventsDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this list events default response a status code equal to that given +func (o *ListEventsDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the list events default response +func (o *ListEventsDefault) Code() int { + return o._statusCode +} + +func (o *ListEventsDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/listEvents][%d] listEvents default %+v", o._statusCode, o.Payload) +} + +func (o *ListEventsDefault) String() string { + return fmt.Sprintf("[POST /api/v1/dw/listEvents][%d] listEvents default %+v", o._statusCode, o.Payload) +} + +func (o *ListEventsDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ListEventsDefault) 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/cdp-sdk-go/gen/dw/client/operations/operations_client.go b/cdp-sdk-go/gen/dw/client/operations/operations_client.go index 87060b2c..65294f59 100644 --- a/cdp-sdk-go/gen/dw/client/operations/operations_client.go +++ b/cdp-sdk-go/gen/dw/client/operations/operations_client.go @@ -32,6 +32,10 @@ type ClientService interface { BackupCluster(params *BackupClusterParams, opts ...ClientOption) (*BackupClusterOK, error) + CreateAwsCluster(params *CreateAwsClusterParams, opts ...ClientOption) (*CreateAwsClusterOK, error) + + CreateAzureCluster(params *CreateAzureClusterParams, opts ...ClientOption) (*CreateAzureClusterOK, error) + CreateBackup(params *CreateBackupParams, opts ...ClientOption) (*CreateBackupOK, error) CreateCluster(params *CreateClusterParams, opts ...ClientOption) (*CreateClusterOK, error) @@ -44,6 +48,8 @@ type ClientService interface { CreateDbcDiagnosticDataJob(params *CreateDbcDiagnosticDataJobParams, opts ...ClientOption) (*CreateDbcDiagnosticDataJobOK, error) + CreatePrivateCluster(params *CreatePrivateClusterParams, opts ...ClientOption) (*CreatePrivateClusterOK, error) + CreateVw(params *CreateVwParams, opts ...ClientOption) (*CreateVwOK, error) CreateVwDiagnosticDataJob(params *CreateVwDiagnosticDataJobParams, opts ...ClientOption) (*CreateVwDiagnosticDataJobOK, error) @@ -126,6 +132,8 @@ type ClientService interface { ListDbcs(params *ListDbcsParams, opts ...ClientOption) (*ListDbcsOK, error) + ListEvents(params *ListEventsParams, opts ...ClientOption) (*ListEventsOK, error) + ListLatestVersions(params *ListLatestVersionsParams, opts ...ClientOption) (*ListLatestVersionsOK, error) ListRestores(params *ListRestoresParams, opts ...ClientOption) (*ListRestoresOK, error) @@ -154,12 +162,20 @@ type ClientService interface { RestoreCluster(params *RestoreClusterParams, opts ...ClientOption) (*RestoreClusterOK, error) + ResumeCluster(params *ResumeClusterParams, opts ...ClientOption) (*ResumeClusterOK, error) + StartVw(params *StartVwParams, opts ...ClientOption) (*StartVwOK, error) + SuspendCluster(params *SuspendClusterParams, opts ...ClientOption) (*SuspendClusterOK, error) + SuspendDbc(params *SuspendDbcParams, opts ...ClientOption) (*SuspendDbcOK, error) SuspendVw(params *SuspendVwParams, opts ...ClientOption) (*SuspendVwOK, error) + UpdateAwsCluster(params *UpdateAwsClusterParams, opts ...ClientOption) (*UpdateAwsClusterOK, error) + + UpdateAzureCluster(params *UpdateAzureClusterParams, opts ...ClientOption) (*UpdateAzureClusterOK, error) + UpdateCluster(params *UpdateClusterParams, opts ...ClientOption) (*UpdateClusterOK, error) UpdateDataVisualization(params *UpdateDataVisualizationParams, opts ...ClientOption) (*UpdateDataVisualizationOK, error) @@ -168,6 +184,8 @@ type ClientService interface { UpdateDbcConfig(params *UpdateDbcConfigParams, opts ...ClientOption) (*UpdateDbcConfigOK, error) + UpdatePrivateCluster(params *UpdatePrivateClusterParams, opts ...ClientOption) (*UpdatePrivateClusterOK, error) + UpdateServerSetting(params *UpdateServerSettingParams, opts ...ClientOption) (*UpdateServerSettingOK, error) UpdateSSHKey(params *UpdateSSHKeyParams, opts ...ClientOption) (*UpdateSSHKeyOK, error) @@ -265,6 +283,84 @@ func (a *Client) BackupCluster(params *BackupClusterParams, opts ...ClientOption return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +CreateAwsCluster creates an a w s cluster in the cloudera data warehouse + +Create an AWS cluster in the Cloudera Data Warehouse environment with the provided settings. +*/ +func (a *Client) CreateAwsCluster(params *CreateAwsClusterParams, opts ...ClientOption) (*CreateAwsClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateAwsClusterParams() + } + op := &runtime.ClientOperation{ + ID: "createAwsCluster", + Method: "POST", + PathPattern: "/api/v1/dw/createAwsCluster", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateAwsClusterReader{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.(*CreateAwsClusterOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateAwsClusterDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CreateAzureCluster creates an azure cluster in the cloudera data warehouse + +Create an Azure cluster in the Cloudera Data Warehouse environment with the provided settings. +*/ +func (a *Client) CreateAzureCluster(params *CreateAzureClusterParams, opts ...ClientOption) (*CreateAzureClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateAzureClusterParams() + } + op := &runtime.ClientOperation{ + ID: "createAzureCluster", + Method: "POST", + PathPattern: "/api/v1/dw/createAzureCluster", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateAzureClusterReader{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.(*CreateAzureClusterOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateAzureClusterDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* CreateBackup creates a backup for the data warehouse @@ -424,7 +520,7 @@ func (a *Client) CreateDataVisualization(params *CreateDataVisualizationParams, /* CreateDbc creates a database catalog -Create a Database Catalog. +DEPRECATED: Create a Database Catalog. The Database Catalog creation is deprecated and will be removed in subsequent releases. The Default Database Catalog is getting created during the cluster activation (create-cluster). */ func (a *Client) CreateDbc(params *CreateDbcParams, opts ...ClientOption) (*CreateDbcOK, error) { // TODO: Validate the params before sending @@ -499,6 +595,45 @@ func (a *Client) CreateDbcDiagnosticDataJob(params *CreateDbcDiagnosticDataJobPa return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +CreatePrivateCluster creates a a private cloud cluster in the cloudera data warehouse + +Create a Private Cloud cluster in the Cloudera Data Warehouse environment with the provided settings. +*/ +func (a *Client) CreatePrivateCluster(params *CreatePrivateClusterParams, opts ...ClientOption) (*CreatePrivateClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreatePrivateClusterParams() + } + op := &runtime.ClientOperation{ + ID: "createPrivateCluster", + Method: "POST", + PathPattern: "/api/v1/dw/createPrivateCluster", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreatePrivateClusterReader{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.(*CreatePrivateClusterOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreatePrivateClusterDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* CreateVw creates a virtual warehouse @@ -2098,6 +2233,45 @@ func (a *Client) ListDbcs(params *ListDbcsParams, opts ...ClientOption) (*ListDb return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ListEvents gets the list of events + +Get the list of events for the given Operation or a specific Service (Cluster, Database Catalog, Virtual Warehouse, or Data Visualization App). Events can belong to a particular Operation which might span across multiple Services. This happens if the given operation affects one or more Services e.g.: restore-cluster. It is also possible to return the events only for a given Service, in this case it is enough to pass the Id of a Service (e.g.: env-sq7hfv, warehouse-1696571829-pps2, compute-1696571962-8dd8, impala-1696572085-cn44). +*/ +func (a *Client) ListEvents(params *ListEventsParams, opts ...ClientOption) (*ListEventsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListEventsParams() + } + op := &runtime.ClientOperation{ + ID: "listEvents", + Method: "POST", + PathPattern: "/api/v1/dw/listEvents", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListEventsReader{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.(*ListEventsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListEventsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* ListLatestVersions lists the latest version of the product if available for all catalogs in the environment @@ -2644,6 +2818,45 @@ func (a *Client) RestoreCluster(params *RestoreClusterParams, opts ...ClientOpti return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ResumeCluster resumes cloudera data warehouse cluster + +Resume Cloudera Data Warehouse cluster. Supported only on Azure. Resume cluster will start a stopped CDW cluster. Resuming a cluster in "Running" or "Error" state is not supported. Resume will start the AKS instance which belongs to this CDW. +*/ +func (a *Client) ResumeCluster(params *ResumeClusterParams, opts ...ClientOption) (*ResumeClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewResumeClusterParams() + } + op := &runtime.ClientOperation{ + ID: "resumeCluster", + Method: "POST", + PathPattern: "/api/v1/dw/resumeCluster", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ResumeClusterReader{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.(*ResumeClusterOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ResumeClusterDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* StartVw starts a suspended virtual warehouse @@ -2683,6 +2896,45 @@ func (a *Client) StartVw(params *StartVwParams, opts ...ClientOption) (*StartVwO return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +SuspendCluster suspends cloudera data warehouse cluster + +Suspend Cloudera Data Warehouse cluster. Supported only on Azure. Suspend cluster requires a "Running" Azure CDW, trying to suspend a cluster already in "Stopped" or "Error" state is not supported. Every Virtual Warehouse and Database Catalog which belongs to that CDW must be stopped first. This operation will stop the AKS cluster for this CDW instance, however leaves other cloud resources in "Running" state, including the Postgres database. +*/ +func (a *Client) SuspendCluster(params *SuspendClusterParams, opts ...ClientOption) (*SuspendClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSuspendClusterParams() + } + op := &runtime.ClientOperation{ + ID: "suspendCluster", + Method: "POST", + PathPattern: "/api/v1/dw/suspendCluster", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &SuspendClusterReader{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.(*SuspendClusterOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SuspendClusterDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* SuspendDbc suspends a running database catalog @@ -2761,6 +3013,84 @@ func (a *Client) SuspendVw(params *SuspendVwParams, opts ...ClientOption) (*Susp return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +UpdateAwsCluster updates an a w s cluster in the cloudera data warehouse + +Update an AWS cluster in the Cloudera Data Warehouse with the provided settings. +*/ +func (a *Client) UpdateAwsCluster(params *UpdateAwsClusterParams, opts ...ClientOption) (*UpdateAwsClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateAwsClusterParams() + } + op := &runtime.ClientOperation{ + ID: "updateAwsCluster", + Method: "POST", + PathPattern: "/api/v1/dw/updateAwsCluster", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateAwsClusterReader{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.(*UpdateAwsClusterOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateAwsClusterDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +UpdateAzureCluster updates an azure cluster in the cloudera data warehouse + +Update an Azure cluster in the Cloudera Data Warehouse with the provided settings. +*/ +func (a *Client) UpdateAzureCluster(params *UpdateAzureClusterParams, opts ...ClientOption) (*UpdateAzureClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateAzureClusterParams() + } + op := &runtime.ClientOperation{ + ID: "updateAzureCluster", + Method: "POST", + PathPattern: "/api/v1/dw/updateAzureCluster", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateAzureClusterReader{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.(*UpdateAzureClusterOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateAzureClusterDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* UpdateCluster updates the cloudera data warehouse cluster @@ -2917,6 +3247,45 @@ func (a *Client) UpdateDbcConfig(params *UpdateDbcConfigParams, opts ...ClientOp return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +UpdatePrivateCluster updates a private cloud pv c cluster in the cloudera data warehouse + +Update a Private Cloud cluster (PvC) in the Cloudera Data Warehouse with the provided settings. +*/ +func (a *Client) UpdatePrivateCluster(params *UpdatePrivateClusterParams, opts ...ClientOption) (*UpdatePrivateClusterOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdatePrivateClusterParams() + } + op := &runtime.ClientOperation{ + ID: "updatePrivateCluster", + Method: "POST", + PathPattern: "/api/v1/dw/updatePrivateCluster", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdatePrivateClusterReader{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.(*UpdatePrivateClusterOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdatePrivateClusterDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* UpdateServerSetting updates the d w x server settings diff --git a/cdp-sdk-go/gen/dw/client/operations/resume_cluster_parameters.go b/cdp-sdk-go/gen/dw/client/operations/resume_cluster_parameters.go new file mode 100644 index 00000000..2b62220b --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/resume_cluster_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// NewResumeClusterParams creates a new ResumeClusterParams 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 NewResumeClusterParams() *ResumeClusterParams { + return &ResumeClusterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewResumeClusterParamsWithTimeout creates a new ResumeClusterParams object +// with the ability to set a timeout on a request. +func NewResumeClusterParamsWithTimeout(timeout time.Duration) *ResumeClusterParams { + return &ResumeClusterParams{ + timeout: timeout, + } +} + +// NewResumeClusterParamsWithContext creates a new ResumeClusterParams object +// with the ability to set a context for a request. +func NewResumeClusterParamsWithContext(ctx context.Context) *ResumeClusterParams { + return &ResumeClusterParams{ + Context: ctx, + } +} + +// NewResumeClusterParamsWithHTTPClient creates a new ResumeClusterParams object +// with the ability to set a custom HTTPClient for a request. +func NewResumeClusterParamsWithHTTPClient(client *http.Client) *ResumeClusterParams { + return &ResumeClusterParams{ + HTTPClient: client, + } +} + +/* +ResumeClusterParams contains all the parameters to send to the API endpoint + + for the resume cluster operation. + + Typically these are written to a http.Request. +*/ +type ResumeClusterParams struct { + + // Input. + Input *models.ResumeClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the resume cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResumeClusterParams) WithDefaults() *ResumeClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the resume cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ResumeClusterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the resume cluster params +func (o *ResumeClusterParams) WithTimeout(timeout time.Duration) *ResumeClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the resume cluster params +func (o *ResumeClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the resume cluster params +func (o *ResumeClusterParams) WithContext(ctx context.Context) *ResumeClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the resume cluster params +func (o *ResumeClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the resume cluster params +func (o *ResumeClusterParams) WithHTTPClient(client *http.Client) *ResumeClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the resume cluster params +func (o *ResumeClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the resume cluster params +func (o *ResumeClusterParams) WithInput(input *models.ResumeClusterRequest) *ResumeClusterParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the resume cluster params +func (o *ResumeClusterParams) SetInput(input *models.ResumeClusterRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *ResumeClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/dw/client/operations/resume_cluster_responses.go b/cdp-sdk-go/gen/dw/client/operations/resume_cluster_responses.go new file mode 100644 index 00000000..8f2f4dd2 --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/resume_cluster_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// ResumeClusterReader is a Reader for the ResumeCluster structure. +type ResumeClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ResumeClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewResumeClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewResumeClusterDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewResumeClusterOK creates a ResumeClusterOK with default headers values +func NewResumeClusterOK() *ResumeClusterOK { + return &ResumeClusterOK{} +} + +/* +ResumeClusterOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type ResumeClusterOK struct { + Payload *models.ResumeClusterResponse +} + +// IsSuccess returns true when this resume cluster o k response has a 2xx status code +func (o *ResumeClusterOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this resume cluster o k response has a 3xx status code +func (o *ResumeClusterOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this resume cluster o k response has a 4xx status code +func (o *ResumeClusterOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this resume cluster o k response has a 5xx status code +func (o *ResumeClusterOK) IsServerError() bool { + return false +} + +// IsCode returns true when this resume cluster o k response a status code equal to that given +func (o *ResumeClusterOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the resume cluster o k response +func (o *ResumeClusterOK) Code() int { + return 200 +} + +func (o *ResumeClusterOK) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/resumeCluster][%d] resumeClusterOK %+v", 200, o.Payload) +} + +func (o *ResumeClusterOK) String() string { + return fmt.Sprintf("[POST /api/v1/dw/resumeCluster][%d] resumeClusterOK %+v", 200, o.Payload) +} + +func (o *ResumeClusterOK) GetPayload() *models.ResumeClusterResponse { + return o.Payload +} + +func (o *ResumeClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ResumeClusterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewResumeClusterDefault creates a ResumeClusterDefault with default headers values +func NewResumeClusterDefault(code int) *ResumeClusterDefault { + return &ResumeClusterDefault{ + _statusCode: code, + } +} + +/* +ResumeClusterDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type ResumeClusterDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this resume cluster default response has a 2xx status code +func (o *ResumeClusterDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this resume cluster default response has a 3xx status code +func (o *ResumeClusterDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this resume cluster default response has a 4xx status code +func (o *ResumeClusterDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this resume cluster default response has a 5xx status code +func (o *ResumeClusterDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this resume cluster default response a status code equal to that given +func (o *ResumeClusterDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the resume cluster default response +func (o *ResumeClusterDefault) Code() int { + return o._statusCode +} + +func (o *ResumeClusterDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/resumeCluster][%d] resumeCluster default %+v", o._statusCode, o.Payload) +} + +func (o *ResumeClusterDefault) String() string { + return fmt.Sprintf("[POST /api/v1/dw/resumeCluster][%d] resumeCluster default %+v", o._statusCode, o.Payload) +} + +func (o *ResumeClusterDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ResumeClusterDefault) 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/cdp-sdk-go/gen/dw/client/operations/suspend_cluster_parameters.go b/cdp-sdk-go/gen/dw/client/operations/suspend_cluster_parameters.go new file mode 100644 index 00000000..a61c5e8f --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/suspend_cluster_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// NewSuspendClusterParams creates a new SuspendClusterParams 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 NewSuspendClusterParams() *SuspendClusterParams { + return &SuspendClusterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSuspendClusterParamsWithTimeout creates a new SuspendClusterParams object +// with the ability to set a timeout on a request. +func NewSuspendClusterParamsWithTimeout(timeout time.Duration) *SuspendClusterParams { + return &SuspendClusterParams{ + timeout: timeout, + } +} + +// NewSuspendClusterParamsWithContext creates a new SuspendClusterParams object +// with the ability to set a context for a request. +func NewSuspendClusterParamsWithContext(ctx context.Context) *SuspendClusterParams { + return &SuspendClusterParams{ + Context: ctx, + } +} + +// NewSuspendClusterParamsWithHTTPClient creates a new SuspendClusterParams object +// with the ability to set a custom HTTPClient for a request. +func NewSuspendClusterParamsWithHTTPClient(client *http.Client) *SuspendClusterParams { + return &SuspendClusterParams{ + HTTPClient: client, + } +} + +/* +SuspendClusterParams contains all the parameters to send to the API endpoint + + for the suspend cluster operation. + + Typically these are written to a http.Request. +*/ +type SuspendClusterParams struct { + + // Input. + Input *models.SuspendClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the suspend cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SuspendClusterParams) WithDefaults() *SuspendClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the suspend cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SuspendClusterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the suspend cluster params +func (o *SuspendClusterParams) WithTimeout(timeout time.Duration) *SuspendClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the suspend cluster params +func (o *SuspendClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the suspend cluster params +func (o *SuspendClusterParams) WithContext(ctx context.Context) *SuspendClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the suspend cluster params +func (o *SuspendClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the suspend cluster params +func (o *SuspendClusterParams) WithHTTPClient(client *http.Client) *SuspendClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the suspend cluster params +func (o *SuspendClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the suspend cluster params +func (o *SuspendClusterParams) WithInput(input *models.SuspendClusterRequest) *SuspendClusterParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the suspend cluster params +func (o *SuspendClusterParams) SetInput(input *models.SuspendClusterRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *SuspendClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/dw/client/operations/suspend_cluster_responses.go b/cdp-sdk-go/gen/dw/client/operations/suspend_cluster_responses.go new file mode 100644 index 00000000..c88fdc2d --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/suspend_cluster_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// SuspendClusterReader is a Reader for the SuspendCluster structure. +type SuspendClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SuspendClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSuspendClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSuspendClusterDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSuspendClusterOK creates a SuspendClusterOK with default headers values +func NewSuspendClusterOK() *SuspendClusterOK { + return &SuspendClusterOK{} +} + +/* +SuspendClusterOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type SuspendClusterOK struct { + Payload *models.SuspendClusterResponse +} + +// IsSuccess returns true when this suspend cluster o k response has a 2xx status code +func (o *SuspendClusterOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this suspend cluster o k response has a 3xx status code +func (o *SuspendClusterOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this suspend cluster o k response has a 4xx status code +func (o *SuspendClusterOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this suspend cluster o k response has a 5xx status code +func (o *SuspendClusterOK) IsServerError() bool { + return false +} + +// IsCode returns true when this suspend cluster o k response a status code equal to that given +func (o *SuspendClusterOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the suspend cluster o k response +func (o *SuspendClusterOK) Code() int { + return 200 +} + +func (o *SuspendClusterOK) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/suspendCluster][%d] suspendClusterOK %+v", 200, o.Payload) +} + +func (o *SuspendClusterOK) String() string { + return fmt.Sprintf("[POST /api/v1/dw/suspendCluster][%d] suspendClusterOK %+v", 200, o.Payload) +} + +func (o *SuspendClusterOK) GetPayload() *models.SuspendClusterResponse { + return o.Payload +} + +func (o *SuspendClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SuspendClusterResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSuspendClusterDefault creates a SuspendClusterDefault with default headers values +func NewSuspendClusterDefault(code int) *SuspendClusterDefault { + return &SuspendClusterDefault{ + _statusCode: code, + } +} + +/* +SuspendClusterDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type SuspendClusterDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this suspend cluster default response has a 2xx status code +func (o *SuspendClusterDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this suspend cluster default response has a 3xx status code +func (o *SuspendClusterDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this suspend cluster default response has a 4xx status code +func (o *SuspendClusterDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this suspend cluster default response has a 5xx status code +func (o *SuspendClusterDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this suspend cluster default response a status code equal to that given +func (o *SuspendClusterDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the suspend cluster default response +func (o *SuspendClusterDefault) Code() int { + return o._statusCode +} + +func (o *SuspendClusterDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/suspendCluster][%d] suspendCluster default %+v", o._statusCode, o.Payload) +} + +func (o *SuspendClusterDefault) String() string { + return fmt.Sprintf("[POST /api/v1/dw/suspendCluster][%d] suspendCluster default %+v", o._statusCode, o.Payload) +} + +func (o *SuspendClusterDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *SuspendClusterDefault) 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/cdp-sdk-go/gen/dw/client/operations/update_aws_cluster_parameters.go b/cdp-sdk-go/gen/dw/client/operations/update_aws_cluster_parameters.go new file mode 100644 index 00000000..1a051f2a --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/update_aws_cluster_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// NewUpdateAwsClusterParams creates a new UpdateAwsClusterParams 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 NewUpdateAwsClusterParams() *UpdateAwsClusterParams { + return &UpdateAwsClusterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateAwsClusterParamsWithTimeout creates a new UpdateAwsClusterParams object +// with the ability to set a timeout on a request. +func NewUpdateAwsClusterParamsWithTimeout(timeout time.Duration) *UpdateAwsClusterParams { + return &UpdateAwsClusterParams{ + timeout: timeout, + } +} + +// NewUpdateAwsClusterParamsWithContext creates a new UpdateAwsClusterParams object +// with the ability to set a context for a request. +func NewUpdateAwsClusterParamsWithContext(ctx context.Context) *UpdateAwsClusterParams { + return &UpdateAwsClusterParams{ + Context: ctx, + } +} + +// NewUpdateAwsClusterParamsWithHTTPClient creates a new UpdateAwsClusterParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateAwsClusterParamsWithHTTPClient(client *http.Client) *UpdateAwsClusterParams { + return &UpdateAwsClusterParams{ + HTTPClient: client, + } +} + +/* +UpdateAwsClusterParams contains all the parameters to send to the API endpoint + + for the update aws cluster operation. + + Typically these are written to a http.Request. +*/ +type UpdateAwsClusterParams struct { + + // Input. + Input *models.UpdateAwsClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update aws cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAwsClusterParams) WithDefaults() *UpdateAwsClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update aws cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAwsClusterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update aws cluster params +func (o *UpdateAwsClusterParams) WithTimeout(timeout time.Duration) *UpdateAwsClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update aws cluster params +func (o *UpdateAwsClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update aws cluster params +func (o *UpdateAwsClusterParams) WithContext(ctx context.Context) *UpdateAwsClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update aws cluster params +func (o *UpdateAwsClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update aws cluster params +func (o *UpdateAwsClusterParams) WithHTTPClient(client *http.Client) *UpdateAwsClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update aws cluster params +func (o *UpdateAwsClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the update aws cluster params +func (o *UpdateAwsClusterParams) WithInput(input *models.UpdateAwsClusterRequest) *UpdateAwsClusterParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the update aws cluster params +func (o *UpdateAwsClusterParams) SetInput(input *models.UpdateAwsClusterRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateAwsClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/dw/client/operations/update_aws_cluster_responses.go b/cdp-sdk-go/gen/dw/client/operations/update_aws_cluster_responses.go new file mode 100644 index 00000000..3cbcce1a --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/update_aws_cluster_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// UpdateAwsClusterReader is a Reader for the UpdateAwsCluster structure. +type UpdateAwsClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateAwsClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateAwsClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateAwsClusterDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewUpdateAwsClusterOK creates a UpdateAwsClusterOK with default headers values +func NewUpdateAwsClusterOK() *UpdateAwsClusterOK { + return &UpdateAwsClusterOK{} +} + +/* +UpdateAwsClusterOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type UpdateAwsClusterOK struct { + Payload models.UpdateAwsClusterResponse +} + +// IsSuccess returns true when this update aws cluster o k response has a 2xx status code +func (o *UpdateAwsClusterOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update aws cluster o k response has a 3xx status code +func (o *UpdateAwsClusterOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update aws cluster o k response has a 4xx status code +func (o *UpdateAwsClusterOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update aws cluster o k response has a 5xx status code +func (o *UpdateAwsClusterOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update aws cluster o k response a status code equal to that given +func (o *UpdateAwsClusterOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update aws cluster o k response +func (o *UpdateAwsClusterOK) Code() int { + return 200 +} + +func (o *UpdateAwsClusterOK) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/updateAwsCluster][%d] updateAwsClusterOK %+v", 200, o.Payload) +} + +func (o *UpdateAwsClusterOK) String() string { + return fmt.Sprintf("[POST /api/v1/dw/updateAwsCluster][%d] updateAwsClusterOK %+v", 200, o.Payload) +} + +func (o *UpdateAwsClusterOK) GetPayload() models.UpdateAwsClusterResponse { + return o.Payload +} + +func (o *UpdateAwsClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateAwsClusterDefault creates a UpdateAwsClusterDefault with default headers values +func NewUpdateAwsClusterDefault(code int) *UpdateAwsClusterDefault { + return &UpdateAwsClusterDefault{ + _statusCode: code, + } +} + +/* +UpdateAwsClusterDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type UpdateAwsClusterDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this update aws cluster default response has a 2xx status code +func (o *UpdateAwsClusterDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this update aws cluster default response has a 3xx status code +func (o *UpdateAwsClusterDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this update aws cluster default response has a 4xx status code +func (o *UpdateAwsClusterDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this update aws cluster default response has a 5xx status code +func (o *UpdateAwsClusterDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this update aws cluster default response a status code equal to that given +func (o *UpdateAwsClusterDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the update aws cluster default response +func (o *UpdateAwsClusterDefault) Code() int { + return o._statusCode +} + +func (o *UpdateAwsClusterDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/updateAwsCluster][%d] updateAwsCluster default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateAwsClusterDefault) String() string { + return fmt.Sprintf("[POST /api/v1/dw/updateAwsCluster][%d] updateAwsCluster default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateAwsClusterDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateAwsClusterDefault) 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/cdp-sdk-go/gen/dw/client/operations/update_azure_cluster_parameters.go b/cdp-sdk-go/gen/dw/client/operations/update_azure_cluster_parameters.go new file mode 100644 index 00000000..e28924f0 --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/update_azure_cluster_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// NewUpdateAzureClusterParams creates a new UpdateAzureClusterParams 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 NewUpdateAzureClusterParams() *UpdateAzureClusterParams { + return &UpdateAzureClusterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateAzureClusterParamsWithTimeout creates a new UpdateAzureClusterParams object +// with the ability to set a timeout on a request. +func NewUpdateAzureClusterParamsWithTimeout(timeout time.Duration) *UpdateAzureClusterParams { + return &UpdateAzureClusterParams{ + timeout: timeout, + } +} + +// NewUpdateAzureClusterParamsWithContext creates a new UpdateAzureClusterParams object +// with the ability to set a context for a request. +func NewUpdateAzureClusterParamsWithContext(ctx context.Context) *UpdateAzureClusterParams { + return &UpdateAzureClusterParams{ + Context: ctx, + } +} + +// NewUpdateAzureClusterParamsWithHTTPClient creates a new UpdateAzureClusterParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateAzureClusterParamsWithHTTPClient(client *http.Client) *UpdateAzureClusterParams { + return &UpdateAzureClusterParams{ + HTTPClient: client, + } +} + +/* +UpdateAzureClusterParams contains all the parameters to send to the API endpoint + + for the update azure cluster operation. + + Typically these are written to a http.Request. +*/ +type UpdateAzureClusterParams struct { + + // Input. + Input *models.UpdateAzureClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update azure cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAzureClusterParams) WithDefaults() *UpdateAzureClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update azure cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAzureClusterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update azure cluster params +func (o *UpdateAzureClusterParams) WithTimeout(timeout time.Duration) *UpdateAzureClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update azure cluster params +func (o *UpdateAzureClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update azure cluster params +func (o *UpdateAzureClusterParams) WithContext(ctx context.Context) *UpdateAzureClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update azure cluster params +func (o *UpdateAzureClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update azure cluster params +func (o *UpdateAzureClusterParams) WithHTTPClient(client *http.Client) *UpdateAzureClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update azure cluster params +func (o *UpdateAzureClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the update azure cluster params +func (o *UpdateAzureClusterParams) WithInput(input *models.UpdateAzureClusterRequest) *UpdateAzureClusterParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the update azure cluster params +func (o *UpdateAzureClusterParams) SetInput(input *models.UpdateAzureClusterRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateAzureClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/dw/client/operations/update_azure_cluster_responses.go b/cdp-sdk-go/gen/dw/client/operations/update_azure_cluster_responses.go new file mode 100644 index 00000000..75005617 --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/update_azure_cluster_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// UpdateAzureClusterReader is a Reader for the UpdateAzureCluster structure. +type UpdateAzureClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateAzureClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateAzureClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateAzureClusterDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewUpdateAzureClusterOK creates a UpdateAzureClusterOK with default headers values +func NewUpdateAzureClusterOK() *UpdateAzureClusterOK { + return &UpdateAzureClusterOK{} +} + +/* +UpdateAzureClusterOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type UpdateAzureClusterOK struct { + Payload models.UpdateAzureClusterResponse +} + +// IsSuccess returns true when this update azure cluster o k response has a 2xx status code +func (o *UpdateAzureClusterOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update azure cluster o k response has a 3xx status code +func (o *UpdateAzureClusterOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update azure cluster o k response has a 4xx status code +func (o *UpdateAzureClusterOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update azure cluster o k response has a 5xx status code +func (o *UpdateAzureClusterOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update azure cluster o k response a status code equal to that given +func (o *UpdateAzureClusterOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update azure cluster o k response +func (o *UpdateAzureClusterOK) Code() int { + return 200 +} + +func (o *UpdateAzureClusterOK) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/updateAzureCluster][%d] updateAzureClusterOK %+v", 200, o.Payload) +} + +func (o *UpdateAzureClusterOK) String() string { + return fmt.Sprintf("[POST /api/v1/dw/updateAzureCluster][%d] updateAzureClusterOK %+v", 200, o.Payload) +} + +func (o *UpdateAzureClusterOK) GetPayload() models.UpdateAzureClusterResponse { + return o.Payload +} + +func (o *UpdateAzureClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateAzureClusterDefault creates a UpdateAzureClusterDefault with default headers values +func NewUpdateAzureClusterDefault(code int) *UpdateAzureClusterDefault { + return &UpdateAzureClusterDefault{ + _statusCode: code, + } +} + +/* +UpdateAzureClusterDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type UpdateAzureClusterDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this update azure cluster default response has a 2xx status code +func (o *UpdateAzureClusterDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this update azure cluster default response has a 3xx status code +func (o *UpdateAzureClusterDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this update azure cluster default response has a 4xx status code +func (o *UpdateAzureClusterDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this update azure cluster default response has a 5xx status code +func (o *UpdateAzureClusterDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this update azure cluster default response a status code equal to that given +func (o *UpdateAzureClusterDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the update azure cluster default response +func (o *UpdateAzureClusterDefault) Code() int { + return o._statusCode +} + +func (o *UpdateAzureClusterDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/updateAzureCluster][%d] updateAzureCluster default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateAzureClusterDefault) String() string { + return fmt.Sprintf("[POST /api/v1/dw/updateAzureCluster][%d] updateAzureCluster default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateAzureClusterDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateAzureClusterDefault) 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/cdp-sdk-go/gen/dw/client/operations/update_private_cluster_parameters.go b/cdp-sdk-go/gen/dw/client/operations/update_private_cluster_parameters.go new file mode 100644 index 00000000..0f1fb4d3 --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/update_private_cluster_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// NewUpdatePrivateClusterParams creates a new UpdatePrivateClusterParams 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 NewUpdatePrivateClusterParams() *UpdatePrivateClusterParams { + return &UpdatePrivateClusterParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdatePrivateClusterParamsWithTimeout creates a new UpdatePrivateClusterParams object +// with the ability to set a timeout on a request. +func NewUpdatePrivateClusterParamsWithTimeout(timeout time.Duration) *UpdatePrivateClusterParams { + return &UpdatePrivateClusterParams{ + timeout: timeout, + } +} + +// NewUpdatePrivateClusterParamsWithContext creates a new UpdatePrivateClusterParams object +// with the ability to set a context for a request. +func NewUpdatePrivateClusterParamsWithContext(ctx context.Context) *UpdatePrivateClusterParams { + return &UpdatePrivateClusterParams{ + Context: ctx, + } +} + +// NewUpdatePrivateClusterParamsWithHTTPClient creates a new UpdatePrivateClusterParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdatePrivateClusterParamsWithHTTPClient(client *http.Client) *UpdatePrivateClusterParams { + return &UpdatePrivateClusterParams{ + HTTPClient: client, + } +} + +/* +UpdatePrivateClusterParams contains all the parameters to send to the API endpoint + + for the update private cluster operation. + + Typically these are written to a http.Request. +*/ +type UpdatePrivateClusterParams struct { + + // Input. + Input *models.UpdatePrivateClusterRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update private cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePrivateClusterParams) WithDefaults() *UpdatePrivateClusterParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update private cluster params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePrivateClusterParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update private cluster params +func (o *UpdatePrivateClusterParams) WithTimeout(timeout time.Duration) *UpdatePrivateClusterParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update private cluster params +func (o *UpdatePrivateClusterParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update private cluster params +func (o *UpdatePrivateClusterParams) WithContext(ctx context.Context) *UpdatePrivateClusterParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update private cluster params +func (o *UpdatePrivateClusterParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update private cluster params +func (o *UpdatePrivateClusterParams) WithHTTPClient(client *http.Client) *UpdatePrivateClusterParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update private cluster params +func (o *UpdatePrivateClusterParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the update private cluster params +func (o *UpdatePrivateClusterParams) WithInput(input *models.UpdatePrivateClusterRequest) *UpdatePrivateClusterParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the update private cluster params +func (o *UpdatePrivateClusterParams) SetInput(input *models.UpdatePrivateClusterRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdatePrivateClusterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/dw/client/operations/update_private_cluster_responses.go b/cdp-sdk-go/gen/dw/client/operations/update_private_cluster_responses.go new file mode 100644 index 00000000..5ba55485 --- /dev/null +++ b/cdp-sdk-go/gen/dw/client/operations/update_private_cluster_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" +) + +// UpdatePrivateClusterReader is a Reader for the UpdatePrivateCluster structure. +type UpdatePrivateClusterReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdatePrivateClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdatePrivateClusterOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdatePrivateClusterDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewUpdatePrivateClusterOK creates a UpdatePrivateClusterOK with default headers values +func NewUpdatePrivateClusterOK() *UpdatePrivateClusterOK { + return &UpdatePrivateClusterOK{} +} + +/* +UpdatePrivateClusterOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type UpdatePrivateClusterOK struct { + Payload models.UpdatePrivateClusterResponse +} + +// IsSuccess returns true when this update private cluster o k response has a 2xx status code +func (o *UpdatePrivateClusterOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update private cluster o k response has a 3xx status code +func (o *UpdatePrivateClusterOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update private cluster o k response has a 4xx status code +func (o *UpdatePrivateClusterOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update private cluster o k response has a 5xx status code +func (o *UpdatePrivateClusterOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update private cluster o k response a status code equal to that given +func (o *UpdatePrivateClusterOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update private cluster o k response +func (o *UpdatePrivateClusterOK) Code() int { + return 200 +} + +func (o *UpdatePrivateClusterOK) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/updatePrivateCluster][%d] updatePrivateClusterOK %+v", 200, o.Payload) +} + +func (o *UpdatePrivateClusterOK) String() string { + return fmt.Sprintf("[POST /api/v1/dw/updatePrivateCluster][%d] updatePrivateClusterOK %+v", 200, o.Payload) +} + +func (o *UpdatePrivateClusterOK) GetPayload() models.UpdatePrivateClusterResponse { + return o.Payload +} + +func (o *UpdatePrivateClusterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdatePrivateClusterDefault creates a UpdatePrivateClusterDefault with default headers values +func NewUpdatePrivateClusterDefault(code int) *UpdatePrivateClusterDefault { + return &UpdatePrivateClusterDefault{ + _statusCode: code, + } +} + +/* +UpdatePrivateClusterDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type UpdatePrivateClusterDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this update private cluster default response has a 2xx status code +func (o *UpdatePrivateClusterDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this update private cluster default response has a 3xx status code +func (o *UpdatePrivateClusterDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this update private cluster default response has a 4xx status code +func (o *UpdatePrivateClusterDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this update private cluster default response has a 5xx status code +func (o *UpdatePrivateClusterDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this update private cluster default response a status code equal to that given +func (o *UpdatePrivateClusterDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the update private cluster default response +func (o *UpdatePrivateClusterDefault) Code() int { + return o._statusCode +} + +func (o *UpdatePrivateClusterDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/dw/updatePrivateCluster][%d] updatePrivateCluster default %+v", o._statusCode, o.Payload) +} + +func (o *UpdatePrivateClusterDefault) String() string { + return fmt.Sprintf("[POST /api/v1/dw/updatePrivateCluster][%d] updatePrivateCluster default %+v", o._statusCode, o.Payload) +} + +func (o *UpdatePrivateClusterDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdatePrivateClusterDefault) 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/cdp-sdk-go/gen/dw/models/allowed_instance_types.go b/cdp-sdk-go/gen/dw/models/allowed_instance_types.go index f8839c18..f3650150 100644 --- a/cdp-sdk-go/gen/dw/models/allowed_instance_types.go +++ b/cdp-sdk-go/gen/dw/models/allowed_instance_types.go @@ -17,10 +17,10 @@ import ( // swagger:model AllowedInstanceTypes type AllowedInstanceTypes struct { - // Allowed values for the instance type. + // Allowed values for the instance type. This setting is Cluster-wide. Allowed []string `json:"allowed"` - // Default value for the compute instance type usage. + // Default value for the compute instance type usage. This setting is Cluster-wide. Default []string `json:"default"` } diff --git a/cdp-sdk-go/gen/dw/models/autoscaling_options_create_request.go b/cdp-sdk-go/gen/dw/models/autoscaling_options_create_request.go index 998b54a5..5625621f 100644 --- a/cdp-sdk-go/gen/dw/models/autoscaling_options_create_request.go +++ b/cdp-sdk-go/gen/dw/models/autoscaling_options_create_request.go @@ -41,6 +41,9 @@ type AutoscalingOptionsCreateRequest struct { // DEPRECATED in favor of the top level impalaHASettings object. Enables a shutdown of the coordinator. If Unified Analytics enabled then this setting explicitly disabled and should not be provided. ImpalaEnableShutdownOfCoordinator bool `json:"impalaEnableShutdownOfCoordinator,omitempty"` + // Configures executor group sets for workload aware autoscaling. + ImpalaExecutorGroupSets *ImpalaExecutorGroupSetsCreateRequest `json:"impalaExecutorGroupSets,omitempty"` + // DEPRECATED in favor of the top level impalaHASettings object. Set High Availability mode. If not provided the default will apply. This value is disregarded for Hive. // Enum: [ACTIVE_PASSIVE ACTIVE_ACTIVE DISABLED] ImpalaHighAvailabilityMode string `json:"impalaHighAvailabilityMode,omitempty"` @@ -71,6 +74,10 @@ type AutoscalingOptionsCreateRequest struct { func (m *AutoscalingOptionsCreateRequest) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateImpalaExecutorGroupSets(formats); err != nil { + res = append(res, err) + } + if err := m.validateImpalaHighAvailabilityMode(formats); err != nil { res = append(res, err) } @@ -81,6 +88,25 @@ func (m *AutoscalingOptionsCreateRequest) Validate(formats strfmt.Registry) erro return nil } +func (m *AutoscalingOptionsCreateRequest) validateImpalaExecutorGroupSets(formats strfmt.Registry) error { + if swag.IsZero(m.ImpalaExecutorGroupSets) { // not required + return nil + } + + if m.ImpalaExecutorGroupSets != nil { + if err := m.ImpalaExecutorGroupSets.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impalaExecutorGroupSets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impalaExecutorGroupSets") + } + return err + } + } + + return nil +} + var autoscalingOptionsCreateRequestTypeImpalaHighAvailabilityModePropEnum []interface{} func init() { @@ -126,8 +152,38 @@ func (m *AutoscalingOptionsCreateRequest) validateImpalaHighAvailabilityMode(for return nil } -// ContextValidate validates this autoscaling options create request based on context it is used +// ContextValidate validate this autoscaling options create request based on the context it is used func (m *AutoscalingOptionsCreateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImpalaExecutorGroupSets(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AutoscalingOptionsCreateRequest) contextValidateImpalaExecutorGroupSets(ctx context.Context, formats strfmt.Registry) error { + + if m.ImpalaExecutorGroupSets != nil { + + if swag.IsZero(m.ImpalaExecutorGroupSets) { // not required + return nil + } + + if err := m.ImpalaExecutorGroupSets.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impalaExecutorGroupSets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impalaExecutorGroupSets") + } + return err + } + } + return nil } diff --git a/cdp-sdk-go/gen/dw/models/autoscaling_options_response.go b/cdp-sdk-go/gen/dw/models/autoscaling_options_response.go index 5e7e1586..bbdb4358 100644 --- a/cdp-sdk-go/gen/dw/models/autoscaling_options_response.go +++ b/cdp-sdk-go/gen/dw/models/autoscaling_options_response.go @@ -41,6 +41,9 @@ type AutoscalingOptionsResponse struct { // DEPRECATED in favor of the top level impalaHASettings object. Whether a shutdown of the coordinator is enabled. ImpalaEnableShutdownOfCoordinator bool `json:"impalaEnableShutdownOfCoordinator,omitempty"` + // Configurations of executor groups sets for workload aware autoscaling. + ImpalaExecutorGroupSets *ImpalaExecutorGroupSetsResponse `json:"impalaExecutorGroupSets,omitempty"` + // DEPRECATED in favor of the top level impalaHASettings object. High Availability mode. // Enum: [ACTIVE_PASSIVE ACTIVE_ACTIVE DISABLED] ImpalaHighAvailabilityMode string `json:"impalaHighAvailabilityMode,omitempty"` @@ -71,6 +74,10 @@ type AutoscalingOptionsResponse struct { func (m *AutoscalingOptionsResponse) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateImpalaExecutorGroupSets(formats); err != nil { + res = append(res, err) + } + if err := m.validateImpalaHighAvailabilityMode(formats); err != nil { res = append(res, err) } @@ -81,6 +88,25 @@ func (m *AutoscalingOptionsResponse) Validate(formats strfmt.Registry) error { return nil } +func (m *AutoscalingOptionsResponse) validateImpalaExecutorGroupSets(formats strfmt.Registry) error { + if swag.IsZero(m.ImpalaExecutorGroupSets) { // not required + return nil + } + + if m.ImpalaExecutorGroupSets != nil { + if err := m.ImpalaExecutorGroupSets.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impalaExecutorGroupSets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impalaExecutorGroupSets") + } + return err + } + } + + return nil +} + var autoscalingOptionsResponseTypeImpalaHighAvailabilityModePropEnum []interface{} func init() { @@ -126,8 +152,38 @@ func (m *AutoscalingOptionsResponse) validateImpalaHighAvailabilityMode(formats return nil } -// ContextValidate validates this autoscaling options response based on context it is used +// ContextValidate validate this autoscaling options response based on the context it is used func (m *AutoscalingOptionsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImpalaExecutorGroupSets(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AutoscalingOptionsResponse) contextValidateImpalaExecutorGroupSets(ctx context.Context, formats strfmt.Registry) error { + + if m.ImpalaExecutorGroupSets != nil { + + if swag.IsZero(m.ImpalaExecutorGroupSets) { // not required + return nil + } + + if err := m.ImpalaExecutorGroupSets.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impalaExecutorGroupSets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impalaExecutorGroupSets") + } + return err + } + } + return nil } diff --git a/cdp-sdk-go/gen/dw/models/autoscaling_options_update_request.go b/cdp-sdk-go/gen/dw/models/autoscaling_options_update_request.go index edf3d43f..2487a91e 100644 --- a/cdp-sdk-go/gen/dw/models/autoscaling_options_update_request.go +++ b/cdp-sdk-go/gen/dw/models/autoscaling_options_update_request.go @@ -8,6 +8,7 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -29,6 +30,9 @@ type AutoscalingOptionsUpdateRequest struct { // Set wait time before a scale event happens. Either "hiveScaleWaitTimeSeconds" or "hiveDesiredFreeCapacity" can be provided. If "hiveScaleWaitTimeSeconds" provided, then the "hiveDesiredFreeCapacity" will be explicityly set to 0. HiveScaleWaitTimeSeconds int32 `json:"hiveScaleWaitTimeSeconds,omitempty"` + // Re-configures executor group sets for workload aware autoscaling. + ImpalaExecutorGroupSets *ImpalaExecutorGroupSetsUpdateRequest `json:"impalaExecutorGroupSets,omitempty"` + // DEPRECATED in favor of the top level impalaHASettings object. Number of the active coordinators. ImpalaNumOfActiveCoordinators int32 `json:"impalaNumOfActiveCoordinators,omitempty"` @@ -50,11 +54,69 @@ type AutoscalingOptionsUpdateRequest struct { // Validate validates this autoscaling options update request func (m *AutoscalingOptionsUpdateRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImpalaExecutorGroupSets(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AutoscalingOptionsUpdateRequest) validateImpalaExecutorGroupSets(formats strfmt.Registry) error { + if swag.IsZero(m.ImpalaExecutorGroupSets) { // not required + return nil + } + + if m.ImpalaExecutorGroupSets != nil { + if err := m.ImpalaExecutorGroupSets.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impalaExecutorGroupSets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impalaExecutorGroupSets") + } + return err + } + } + return nil } -// ContextValidate validates this autoscaling options update request based on context it is used +// ContextValidate validate this autoscaling options update request based on the context it is used func (m *AutoscalingOptionsUpdateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateImpalaExecutorGroupSets(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AutoscalingOptionsUpdateRequest) contextValidateImpalaExecutorGroupSets(ctx context.Context, formats strfmt.Registry) error { + + if m.ImpalaExecutorGroupSets != nil { + + if swag.IsZero(m.ImpalaExecutorGroupSets) { // not required + return nil + } + + if err := m.ImpalaExecutorGroupSets.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("impalaExecutorGroupSets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("impalaExecutorGroupSets") + } + return err + } + } + return nil } diff --git a/cdp-sdk-go/gen/dw/models/aws_activation_options.go b/cdp-sdk-go/gen/dw/models/aws_activation_options.go index 06031540..bbd26842 100644 --- a/cdp-sdk-go/gen/dw/models/aws_activation_options.go +++ b/cdp-sdk-go/gen/dw/models/aws_activation_options.go @@ -26,6 +26,9 @@ type AwsActivationOptions struct { // Custom AMI ID. CustomAmiID string `json:"customAmiId,omitempty"` + // Use this option to set up AWS EKS cluster in private only mode with restricted access only from internal/peered networks. Ensure you have ccmv2 setup functional to achieve this integration. + EnablePrivateEKS *bool `json:"enablePrivateEKS,omitempty"` + // Whether to enable Spot instances for Virtual warehouses. It cannot be updated later. If the aws-options is not provided it defaults to false. EnableSpotInstances *bool `json:"enableSpotInstances,omitempty"` @@ -35,12 +38,6 @@ type AwsActivationOptions struct { // Managed Policy Arn to be attached to the Node Instance Role. NodeRoleCDWManagedPolicyArn string `json:"nodeRoleCDWManagedPolicyArn,omitempty"` - // IDs of private AWS subnets where the cluster should be deployed. - PrivateSubnetIds []string `json:"privateSubnetIds"` - - // IDs of public AWS subnets where the cluster should be deployed. - PublicSubnetIds []string `json:"publicSubnetIds"` - // Use this option to activate the environment with fewer than half of the standard required IAM permissions on your AWS cross-account IAM role. ReducedPermissionMode bool `json:"reducedPermissionMode,omitempty"` diff --git a/cdp-sdk-go/gen/dw/models/azure_activation_options.go b/cdp-sdk-go/gen/dw/models/azure_activation_options.go index a8152299..4a5282dc 100644 --- a/cdp-sdk-go/gen/dw/models/azure_activation_options.go +++ b/cdp-sdk-go/gen/dw/models/azure_activation_options.go @@ -20,13 +20,16 @@ import ( // swagger:model AzureActivationOptions type AzureActivationOptions struct { + // Enable AKS VNet Azure Virtual Network (VNet) integration by specifying the delegated subnet name. An Azure Kubernetes Service (AKS) cluster configured with API Server VNet Integration projects the API server endpoint directly into a delegated subnet in the VNet where AKS is deployed. API Server VNet Integration enables network communication between the API server and the cluster nodes without requiring a private link or tunnel. + AksVNetIntegrationSubnetName string `json:"aksVNetIntegrationSubnetName,omitempty"` + // Azure compute instance types that the environment is restricted to use. This affects the creation of virtual warehouses where this restriction will apply. Select an instance type that meets your computing, memory, networking, or storage needs. As of now, only a single instance type can be listed. Use describe-allowed-instance-types to see currently possible values and the default value used for the case it is not provided. ComputeInstanceTypes []string `json:"computeInstanceTypes"` // Enables Azure Availability Zones for the cluster deployment. EnableAZ bool `json:"enableAZ,omitempty"` - // Enable Azure Private AKS mode. + // Enable Azure Private AKS mode. Note that this feature is currently unstable due to critical networking issues within the Azure Software Definition Layer (SDN). This problem prevents the deployment of necessary components and results in unpredictable behavior and instability, impacting operations such as environment activation, VW creation, modification, and start/stop operations. While we work towards a resolution with Microsoft, estimated within the next 6-9 months, we recommend utilizing alternative methods like enabling public endpoints or virtual network peering for accessing your Azure Cluster. EnablePrivateAks *bool `json:"enablePrivateAks,omitempty"` // Enables private SQL for the cluster deployment. @@ -45,7 +48,7 @@ type AzureActivationOptions struct { // Private DNS zone AKS resource ID. PrivateDNSZoneAKS string `json:"privateDNSZoneAKS,omitempty"` - // ID of Azure subnet where the cluster should be deployed. + // ID of Azure subnet where the cluster should be deployed. It is a mandatory parameter for Azure cluster creation. SubnetID string `json:"subnetId,omitempty"` // Resource ID of the managed identity used by AKS. It is a mandatory parameter for Azure cluster creation. diff --git a/cdp-sdk-go/gen/dw/models/azure_options_response.go b/cdp-sdk-go/gen/dw/models/azure_options_response.go index 4cac3bd6..0ea428e6 100644 --- a/cdp-sdk-go/gen/dw/models/azure_options_response.go +++ b/cdp-sdk-go/gen/dw/models/azure_options_response.go @@ -17,6 +17,9 @@ import ( // swagger:model AzureOptionsResponse type AzureOptionsResponse struct { + // AKS VNet integration subnet name. If it's an empty string, then VNet integration is disabled. + AksVNetIntegrationSubnetName string `json:"aksVNetIntegrationSubnetName"` + // Denotes whther the Azure Availability Zones for the cluster is enabled or not. EnableAZ *bool `json:"enableAZ,omitempty"` diff --git a/cdp-sdk-go/gen/dw/models/backup_cluster_response.go b/cdp-sdk-go/gen/dw/models/backup_cluster_response.go index e752fabf..f04b0883 100644 --- a/cdp-sdk-go/gen/dw/models/backup_cluster_response.go +++ b/cdp-sdk-go/gen/dw/models/backup_cluster_response.go @@ -28,6 +28,9 @@ type BackupClusterResponse struct { // The md5 hash of the encoded data. Md5 string `json:"md5,omitempty"` + // The ID of the backup operation. + OperationID string `json:"operationId,omitempty"` + // The date of the creation. // Format: date-time Timestamp strfmt.DateTime `json:"timestamp,omitempty"` diff --git a/cdp-sdk-go/gen/dw/models/cluster_summary_response.go b/cdp-sdk-go/gen/dw/models/cluster_summary_response.go index 3e4f670e..1b82248a 100644 --- a/cdp-sdk-go/gen/dw/models/cluster_summary_response.go +++ b/cdp-sdk-go/gen/dw/models/cluster_summary_response.go @@ -7,6 +7,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -44,6 +45,9 @@ type ClusterSummaryResponse struct { // The CRN of the cluster. Crn string `json:"crn,omitempty"` + // Cluster description. + Description string `json:"description,omitempty"` + // Denotes whether the spot instances have been enabled for the cluster. This value is only available for AWS and Azure clusters. EnableSpotInstances bool `json:"enableSpotInstances,omitempty"` @@ -53,14 +57,32 @@ type ClusterSummaryResponse struct { // The CRN of the environment where the cluster is located. EnvironmentCrn string `json:"environmentCrn,omitempty"` + // External buckets attached to the environment. + ExternalBuckets []*ExternalBucket `json:"externalBuckets"` + // The ID of the cluster. ID string `json:"id,omitempty"` // Name of the cluster (same as the name of the environment). Name string `json:"name,omitempty"` + // Number of additional reserved nodes for executors and coordinators to use during autoscaling. + ReservedComputeNodes int32 `json:"reservedComputeNodes,omitempty"` + + // Number of additional reserved nodes for other services in the cluster. + ReservedSharedServicesNodes int32 `json:"reservedSharedServicesNodes,omitempty"` + + // The name of the Resource Pool the cluster is in. + ResourcePool string `json:"resourcePool,omitempty"` + // Status of the cluster. Possible values are: Creating, Created, Accepted, Starting, Running, Stopping, Stopped, Updating, PreUpdate, Upgrading, PreUpgrade, Restarting, Deleting, Waiting, Failed, Error. Status string `json:"status,omitempty"` + + // List of IP address CIDRs to whitelist for kubernetes cluster access. + WhitelistK8sClusterAccessIPCIDRs string `json:"whitelistK8sClusterAccessIpCIDRs,omitempty"` + + // List of IP address CIDRs to whitelist for workload access. + WhitelistWorkloadAccessIPCIDRs string `json:"whitelistWorkloadAccessIpCIDRs,omitempty"` } // Validate validates this cluster summary response @@ -83,6 +105,10 @@ func (m *ClusterSummaryResponse) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateExternalBuckets(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -158,6 +184,32 @@ func (m *ClusterSummaryResponse) validateCreator(formats strfmt.Registry) error return nil } +func (m *ClusterSummaryResponse) validateExternalBuckets(formats strfmt.Registry) error { + if swag.IsZero(m.ExternalBuckets) { // not required + return nil + } + + for i := 0; i < len(m.ExternalBuckets); i++ { + if swag.IsZero(m.ExternalBuckets[i]) { // not required + continue + } + + if m.ExternalBuckets[i] != nil { + if err := m.ExternalBuckets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("externalBuckets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("externalBuckets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // ContextValidate validate this cluster summary response based on the context it is used func (m *ClusterSummaryResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -174,6 +226,10 @@ func (m *ClusterSummaryResponse) ContextValidate(ctx context.Context, formats st res = append(res, err) } + if err := m.contextValidateExternalBuckets(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -243,6 +299,31 @@ func (m *ClusterSummaryResponse) contextValidateCreator(ctx context.Context, for return nil } +func (m *ClusterSummaryResponse) contextValidateExternalBuckets(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ExternalBuckets); i++ { + + if m.ExternalBuckets[i] != nil { + + if swag.IsZero(m.ExternalBuckets[i]) { // not required + return nil + } + + if err := m.ExternalBuckets[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("externalBuckets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("externalBuckets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ClusterSummaryResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/cdp-sdk-go/gen/dw/models/create_aws_cluster_request.go b/cdp-sdk-go/gen/dw/models/create_aws_cluster_request.go new file mode 100644 index 00000000..7c289f88 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/create_aws_cluster_request.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateAwsClusterRequest Request object for the createAwsCluster method. +// +// swagger:model CreateAwsClusterRequest +type CreateAwsClusterRequest struct { + + // Additional (fallback) instance types listed in their priority order. They will be used instead of the primary compute instance type in case it is unavailable. You cannot include any instance type that was already indicated in computeInstanceTypes. Use describe-allowed-instance-types to see currently supported values and also the default value when nothing is provided for the computeInstanceTypes. + AdditionalInstanceTypes []string `json:"additionalInstanceTypes"` + + // AWS compute instance types that the environment is restricted to use. This affects the creation of virtual warehouses where this restriction will apply. Select an instance type that meets your computing, memory, networking, or storage needs. As of now, only a single instance type can be listed. Use describe-allowed-instance-types to see currently possible values. + ComputeInstanceTypes []string `json:"computeInstanceTypes"` + + // Custom AMI ID. + CustomAmiID string `json:"customAmiId,omitempty"` + + // Options for custom ACR/ECR/Docker registries. + CustomRegistryOptions *CustomRegistryOptions `json:"customRegistryOptions,omitempty"` + + // Custom environment subdomain. Overrides the environment subdomain using a customized domain either in the old subdomain format like ENV_ID.dw or the new format like dw-ENV_NAME. + CustomSubdomain string `json:"customSubdomain,omitempty"` + + // PostgreSQL server backup retention days. + DatabaseBackupRetentionPeriod *int32 `json:"databaseBackupRetentionPeriod,omitempty"` + + // Use this option to set up AWS EKS cluster in private only mode with restricted access only from internal/peered networks. Ensure you have ccmv2 setup functional to achieve this integration. + EnablePrivateEKS *bool `json:"enablePrivateEKS,omitempty"` + + // Whether to enable Spot instances for Virtual warehouses. It cannot be updated later. Defaults to false. + EnableSpotInstances *bool `json:"enableSpotInstances,omitempty"` + + // Enable Storage Roles + EnableStorageRoles *bool `json:"enableStorageRoles,omitempty"` + + // The CRN of the environment for the cluster to create. + // Required: true + EnvironmentCrn *string `json:"environmentCrn"` + + // IDs of AWS subnets where the cluster load balancer should be deployed. + LbSubnetIds []string `json:"lbSubnetIds"` + + // Managed Policy Arn to be attached to the Node Instance Role. + NodeRoleCDWManagedPolicyArn string `json:"nodeRoleCDWManagedPolicyArn,omitempty"` + + // Use this option to activate the environment with fewer than half of the standard required IAM permissions on your AWS cross-account IAM role. + ReducedPermissionMode bool `json:"reducedPermissionMode,omitempty"` + + // Set additional number of nodes to reserve for executors and coordinators to use during autoscaling. Adding more reserved nodes increases your cloud costs. + ReservedComputeNodes int32 `json:"reservedComputeNodes,omitempty"` + + // Set additional number of nodes to reserve for other services in the cluster. Adding more reserved nodes increases your cloud costs. + ReservedSharedServicesNodes int32 `json:"reservedSharedServicesNodes,omitempty"` + + // Using an overlay network will save IP addresses in the VPC by using a private IP address range for Pods in the cluster. + UseOverlayNetwork bool `json:"useOverlayNetwork,omitempty"` + + // Set up load balancer with private IP address. In AWS it is created in private subnets. In Azure an internal load balancer gets created. Make sure there is connectivity between your client network and the network (VPC/VNet) where CDW environment is deployed. + UsePrivateLoadBalancer bool `json:"usePrivateLoadBalancer,omitempty"` + + // Set up worker node with public IP address. In AWS it is created in public subnets. + UsePublicWorkerNode bool `json:"usePublicWorkerNode,omitempty"` + + // List of IP address CIDRs to whitelist for kubernetes cluster access. + WhitelistK8sClusterAccessIPCIDRs []string `json:"whitelistK8sClusterAccessIpCIDRs"` + + // List of IP address CIDRs to whitelist for workload access. + WhitelistWorkloadAccessIPCIDRs []string `json:"whitelistWorkloadAccessIpCIDRs"` + + // IDs of AWS subnets where the cluster worker nodes should be deployed. + WorkerSubnetIds []string `json:"workerSubnetIds"` +} + +// Validate validates this create aws cluster request +func (m *CreateAwsClusterRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCustomRegistryOptions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvironmentCrn(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAwsClusterRequest) validateCustomRegistryOptions(formats strfmt.Registry) error { + if swag.IsZero(m.CustomRegistryOptions) { // not required + return nil + } + + if m.CustomRegistryOptions != nil { + if err := m.CustomRegistryOptions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customRegistryOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customRegistryOptions") + } + return err + } + } + + return nil +} + +func (m *CreateAwsClusterRequest) validateEnvironmentCrn(formats strfmt.Registry) error { + + if err := validate.Required("environmentCrn", "body", m.EnvironmentCrn); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create aws cluster request based on the context it is used +func (m *CreateAwsClusterRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustomRegistryOptions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAwsClusterRequest) contextValidateCustomRegistryOptions(ctx context.Context, formats strfmt.Registry) error { + + if m.CustomRegistryOptions != nil { + + if swag.IsZero(m.CustomRegistryOptions) { // not required + return nil + } + + if err := m.CustomRegistryOptions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customRegistryOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customRegistryOptions") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAwsClusterRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAwsClusterRequest) UnmarshalBinary(b []byte) error { + var res CreateAwsClusterRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/create_aws_cluster_response.go b/cdp-sdk-go/gen/dw/models/create_aws_cluster_response.go new file mode 100644 index 00000000..438bc0d8 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/create_aws_cluster_response.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CreateAwsClusterResponse Response object for the createAwsCluster method. +// +// swagger:model CreateAwsClusterResponse +type CreateAwsClusterResponse struct { + + // ID of new AWS cluster. + ClusterID string `json:"clusterId,omitempty"` +} + +// Validate validates this create aws cluster response +func (m *CreateAwsClusterResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this create aws cluster response based on context it is used +func (m *CreateAwsClusterResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAwsClusterResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAwsClusterResponse) UnmarshalBinary(b []byte) error { + var res CreateAwsClusterResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/create_azure_cluster_request.go b/cdp-sdk-go/gen/dw/models/create_azure_cluster_request.go new file mode 100644 index 00000000..d9c1b5c2 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/create_azure_cluster_request.go @@ -0,0 +1,252 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateAzureClusterRequest Request object for the createAzureCluster method. +// +// swagger:model CreateAzureClusterRequest +type CreateAzureClusterRequest struct { + + // Enable AKS VNet Azure Virtual Network (VNet) integration by specifying the delegated subnet name. An Azure Kubernetes Service (AKS) cluster configured with API Server VNet Integration projects the API server endpoint directly into a delegated subnet in the VNet where AKS is deployed. API Server VNet Integration enables network communication between the API server and the cluster nodes without requiring a private link or tunnel. + AksVNetIntegrationSubnetName string `json:"aksVNetIntegrationSubnetName,omitempty"` + + // Azure compute instance types that the environment is restricted to use. This affects the creation of virtual warehouses where this restriction will apply. Select an instance type that meets your computing, memory, networking, or storage needs. As of now, only a single instance type can be listed. Use describe-allowed-instance-types to see currently possible values and the default value used for the case it is not provided. + ComputeInstanceTypes []string `json:"computeInstanceTypes"` + + // Options for custom ACR/ECR/Docker registries. + CustomRegistryOptions *CustomRegistryOptions `json:"customRegistryOptions,omitempty"` + + // Custom environment subdomain. Overrides the environment subdomain using a customized domain either in the old subdomain format like ENV_ID.dw or the new format like dw-ENV_NAME. + CustomSubdomain string `json:"customSubdomain,omitempty"` + + // PostgreSQL server backup retention days. + DatabaseBackupRetentionPeriod *int32 `json:"databaseBackupRetentionPeriod,omitempty"` + + // Enables Azure Availability Zones for the cluster deployment. + EnableAZ bool `json:"enableAZ,omitempty"` + + // Enable Azure Private AKS mode. Note that this feature is currently unstable due to critical networking issues within the Azure Software Definition Layer (SDN). This problem prevents the deployment of necessary components and results in unpredictable behavior and instability, impacting operations such as environment activation, VW creation, modification, and start/stop operations. While we work towards a resolution with Microsoft, estimated within the next 6-9 months, we recommend utilizing alternative methods like enabling public endpoints or virtual network peering for accessing your Azure Cluster. + EnablePrivateAks *bool `json:"enablePrivateAks,omitempty"` + + // Enables private SQL for the cluster deployment. + EnablePrivateSQL *bool `json:"enablePrivateSQL,omitempty"` + + // Whether to enable spot instances for Virtual warehouses. It cannot be updated later. Defaults to false. + EnableSpotInstances *bool `json:"enableSpotInstances,omitempty"` + + // Enable Storage Roles + EnableStorageRoles *bool `json:"enableStorageRoles,omitempty"` + + // The CRN of the environment for the cluster to create. + // Required: true + EnvironmentCrn *string `json:"environmentCrn"` + + // With kubenet, nodes get an IP address from the Azure virtual network subnet. Pods receive an IP address from a logically different address space to the Azure virtual network subnet of the nodes. + Kubenet bool `json:"kubenet,omitempty"` + + // Enable monitoring of Azure Kubernetes Service (AKS) cluster. Workspace ID for Azure log analytics. + LogAnalyticsWorkspaceID string `json:"logAnalyticsWorkspaceId,omitempty"` + + // Network outbound type. This setting controls the egress traffic for cluster nodes in Azure Kubernetes Service. Please refer to the following AKS documentation on the Azure portal. https://learn.microsoft.com/en-us/azure/aks/egress-outboundtype, https://learn.microsoft.com/en-us/azure/aks/nat-gateway + // Enum: [LoadBalancer UserAssignedNATGateway UserDefinedRouting] + OutboundType string `json:"outboundType,omitempty"` + + // Private DNS zone AKS resource ID. + PrivateDNSZoneAKS string `json:"privateDNSZoneAKS,omitempty"` + + // Set additional number of nodes to reserve for executors and coordinators to use during autoscaling. Adding more reserved nodes increases your cloud costs. + ReservedComputeNodes int32 `json:"reservedComputeNodes,omitempty"` + + // Set additional number of nodes to reserve for other services in the cluster. Adding more reserved nodes increases your cloud costs. + ReservedSharedServicesNodes int32 `json:"reservedSharedServicesNodes,omitempty"` + + // ID of Azure subnet where the cluster should be deployed. It is a mandatory parameter for Azure cluster creation. + SubnetID string `json:"subnetId,omitempty"` + + // Set up load balancer with private IP address. An internal load balancer gets created. Make sure there is connectivity between your client network and the network VNet where CDW environment is deployed. + UsePrivateLoadBalancer bool `json:"usePrivateLoadBalancer,omitempty"` + + // Resource ID of the managed identity used by AKS. It is a mandatory parameter for Azure cluster creation. + // Required: true + UserAssignedManagedIdentity *string `json:"userAssignedManagedIdentity"` + + // List of IP address CIDRs to whitelist for kubernetes cluster access. + WhitelistK8sClusterAccessIPCIDRs []string `json:"whitelistK8sClusterAccessIpCIDRs"` + + // List of IP address CIDRs to whitelist for workload access. + WhitelistWorkloadAccessIPCIDRs []string `json:"whitelistWorkloadAccessIpCIDRs"` +} + +// Validate validates this create azure cluster request +func (m *CreateAzureClusterRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCustomRegistryOptions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvironmentCrn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOutboundType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserAssignedManagedIdentity(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAzureClusterRequest) validateCustomRegistryOptions(formats strfmt.Registry) error { + if swag.IsZero(m.CustomRegistryOptions) { // not required + return nil + } + + if m.CustomRegistryOptions != nil { + if err := m.CustomRegistryOptions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customRegistryOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customRegistryOptions") + } + return err + } + } + + return nil +} + +func (m *CreateAzureClusterRequest) validateEnvironmentCrn(formats strfmt.Registry) error { + + if err := validate.Required("environmentCrn", "body", m.EnvironmentCrn); err != nil { + return err + } + + return nil +} + +var createAzureClusterRequestTypeOutboundTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["LoadBalancer","UserAssignedNATGateway","UserDefinedRouting"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createAzureClusterRequestTypeOutboundTypePropEnum = append(createAzureClusterRequestTypeOutboundTypePropEnum, v) + } +} + +const ( + + // CreateAzureClusterRequestOutboundTypeLoadBalancer captures enum value "LoadBalancer" + CreateAzureClusterRequestOutboundTypeLoadBalancer string = "LoadBalancer" + + // CreateAzureClusterRequestOutboundTypeUserAssignedNATGateway captures enum value "UserAssignedNATGateway" + CreateAzureClusterRequestOutboundTypeUserAssignedNATGateway string = "UserAssignedNATGateway" + + // CreateAzureClusterRequestOutboundTypeUserDefinedRouting captures enum value "UserDefinedRouting" + CreateAzureClusterRequestOutboundTypeUserDefinedRouting string = "UserDefinedRouting" +) + +// prop value enum +func (m *CreateAzureClusterRequest) validateOutboundTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createAzureClusterRequestTypeOutboundTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateAzureClusterRequest) validateOutboundType(formats strfmt.Registry) error { + if swag.IsZero(m.OutboundType) { // not required + return nil + } + + // value enum + if err := m.validateOutboundTypeEnum("outboundType", "body", m.OutboundType); err != nil { + return err + } + + return nil +} + +func (m *CreateAzureClusterRequest) validateUserAssignedManagedIdentity(formats strfmt.Registry) error { + + if err := validate.Required("userAssignedManagedIdentity", "body", m.UserAssignedManagedIdentity); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create azure cluster request based on the context it is used +func (m *CreateAzureClusterRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustomRegistryOptions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAzureClusterRequest) contextValidateCustomRegistryOptions(ctx context.Context, formats strfmt.Registry) error { + + if m.CustomRegistryOptions != nil { + + if swag.IsZero(m.CustomRegistryOptions) { // not required + return nil + } + + if err := m.CustomRegistryOptions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customRegistryOptions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customRegistryOptions") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAzureClusterRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAzureClusterRequest) UnmarshalBinary(b []byte) error { + var res CreateAzureClusterRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/create_azure_cluster_response.go b/cdp-sdk-go/gen/dw/models/create_azure_cluster_response.go new file mode 100644 index 00000000..a612eaea --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/create_azure_cluster_response.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CreateAzureClusterResponse Response object for the createCluster method. +// +// swagger:model CreateAzureClusterResponse +type CreateAzureClusterResponse struct { + + // ID of new Azure cluster. + ClusterID string `json:"clusterId,omitempty"` +} + +// Validate validates this create azure cluster response +func (m *CreateAzureClusterResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this create azure cluster response based on context it is used +func (m *CreateAzureClusterResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAzureClusterResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAzureClusterResponse) UnmarshalBinary(b []byte) error { + var res CreateAzureClusterResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/create_backup_request.go b/cdp-sdk-go/gen/dw/models/create_backup_request.go index b7a6ae6f..cbbd589f 100644 --- a/cdp-sdk-go/gen/dw/models/create_backup_request.go +++ b/cdp-sdk-go/gen/dw/models/create_backup_request.go @@ -20,8 +20,11 @@ type CreateBackupRequest struct { // Specified name for the backup. If not set, the name will be blank. BackupName string `json:"backupName,omitempty"` - // Namespace of the potential candidate for backup. If not set, all of the Data Warehouse namespaces will be backed up. + // DEPRECATED in favor of the namespaceNames. Namespace of the potential candidate for backup. If not set, all of the Data Warehouse namespaces will be backed up. NamespaceName string `json:"namespaceName,omitempty"` + + // If both namespaceName and namespaceNames are set, the namespaceName will be ignored! A list of namespace of the potential candidates for backup. If not set, all of the Data Warehouse namespaces will be backed up. + NamespaceNames []string `json:"namespaceNames"` } // Validate validates this create backup request diff --git a/cdp-sdk-go/gen/dw/models/create_cluster_request.go b/cdp-sdk-go/gen/dw/models/create_cluster_request.go index c6d94f07..5dc12972 100644 --- a/cdp-sdk-go/gen/dw/models/create_cluster_request.go +++ b/cdp-sdk-go/gen/dw/models/create_cluster_request.go @@ -44,6 +44,15 @@ type CreateClusterRequest struct { // Options for activating a Private Cloud environment. PrivateCloudOptions *PrivateCloudActivationOptions `json:"privateCloudOptions,omitempty"` + // Set additional number of nodes to reserve for executors and coordinators to use during autoscaling. Adding more reserved nodes increases your cloud costs. + ReservedComputeNodes int32 `json:"reservedComputeNodes,omitempty"` + + // Set additional number of nodes to reserve for other services in the cluster. Adding more reserved nodes increases your cloud costs. + ReservedSharedServicesNodes int32 `json:"reservedSharedServicesNodes,omitempty"` + + // The Resource Pool of the cluster. + ResourcePool string `json:"resourcePool,omitempty"` + // Using an overlay network will save IP addresses in the VPC by using a private IP address range for Pods in the cluster. UseOverlayNetwork bool `json:"useOverlayNetwork,omitempty"` diff --git a/cdp-sdk-go/gen/dw/models/create_dbc_request.go b/cdp-sdk-go/gen/dw/models/create_dbc_request.go index bd9e8b7f..a7cef32b 100644 --- a/cdp-sdk-go/gen/dw/models/create_dbc_request.go +++ b/cdp-sdk-go/gen/dw/models/create_dbc_request.go @@ -35,7 +35,7 @@ type CreateDbcRequest struct { // Version of the Database Catalog. ImageVersion string `json:"imageVersion,omitempty"` - // Is this a Default Database Catalog? + // NOTE: creating Default Database Catalogs is deprecated and explicitly disabled. Denotes if Default Database Catalog creation needed. IsDefault *bool `json:"isDefault,omitempty"` // Load demo data into the Database Catalog? diff --git a/cdp-sdk-go/gen/dw/models/create_private_cluster_request.go b/cdp-sdk-go/gen/dw/models/create_private_cluster_request.go new file mode 100644 index 00000000..6b8b02b0 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/create_private_cluster_request.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreatePrivateClusterRequest Request object for the createPrivateCluster method. +// +// swagger:model CreatePrivateClusterRequest +type CreatePrivateClusterRequest struct { + + // The name of the HUE database. Not required for embedded databases. + DbHue string `json:"dbHue,omitempty"` + + // Enable to use dedicated nodes exclusively for executors and coordinators, and improve performance. You can enable this only if you reserved nodes while adding a CDP Private Cloud containerized ECS cluster. When disabled, non-compute pods such as MetaStore and Data Visualization can also use the reserved nodes. + DedicatedExecutorNodes *bool `json:"dedicatedExecutorNodes,omitempty"` + + // Password of delegation user. + // Required: true + DelegationPassword *string `json:"delegationPassword"` + + // Name of delegation user. This user is used between Hue - Impala to create a session, as Hue should not pass the user credentials, instead Hue authenticates with the delegation user, then this user will impersonate the logged in user. This means that the Delegation User and Password should be able to authenticate through LDAP. + // Required: true + DelegationUsername *string `json:"delegationUsername"` + + // The CRN of the environment for the cluster to create. + // Required: true + EnvironmentCrn *string `json:"environmentCrn"` + + // The Resource Pool of the cluster. + ResourcePool string `json:"resourcePool,omitempty"` + + // The name of the Hive Security Context Constraint. + SecurityContextConstraintName string `json:"securityContextConstraintName,omitempty"` + + // The storage class for the Local Storage Operator. + StorageClass string `json:"storageClass,omitempty"` +} + +// Validate validates this create private cluster request +func (m *CreatePrivateClusterRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDelegationPassword(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDelegationUsername(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvironmentCrn(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreatePrivateClusterRequest) validateDelegationPassword(formats strfmt.Registry) error { + + if err := validate.Required("delegationPassword", "body", m.DelegationPassword); err != nil { + return err + } + + return nil +} + +func (m *CreatePrivateClusterRequest) validateDelegationUsername(formats strfmt.Registry) error { + + if err := validate.Required("delegationUsername", "body", m.DelegationUsername); err != nil { + return err + } + + return nil +} + +func (m *CreatePrivateClusterRequest) validateEnvironmentCrn(formats strfmt.Registry) error { + + if err := validate.Required("environmentCrn", "body", m.EnvironmentCrn); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create private cluster request based on context it is used +func (m *CreatePrivateClusterRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreatePrivateClusterRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreatePrivateClusterRequest) UnmarshalBinary(b []byte) error { + var res CreatePrivateClusterRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/create_private_cluster_response.go b/cdp-sdk-go/gen/dw/models/create_private_cluster_response.go new file mode 100644 index 00000000..df6df71f --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/create_private_cluster_response.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CreatePrivateClusterResponse Response object for the createPrivateCluster method. +// +// swagger:model CreatePrivateClusterResponse +type CreatePrivateClusterResponse struct { + + // ID of new Private Cloud cluster. + ClusterID string `json:"clusterId,omitempty"` +} + +// Validate validates this create private cluster response +func (m *CreatePrivateClusterResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this create private cluster response based on context it is used +func (m *CreatePrivateClusterResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreatePrivateClusterResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreatePrivateClusterResponse) UnmarshalBinary(b []byte) error { + var res CreatePrivateClusterResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/create_vw_request.go b/cdp-sdk-go/gen/dw/models/create_vw_request.go index ae45030b..6e1e8560 100644 --- a/cdp-sdk-go/gen/dw/models/create_vw_request.go +++ b/cdp-sdk-go/gen/dw/models/create_vw_request.go @@ -41,6 +41,9 @@ type CreateVwRequest struct { // Enable Unified Analytics. In the case of Hive Virtual Warehouses, this cannot be provided, because this value is inferred. In the case of Impala, this can be set. Passing --query-isolation-options will be considered only if this flag is set to true. If Unified Analytics is enabled then the "enableShutdownOfCoordinator" in --impala-ha-settings is explicitly disabled (ignored) and should not be provided, furthermore the "highAvailabilityMode" in --impala-ha-settings cannot be set to ACTIVE_ACTIVE. EnableUnifiedAnalytics bool `json:"enableUnifiedAnalytics,omitempty"` + // DEPRECATED - Sets the authentication mode to use by Hive Server: * `LDAP` * `KERBEROS` Default: `LDAP` if not specified + HiveAuthenticationMode *string `json:"hiveAuthenticationMode,omitempty"` + // version of the Virtual Warehouse. ImageVersion string `json:"imageVersion,omitempty"` @@ -54,7 +57,7 @@ type CreateVwRequest struct { // Required: true Name *string `json:"name"` - // Node Count per compute cluster. Implies 'custom' template, even if you pass template explicitly. + // Nodes per compute cluster. If specified, forces 'template' to be 'custom' NodeCount int32 `json:"nodeCount,omitempty"` // Value of 'true' automatically configures the Virtual Warehouse to support JWTs issues by the CDP JWT token provider. Value of 'false' does not enable JWT auth on the Virtual Warehouse. If this field is not specified, it defaults to 'false'. @@ -63,6 +66,9 @@ type CreateVwRequest struct { // Query isolation settings for the Virtual Warehouse. For Impala this value will be considered only if Unified Analytics is enabled. QueryIsolationOptions *QueryIsolationOptionsRequest `json:"queryIsolationOptions,omitempty"` + // The Resource Pool of the Virtual Warehouse. + ResourcePool string `json:"resourcePool,omitempty"` + // Tags associated with the resources. Tags []*TagRequest `json:"tags"` diff --git a/cdp-sdk-go/gen/dw/models/data_visualization_summary.go b/cdp-sdk-go/gen/dw/models/data_visualization_summary.go index 90f5e2b2..910ebf03 100644 --- a/cdp-sdk-go/gen/dw/models/data_visualization_summary.go +++ b/cdp-sdk-go/gen/dw/models/data_visualization_summary.go @@ -17,6 +17,9 @@ import ( // swagger:model DataVisualizationSummary type DataVisualizationSummary struct { + // Admin groups that are allowed to access the Data Visualization. + AdminGroups []string `json:"adminGroups"` + // The CRN of the user who created the Cloudera Data Visualization CreatorCrn string `json:"creatorCrn,omitempty"` @@ -29,11 +32,17 @@ type DataVisualizationSummary struct { // The name of the Cloudera Data Visualization. Name string `json:"name,omitempty"` + // The name of the Resource Pool the Cloudera Data Visualization is in. + ResourcePool string `json:"resourcePool,omitempty"` + // The template size for the Cloudera Data Visualization Size string `json:"size,omitempty"` // Status of the Cloudera Data Visualization. Possible values are: Creating, Created, Accepted, Starting, Running, Stopping, Stopped, Updating, PreUpdate, Upgrading, PreUpgrade, Restarting, Deleting, Waiting, Failed, Error. Status string `json:"status,omitempty"` + + // User groups that are allowed to access the Data Visualization. + UserGroups []string `json:"userGroups"` } // Validate validates this data visualization summary diff --git a/cdp-sdk-go/gen/dw/models/dbc_summary.go b/cdp-sdk-go/gen/dw/models/dbc_summary.go index 04e64bf6..6e1c1629 100644 --- a/cdp-sdk-go/gen/dw/models/dbc_summary.go +++ b/cdp-sdk-go/gen/dw/models/dbc_summary.go @@ -35,6 +35,9 @@ type DbcSummary struct { // The name of the Database Catalog. Name string `json:"name,omitempty"` + // The name of the Resource Pool the Database Catalog is in. + ResourcePool string `json:"resourcePool,omitempty"` + // Status of the Database Catalog. Possible values are: Creating, Created, Accepted, Starting, Running, Stopping, Stopped, Updating, PreUpdate, Upgrading, PreUpgrade, Restarting, Deleting, Waiting, Failed, Error. Status string `json:"status,omitempty"` diff --git a/cdp-sdk-go/gen/dw/models/event.go b/cdp-sdk-go/gen/dw/models/event.go new file mode 100644 index 00000000..7c901ac9 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/event.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Event Represents a Event. +// +// swagger:model Event +type Event struct { + + // The name of the event. + Event string `json:"event,omitempty"` + + // Detailed message. + Message string `json:"message,omitempty"` + + // The ID of the operation to which the event belongs. + OperationID string `json:"operationId,omitempty"` + + // The ID of the service to which the event belongs. + ServiceID string `json:"serviceId,omitempty"` + + // The timestamp of the event. + // Format: date-time + Timestamp strfmt.DateTime `json:"timestamp,omitempty"` +} + +// Validate validates this event +func (m *Event) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTimestamp(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Event) validateTimestamp(formats strfmt.Registry) error { + if swag.IsZero(m.Timestamp) { // not required + return nil + } + + if err := validate.FormatOf("timestamp", "body", "date-time", m.Timestamp.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this event based on context it is used +func (m *Event) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Event) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Event) UnmarshalBinary(b []byte) error { + var res Event + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/external_bucket.go b/cdp-sdk-go/gen/dw/models/external_bucket.go new file mode 100644 index 00000000..8bd018fb --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/external_bucket.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ExternalBucket External bucket details. +// +// swagger:model ExternalBucket +type ExternalBucket struct { + + // AccessInfo of the bucket. + AccessInfo *ExternalBucketAccessInfo `json:"accessInfo,omitempty"` + + // Name of the bucket. + Name string `json:"name,omitempty"` +} + +// Validate validates this external bucket +func (m *ExternalBucket) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccessInfo(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExternalBucket) validateAccessInfo(formats strfmt.Registry) error { + if swag.IsZero(m.AccessInfo) { // not required + return nil + } + + if m.AccessInfo != nil { + if err := m.AccessInfo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("accessInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("accessInfo") + } + return err + } + } + + return nil +} + +// ContextValidate validate this external bucket based on the context it is used +func (m *ExternalBucket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAccessInfo(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExternalBucket) contextValidateAccessInfo(ctx context.Context, formats strfmt.Registry) error { + + if m.AccessInfo != nil { + + if swag.IsZero(m.AccessInfo) { // not required + return nil + } + + if err := m.AccessInfo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("accessInfo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("accessInfo") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExternalBucket) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExternalBucket) UnmarshalBinary(b []byte) error { + var res ExternalBucket + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/impala_executor_group_set_create_request.go b/cdp-sdk-go/gen/dw/models/impala_executor_group_set_create_request.go new file mode 100644 index 00000000..e80ae565 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/impala_executor_group_set_create_request.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ImpalaExecutorGroupSetCreateRequest Configure independently scaling set of uniformly sized executor groups. +// +// swagger:model ImpalaExecutorGroupSetCreateRequest +type ImpalaExecutorGroupSetCreateRequest struct { + + // Set auto suspend threshold. If not provided defaults will apply. + AutoSuspendTimeoutSeconds int32 `json:"autoSuspendTimeoutSeconds,omitempty"` + + // Turn off auto suspend. If not provided defaults will apply. + DisableAutoSuspend bool `json:"disableAutoSuspend,omitempty"` + + // Set number of executors per executor group. + ExecGroupSize int32 `json:"execGroupSize"` + + // Set maximum number of executor groups allowed. + MaxExecutorGroups int32 `json:"maxExecutorGroups"` + + // Set minimum number of executor groups allowed. + MinExecutorGroups int32 `json:"minExecutorGroups"` + + // Set scale down threshold in seconds. If not provided defaults will apply. + TriggerScaleDownDelay int32 `json:"triggerScaleDownDelay,omitempty"` + + // Set scale up threshold in seconds. If not provided defaults will apply. + TriggerScaleUpDelay int32 `json:"triggerScaleUpDelay,omitempty"` +} + +// Validate validates this impala executor group set create request +func (m *ImpalaExecutorGroupSetCreateRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this impala executor group set create request based on context it is used +func (m *ImpalaExecutorGroupSetCreateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ImpalaExecutorGroupSetCreateRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImpalaExecutorGroupSetCreateRequest) UnmarshalBinary(b []byte) error { + var res ImpalaExecutorGroupSetCreateRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/impala_executor_group_set_response.go b/cdp-sdk-go/gen/dw/models/impala_executor_group_set_response.go new file mode 100644 index 00000000..e65b2583 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/impala_executor_group_set_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ImpalaExecutorGroupSetResponse Describes configurations for an executor group set. +// +// swagger:model ImpalaExecutorGroupSetResponse +type ImpalaExecutorGroupSetResponse struct { + + // Auto suspend threshold. + AutoSuspendTimeoutSeconds int32 `json:"autoSuspendTimeoutSeconds"` + + // Denotes whether auto suspend is turned off. + DisableAutoSuspend bool `json:"disableAutoSuspend"` + + // Number of executors per executor group. + ExecGroupSize int32 `json:"execGroupSize"` + + // Name of resource pool for this executor group set. + GroupSetPrefix string `json:"groupSetPrefix"` + + // Maximum number of executor groups allowed. + MaxExecutorGroups int32 `json:"maxExecutorGroups"` + + // Minimum number of executor groups allowed. + MinExecutorGroups int32 `json:"minExecutorGroups"` + + // Scale down threshold in seconds. + TriggerScaleDownDelay int32 `json:"triggerScaleDownDelay"` + + // Scale up threshold in seconds. + TriggerScaleUpDelay int32 `json:"triggerScaleUpDelay"` +} + +// Validate validates this impala executor group set response +func (m *ImpalaExecutorGroupSetResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this impala executor group set response based on context it is used +func (m *ImpalaExecutorGroupSetResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ImpalaExecutorGroupSetResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImpalaExecutorGroupSetResponse) UnmarshalBinary(b []byte) error { + var res ImpalaExecutorGroupSetResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/impala_executor_group_set_update_request.go b/cdp-sdk-go/gen/dw/models/impala_executor_group_set_update_request.go new file mode 100644 index 00000000..b30ba527 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/impala_executor_group_set_update_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ImpalaExecutorGroupSetUpdateRequest Re-configure independently scaling set of uniformly sized executor groups. +// +// swagger:model ImpalaExecutorGroupSetUpdateRequest +type ImpalaExecutorGroupSetUpdateRequest struct { + + // Set auto suspend threshold. If not provided defaults will apply. + AutoSuspendTimeoutSeconds int32 `json:"autoSuspendTimeoutSeconds,omitempty"` + + // Delete the executor group set. + DeleteGroupSet bool `json:"deleteGroupSet,omitempty"` + + // Turn off auto suspend. If not provided defaults will apply. + DisableAutoSuspend bool `json:"disableAutoSuspend,omitempty"` + + // Set number of executors per executor group. + ExecGroupSize int32 `json:"execGroupSize,omitempty"` + + // Set maximum number of executor groups allowed. + MaxExecutorGroups int32 `json:"maxExecutorGroups,omitempty"` + + // Set minimum number of executor groups allowed. + MinExecutorGroups int32 `json:"minExecutorGroups,omitempty"` + + // Set scale down threshold in seconds. If not provided defaults will apply. + TriggerScaleDownDelay int32 `json:"triggerScaleDownDelay,omitempty"` + + // Set scale up threshold in seconds. If not provided defaults will apply. + TriggerScaleUpDelay int32 `json:"triggerScaleUpDelay,omitempty"` +} + +// Validate validates this impala executor group set update request +func (m *ImpalaExecutorGroupSetUpdateRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this impala executor group set update request based on context it is used +func (m *ImpalaExecutorGroupSetUpdateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ImpalaExecutorGroupSetUpdateRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImpalaExecutorGroupSetUpdateRequest) UnmarshalBinary(b []byte) error { + var res ImpalaExecutorGroupSetUpdateRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/impala_executor_group_sets_create_request.go b/cdp-sdk-go/gen/dw/models/impala_executor_group_sets_create_request.go new file mode 100644 index 00000000..472474e2 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/impala_executor_group_sets_create_request.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ImpalaExecutorGroupSetsCreateRequest Configure executor group sets for workload aware autoscaling. +// +// swagger:model ImpalaExecutorGroupSetsCreateRequest +type ImpalaExecutorGroupSetsCreateRequest struct { + + // Configure first optional custom executor group set for workload aware autoscaling. + Custom1 *ImpalaExecutorGroupSetCreateRequest `json:"custom1,omitempty"` + + // Configure second optional custom executor group set for workload aware autoscaling. + Custom2 *ImpalaExecutorGroupSetCreateRequest `json:"custom2,omitempty"` + + // Configure third optional custom executor group set for workload aware autoscaling. + Custom3 *ImpalaExecutorGroupSetCreateRequest `json:"custom3,omitempty"` + + // Configure large executor group set for workload aware autoscaling. + Large *ImpalaExecutorGroupSetCreateRequest `json:"large,omitempty"` + + // Configure small executor group set for workload aware autoscaling. + Small *ImpalaExecutorGroupSetCreateRequest `json:"small,omitempty"` +} + +// Validate validates this impala executor group sets create request +func (m *ImpalaExecutorGroupSetsCreateRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCustom1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustom2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustom3(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLarge(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSmall(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImpalaExecutorGroupSetsCreateRequest) validateCustom1(formats strfmt.Registry) error { + if swag.IsZero(m.Custom1) { // not required + return nil + } + + if m.Custom1 != nil { + if err := m.Custom1.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom1") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom1") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsCreateRequest) validateCustom2(formats strfmt.Registry) error { + if swag.IsZero(m.Custom2) { // not required + return nil + } + + if m.Custom2 != nil { + if err := m.Custom2.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom2") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsCreateRequest) validateCustom3(formats strfmt.Registry) error { + if swag.IsZero(m.Custom3) { // not required + return nil + } + + if m.Custom3 != nil { + if err := m.Custom3.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom3") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom3") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsCreateRequest) validateLarge(formats strfmt.Registry) error { + if swag.IsZero(m.Large) { // not required + return nil + } + + if m.Large != nil { + if err := m.Large.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("large") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("large") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsCreateRequest) validateSmall(formats strfmt.Registry) error { + if swag.IsZero(m.Small) { // not required + return nil + } + + if m.Small != nil { + if err := m.Small.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("small") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("small") + } + return err + } + } + + return nil +} + +// ContextValidate validate this impala executor group sets create request based on the context it is used +func (m *ImpalaExecutorGroupSetsCreateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustom1(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustom2(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustom3(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLarge(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSmall(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImpalaExecutorGroupSetsCreateRequest) contextValidateCustom1(ctx context.Context, formats strfmt.Registry) error { + + if m.Custom1 != nil { + + if swag.IsZero(m.Custom1) { // not required + return nil + } + + if err := m.Custom1.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom1") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom1") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsCreateRequest) contextValidateCustom2(ctx context.Context, formats strfmt.Registry) error { + + if m.Custom2 != nil { + + if swag.IsZero(m.Custom2) { // not required + return nil + } + + if err := m.Custom2.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom2") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsCreateRequest) contextValidateCustom3(ctx context.Context, formats strfmt.Registry) error { + + if m.Custom3 != nil { + + if swag.IsZero(m.Custom3) { // not required + return nil + } + + if err := m.Custom3.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom3") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom3") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsCreateRequest) contextValidateLarge(ctx context.Context, formats strfmt.Registry) error { + + if m.Large != nil { + + if swag.IsZero(m.Large) { // not required + return nil + } + + if err := m.Large.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("large") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("large") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsCreateRequest) contextValidateSmall(ctx context.Context, formats strfmt.Registry) error { + + if m.Small != nil { + + if swag.IsZero(m.Small) { // not required + return nil + } + + if err := m.Small.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("small") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("small") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ImpalaExecutorGroupSetsCreateRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImpalaExecutorGroupSetsCreateRequest) UnmarshalBinary(b []byte) error { + var res ImpalaExecutorGroupSetsCreateRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/impala_executor_group_sets_response.go b/cdp-sdk-go/gen/dw/models/impala_executor_group_sets_response.go new file mode 100644 index 00000000..b0111b2d --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/impala_executor_group_sets_response.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ImpalaExecutorGroupSetsResponse Describes executor group sets for workload aware autoscaling. +// +// swagger:model ImpalaExecutorGroupSetsResponse +type ImpalaExecutorGroupSetsResponse struct { + + // Describes first custom executor group set for workload aware autoscaling. + Custom1 *ImpalaExecutorGroupSetResponse `json:"custom1,omitempty"` + + // Describes second custom executor group set for workload aware autoscaling. + Custom2 *ImpalaExecutorGroupSetResponse `json:"custom2,omitempty"` + + // Describes third custom executor group set for workload aware autoscaling. + Custom3 *ImpalaExecutorGroupSetResponse `json:"custom3,omitempty"` + + // Describes large executor group set for workload aware autoscaling. + Large *ImpalaExecutorGroupSetResponse `json:"large,omitempty"` + + // Describes small executor group set for workload aware autoscaling. + Small *ImpalaExecutorGroupSetResponse `json:"small,omitempty"` +} + +// Validate validates this impala executor group sets response +func (m *ImpalaExecutorGroupSetsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCustom1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustom2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustom3(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLarge(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSmall(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImpalaExecutorGroupSetsResponse) validateCustom1(formats strfmt.Registry) error { + if swag.IsZero(m.Custom1) { // not required + return nil + } + + if m.Custom1 != nil { + if err := m.Custom1.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom1") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom1") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsResponse) validateCustom2(formats strfmt.Registry) error { + if swag.IsZero(m.Custom2) { // not required + return nil + } + + if m.Custom2 != nil { + if err := m.Custom2.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom2") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsResponse) validateCustom3(formats strfmt.Registry) error { + if swag.IsZero(m.Custom3) { // not required + return nil + } + + if m.Custom3 != nil { + if err := m.Custom3.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom3") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom3") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsResponse) validateLarge(formats strfmt.Registry) error { + if swag.IsZero(m.Large) { // not required + return nil + } + + if m.Large != nil { + if err := m.Large.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("large") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("large") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsResponse) validateSmall(formats strfmt.Registry) error { + if swag.IsZero(m.Small) { // not required + return nil + } + + if m.Small != nil { + if err := m.Small.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("small") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("small") + } + return err + } + } + + return nil +} + +// ContextValidate validate this impala executor group sets response based on the context it is used +func (m *ImpalaExecutorGroupSetsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustom1(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustom2(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustom3(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLarge(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSmall(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImpalaExecutorGroupSetsResponse) contextValidateCustom1(ctx context.Context, formats strfmt.Registry) error { + + if m.Custom1 != nil { + + if swag.IsZero(m.Custom1) { // not required + return nil + } + + if err := m.Custom1.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom1") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom1") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsResponse) contextValidateCustom2(ctx context.Context, formats strfmt.Registry) error { + + if m.Custom2 != nil { + + if swag.IsZero(m.Custom2) { // not required + return nil + } + + if err := m.Custom2.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom2") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsResponse) contextValidateCustom3(ctx context.Context, formats strfmt.Registry) error { + + if m.Custom3 != nil { + + if swag.IsZero(m.Custom3) { // not required + return nil + } + + if err := m.Custom3.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom3") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom3") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsResponse) contextValidateLarge(ctx context.Context, formats strfmt.Registry) error { + + if m.Large != nil { + + if swag.IsZero(m.Large) { // not required + return nil + } + + if err := m.Large.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("large") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("large") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsResponse) contextValidateSmall(ctx context.Context, formats strfmt.Registry) error { + + if m.Small != nil { + + if swag.IsZero(m.Small) { // not required + return nil + } + + if err := m.Small.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("small") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("small") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ImpalaExecutorGroupSetsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImpalaExecutorGroupSetsResponse) UnmarshalBinary(b []byte) error { + var res ImpalaExecutorGroupSetsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/impala_executor_group_sets_update_request.go b/cdp-sdk-go/gen/dw/models/impala_executor_group_sets_update_request.go new file mode 100644 index 00000000..5eda6491 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/impala_executor_group_sets_update_request.go @@ -0,0 +1,313 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ImpalaExecutorGroupSetsUpdateRequest Re-configure executor group sets for workload aware autoscaling. +// +// swagger:model ImpalaExecutorGroupSetsUpdateRequest +type ImpalaExecutorGroupSetsUpdateRequest struct { + + // Re-configure first optional custom executor group set for workload aware autoscaling. + Custom1 *ImpalaExecutorGroupSetUpdateRequest `json:"custom1,omitempty"` + + // Re-configure second optional custom executor group set for workload aware autoscaling. + Custom2 *ImpalaExecutorGroupSetUpdateRequest `json:"custom2,omitempty"` + + // Re-configure third optional custom executor group set for workload aware autoscaling. + Custom3 *ImpalaExecutorGroupSetUpdateRequest `json:"custom3,omitempty"` + + // Re-configure large executor group set for workload aware autoscaling. + Large *ImpalaExecutorGroupSetUpdateRequest `json:"large,omitempty"` + + // Re-configure small executor group set for workload aware autoscaling. + Small *ImpalaExecutorGroupSetUpdateRequest `json:"small,omitempty"` +} + +// Validate validates this impala executor group sets update request +func (m *ImpalaExecutorGroupSetsUpdateRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCustom1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustom2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustom3(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLarge(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSmall(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImpalaExecutorGroupSetsUpdateRequest) validateCustom1(formats strfmt.Registry) error { + if swag.IsZero(m.Custom1) { // not required + return nil + } + + if m.Custom1 != nil { + if err := m.Custom1.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom1") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom1") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsUpdateRequest) validateCustom2(formats strfmt.Registry) error { + if swag.IsZero(m.Custom2) { // not required + return nil + } + + if m.Custom2 != nil { + if err := m.Custom2.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom2") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsUpdateRequest) validateCustom3(formats strfmt.Registry) error { + if swag.IsZero(m.Custom3) { // not required + return nil + } + + if m.Custom3 != nil { + if err := m.Custom3.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom3") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom3") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsUpdateRequest) validateLarge(formats strfmt.Registry) error { + if swag.IsZero(m.Large) { // not required + return nil + } + + if m.Large != nil { + if err := m.Large.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("large") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("large") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsUpdateRequest) validateSmall(formats strfmt.Registry) error { + if swag.IsZero(m.Small) { // not required + return nil + } + + if m.Small != nil { + if err := m.Small.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("small") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("small") + } + return err + } + } + + return nil +} + +// ContextValidate validate this impala executor group sets update request based on the context it is used +func (m *ImpalaExecutorGroupSetsUpdateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustom1(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustom2(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustom3(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLarge(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSmall(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImpalaExecutorGroupSetsUpdateRequest) contextValidateCustom1(ctx context.Context, formats strfmt.Registry) error { + + if m.Custom1 != nil { + + if swag.IsZero(m.Custom1) { // not required + return nil + } + + if err := m.Custom1.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom1") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom1") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsUpdateRequest) contextValidateCustom2(ctx context.Context, formats strfmt.Registry) error { + + if m.Custom2 != nil { + + if swag.IsZero(m.Custom2) { // not required + return nil + } + + if err := m.Custom2.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom2") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom2") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsUpdateRequest) contextValidateCustom3(ctx context.Context, formats strfmt.Registry) error { + + if m.Custom3 != nil { + + if swag.IsZero(m.Custom3) { // not required + return nil + } + + if err := m.Custom3.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom3") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom3") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsUpdateRequest) contextValidateLarge(ctx context.Context, formats strfmt.Registry) error { + + if m.Large != nil { + + if swag.IsZero(m.Large) { // not required + return nil + } + + if err := m.Large.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("large") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("large") + } + return err + } + } + + return nil +} + +func (m *ImpalaExecutorGroupSetsUpdateRequest) contextValidateSmall(ctx context.Context, formats strfmt.Registry) error { + + if m.Small != nil { + + if swag.IsZero(m.Small) { // not required + return nil + } + + if err := m.Small.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("small") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("small") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ImpalaExecutorGroupSetsUpdateRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImpalaExecutorGroupSetsUpdateRequest) UnmarshalBinary(b []byte) error { + var res ImpalaExecutorGroupSetsUpdateRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/list_events_request.go b/cdp-sdk-go/gen/dw/models/list_events_request.go new file mode 100644 index 00000000..f71621da --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/list_events_request.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ListEventsRequest Request object for the listEvents method. +// +// swagger:model ListEventsRequest +type ListEventsRequest struct { + + // Provide the result in ascending order, default is descending. + Ascending *bool `json:"ascending,omitempty"` + + // Limit the number of returned rows. If not specified then the recent 20 events will be returned. The maximum is 100. + Limit int32 `json:"limit,omitempty"` + + // Filter events based on the operation ID. Either operation ID or service ID is required. + OperationID string `json:"operationId,omitempty"` + + // Filter events based on the service ID. It can be Cluster ID, Database Catalog ID, Virtual Warehouse ID or Data Visualization App ID. + ServiceID string `json:"serviceId,omitempty"` +} + +// Validate validates this list events request +func (m *ListEventsRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list events request based on context it is used +func (m *ListEventsRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ListEventsRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListEventsRequest) UnmarshalBinary(b []byte) error { + var res ListEventsRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/list_events_response.go b/cdp-sdk-go/gen/dw/models/list_events_response.go new file mode 100644 index 00000000..092d8b64 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/list_events_response.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ListEventsResponse Response object for the listEvents method. +// +// swagger:model ListEventsResponse +type ListEventsResponse struct { + + // List of the events. + Events []*Event `json:"events"` +} + +// Validate validates this list events response +func (m *ListEventsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEvents(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListEventsResponse) validateEvents(formats strfmt.Registry) error { + if swag.IsZero(m.Events) { // not required + return nil + } + + for i := 0; i < len(m.Events); i++ { + if swag.IsZero(m.Events[i]) { // not required + continue + } + + if m.Events[i] != nil { + if err := m.Events[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("events" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("events" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this list events response based on the context it is used +func (m *ListEventsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEvents(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListEventsResponse) contextValidateEvents(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Events); i++ { + + if m.Events[i] != nil { + + if swag.IsZero(m.Events[i]) { // not required + return nil + } + + if err := m.Events[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("events" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("events" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ListEventsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListEventsResponse) UnmarshalBinary(b []byte) error { + var res ListEventsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/private_cloud_activation_options.go b/cdp-sdk-go/gen/dw/models/private_cloud_activation_options.go index 1933e6c8..e7a67995 100644 --- a/cdp-sdk-go/gen/dw/models/private_cloud_activation_options.go +++ b/cdp-sdk-go/gen/dw/models/private_cloud_activation_options.go @@ -25,6 +25,9 @@ type PrivateCloudActivationOptions struct { // The name of the HUE database. Not required for embedded databases. DbHue string `json:"dbHue,omitempty"` + // Enable to use dedicated nodes exclusively for executors and coordinators, and improve performance. You can enable this only if you reserved nodes while adding a CDP Private Cloud containerized ECS cluster. When disabled, non-compute pods such as MetaStore and Data Visualization can also use the reserved nodes. + DedicatedExecutorNodes *bool `json:"dedicatedExecutorNodes,omitempty"` + // Password of delegation user. // Required: true DelegationPassword *string `json:"delegationPassword"` diff --git a/cdp-sdk-go/gen/dw/models/replica_status.go b/cdp-sdk-go/gen/dw/models/replica_status.go index 1bc3832e..87994259 100644 --- a/cdp-sdk-go/gen/dw/models/replica_status.go +++ b/cdp-sdk-go/gen/dw/models/replica_status.go @@ -17,6 +17,9 @@ import ( // swagger:model ReplicaStatus type ReplicaStatus struct { + // Total number of ready coordinator replicas in the virtual warehouse. This number only contains the healthy executor replicas that have already started up and are ready to accept requests. If this number is less than the totalCoordinatorReplicas, then the virtual warehouse might still be starting up or there might be a problem scheduling these replicas. + ReadyCoordinatorReplicas int32 `json:"readyCoordinatorReplicas"` + // Total number of ready executor replicas in the virtual warehouse. This number only contains the healthy executor replicas that have already started up and are ready to accept requests. If this number is less than the totalExecutorReplicas, then the virtual warehouse might still be starting up or there might be a problem scheduling these replicas. ReadyExecutorReplicas int32 `json:"readyExecutorReplicas"` diff --git a/cdp-sdk-go/gen/dw/models/restore_cluster_response.go b/cdp-sdk-go/gen/dw/models/restore_cluster_response.go index 5d03592a..51da1828 100644 --- a/cdp-sdk-go/gen/dw/models/restore_cluster_response.go +++ b/cdp-sdk-go/gen/dw/models/restore_cluster_response.go @@ -19,7 +19,10 @@ import ( // swagger:model RestoreClusterResponse type RestoreClusterResponse struct { - // The the ID of the cluster. + // The cluster action. Possible actions: Create, Skip + Action string `json:"action,omitempty"` + + // The ID of the cluster. ClusterID string `json:"clusterId,omitempty"` // Information about the restore-plan of the DbCatalogs. @@ -28,10 +31,16 @@ type RestoreClusterResponse struct { // Information about the restore-plan of the Hive Virtual Warehouses. HiveRestorePlans []*RestoreClusterEntityPlan `json:"hiveRestorePlans"` + // Information about the restore-plan of Hue. + HueRestorePlans []*RestoreClusterEntityPlan `json:"hueRestorePlans"` + // Information about the restore-plan of the Impala Virtual Warehouses. ImpalaRestorePlans []*RestoreClusterEntityPlan `json:"impalaRestorePlans"` - // The the ID of the restore operation. + // The description of the cluster action. + Message string `json:"message,omitempty"` + + // The ID of the restore operation. OperationID string `json:"operationId,omitempty"` // Information about the restore-plan of the Data Visualization Apps. @@ -50,6 +59,10 @@ func (m *RestoreClusterResponse) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateHueRestorePlans(formats); err != nil { + res = append(res, err) + } + if err := m.validateImpalaRestorePlans(formats); err != nil { res = append(res, err) } @@ -116,6 +129,32 @@ func (m *RestoreClusterResponse) validateHiveRestorePlans(formats strfmt.Registr return nil } +func (m *RestoreClusterResponse) validateHueRestorePlans(formats strfmt.Registry) error { + if swag.IsZero(m.HueRestorePlans) { // not required + return nil + } + + for i := 0; i < len(m.HueRestorePlans); i++ { + if swag.IsZero(m.HueRestorePlans[i]) { // not required + continue + } + + if m.HueRestorePlans[i] != nil { + if err := m.HueRestorePlans[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hueRestorePlans" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hueRestorePlans" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *RestoreClusterResponse) validateImpalaRestorePlans(formats strfmt.Registry) error { if swag.IsZero(m.ImpalaRestorePlans) { // not required return nil @@ -180,6 +219,10 @@ func (m *RestoreClusterResponse) ContextValidate(ctx context.Context, formats st res = append(res, err) } + if err := m.contextValidateHueRestorePlans(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateImpalaRestorePlans(ctx, formats); err != nil { res = append(res, err) } @@ -244,6 +287,31 @@ func (m *RestoreClusterResponse) contextValidateHiveRestorePlans(ctx context.Con return nil } +func (m *RestoreClusterResponse) contextValidateHueRestorePlans(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.HueRestorePlans); i++ { + + if m.HueRestorePlans[i] != nil { + + if swag.IsZero(m.HueRestorePlans[i]) { // not required + return nil + } + + if err := m.HueRestorePlans[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hueRestorePlans" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hueRestorePlans" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *RestoreClusterResponse) contextValidateImpalaRestorePlans(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.ImpalaRestorePlans); i++ { diff --git a/cdp-sdk-go/gen/dw/models/resume_cluster_request.go b/cdp-sdk-go/gen/dw/models/resume_cluster_request.go new file mode 100644 index 00000000..47b80510 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/resume_cluster_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ResumeClusterRequest Request object for resume cluster method. +// +// swagger:model ResumeClusterRequest +type ResumeClusterRequest struct { + + // The ID of the cluster to resume. + // Required: true + ClusterID *string `json:"clusterId"` +} + +// Validate validates this resume cluster request +func (m *ResumeClusterRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClusterID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResumeClusterRequest) validateClusterID(formats strfmt.Registry) error { + + if err := validate.Required("clusterId", "body", m.ClusterID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this resume cluster request based on context it is used +func (m *ResumeClusterRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ResumeClusterRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResumeClusterRequest) UnmarshalBinary(b []byte) error { + var res ResumeClusterRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/resume_cluster_response.go b/cdp-sdk-go/gen/dw/models/resume_cluster_response.go new file mode 100644 index 00000000..dbcd11ed --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/resume_cluster_response.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ResumeClusterResponse The response object for the resumeCluster method. +// +// swagger:model ResumeClusterResponse +type ResumeClusterResponse struct { + + // The ID of the cluster to describe. + ClusterID string `json:"clusterId,omitempty"` +} + +// Validate validates this resume cluster response +func (m *ResumeClusterResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this resume cluster response based on context it is used +func (m *ResumeClusterResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ResumeClusterResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResumeClusterResponse) UnmarshalBinary(b []byte) error { + var res ResumeClusterResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/suspend_cluster_request.go b/cdp-sdk-go/gen/dw/models/suspend_cluster_request.go new file mode 100644 index 00000000..8446f82a --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/suspend_cluster_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SuspendClusterRequest Request object for suspend cluster method. +// +// swagger:model SuspendClusterRequest +type SuspendClusterRequest struct { + + // The ID of the cluster to suspend. + // Required: true + ClusterID *string `json:"clusterId"` +} + +// Validate validates this suspend cluster request +func (m *SuspendClusterRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClusterID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SuspendClusterRequest) validateClusterID(formats strfmt.Registry) error { + + if err := validate.Required("clusterId", "body", m.ClusterID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this suspend cluster request based on context it is used +func (m *SuspendClusterRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SuspendClusterRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SuspendClusterRequest) UnmarshalBinary(b []byte) error { + var res SuspendClusterRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/suspend_cluster_response.go b/cdp-sdk-go/gen/dw/models/suspend_cluster_response.go new file mode 100644 index 00000000..1b265bce --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/suspend_cluster_response.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SuspendClusterResponse The response object for the suspendCluster method. +// +// swagger:model SuspendClusterResponse +type SuspendClusterResponse struct { + + // The ID of the cluster to describe. + ClusterID string `json:"clusterId,omitempty"` +} + +// Validate validates this suspend cluster response +func (m *SuspendClusterResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this suspend cluster response based on context it is used +func (m *SuspendClusterResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SuspendClusterResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SuspendClusterResponse) UnmarshalBinary(b []byte) error { + var res SuspendClusterResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/update_aws_cluster_request.go b/cdp-sdk-go/gen/dw/models/update_aws_cluster_request.go new file mode 100644 index 00000000..72e1f3ea --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/update_aws_cluster_request.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateAwsClusterRequest Request object for the updateAwsCluster method. +// +// swagger:model UpdateAwsClusterRequest +type UpdateAwsClusterRequest struct { + + // The ID of the AWS cluster to update. + // Required: true + ClusterID *string `json:"clusterId"` + + // Cluster description. + Description string `json:"description,omitempty"` + + // Cluster external bucket definition to update. + ExternalBuckets map[string]UpdateClusterExternalBucketAccessInfo `json:"externalBuckets,omitempty"` + + // Cluster observability configurations to update. You can forward logs from environments activated in Cloudera Data Warehouse (CDW) to observability and monitoring systems such as Datadog, New Relic, or Splunk. Please refer to the following Cloudera documentation for more info. https://docs.cloudera.com/data-warehouse/cloud/monitoring/topics/dw-observability-log-forwarding.html + ObservabilityConfig *UpdateClusterObservabilityConfig `json:"observabilityConfig,omitempty"` + + // List of IP address CIDRs to whitelist for kubernetes cluster access. + WhitelistK8sClusterAccessIPCIDRs []string `json:"whitelistK8sClusterAccessIpCIDRs"` + + // List of IP address CIDRs to whitelist for workload access. + WhitelistWorkloadAccessIPCIDRs []string `json:"whitelistWorkloadAccessIpCIDRs"` +} + +// Validate validates this update aws cluster request +func (m *UpdateAwsClusterRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClusterID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExternalBuckets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObservabilityConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAwsClusterRequest) validateClusterID(formats strfmt.Registry) error { + + if err := validate.Required("clusterId", "body", m.ClusterID); err != nil { + return err + } + + return nil +} + +func (m *UpdateAwsClusterRequest) validateExternalBuckets(formats strfmt.Registry) error { + if swag.IsZero(m.ExternalBuckets) { // not required + return nil + } + + for k := range m.ExternalBuckets { + + if err := validate.Required("externalBuckets"+"."+k, "body", m.ExternalBuckets[k]); err != nil { + return err + } + if val, ok := m.ExternalBuckets[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("externalBuckets" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("externalBuckets" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *UpdateAwsClusterRequest) validateObservabilityConfig(formats strfmt.Registry) error { + if swag.IsZero(m.ObservabilityConfig) { // not required + return nil + } + + if m.ObservabilityConfig != nil { + if err := m.ObservabilityConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("observabilityConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("observabilityConfig") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update aws cluster request based on the context it is used +func (m *UpdateAwsClusterRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateExternalBuckets(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateObservabilityConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAwsClusterRequest) contextValidateExternalBuckets(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.ExternalBuckets { + + if val, ok := m.ExternalBuckets[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *UpdateAwsClusterRequest) contextValidateObservabilityConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.ObservabilityConfig != nil { + + if swag.IsZero(m.ObservabilityConfig) { // not required + return nil + } + + if err := m.ObservabilityConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("observabilityConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("observabilityConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateAwsClusterRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateAwsClusterRequest) UnmarshalBinary(b []byte) error { + var res UpdateAwsClusterRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/update_aws_cluster_response.go b/cdp-sdk-go/gen/dw/models/update_aws_cluster_response.go new file mode 100644 index 00000000..f1c9ca01 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/update_aws_cluster_response.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// UpdateAwsClusterResponse Response object for the updateAwsCluster method. +// +// swagger:model UpdateAwsClusterResponse +type UpdateAwsClusterResponse interface{} diff --git a/cdp-sdk-go/gen/dw/models/update_azure_cluster_request.go b/cdp-sdk-go/gen/dw/models/update_azure_cluster_request.go new file mode 100644 index 00000000..0a68f4a6 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/update_azure_cluster_request.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateAzureClusterRequest Request object for the updateAzureCluster method. +// +// swagger:model UpdateAzureClusterRequest +type UpdateAzureClusterRequest struct { + + // The ID of the Azure cluster to update. + // Required: true + ClusterID *string `json:"clusterId"` + + // Cluster description. + Description string `json:"description,omitempty"` + + // Cluster observability configurations to update. You can forward logs from environments activated in Cloudera Data Warehouse (CDW) to observability and monitoring systems such as Datadog, New Relic, or Splunk. Please refer to the following Cloudera documentation for more info. https://docs.cloudera.com/data-warehouse/cloud/monitoring/topics/dw-observability-log-forwarding.html + ObservabilityConfig *UpdateClusterObservabilityConfig `json:"observabilityConfig,omitempty"` + + // Renew Azure cluster certificate. + RenewCertificate *bool `json:"renewCertificate,omitempty"` + + // List of IP address CIDRs to whitelist for kubernetes cluster access. + WhitelistK8sClusterAccessIPCIDRs []string `json:"whitelistK8sClusterAccessIpCIDRs"` + + // List of IP address CIDRs to whitelist for workload access. + WhitelistWorkloadAccessIPCIDRs []string `json:"whitelistWorkloadAccessIpCIDRs"` +} + +// Validate validates this update azure cluster request +func (m *UpdateAzureClusterRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClusterID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObservabilityConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAzureClusterRequest) validateClusterID(formats strfmt.Registry) error { + + if err := validate.Required("clusterId", "body", m.ClusterID); err != nil { + return err + } + + return nil +} + +func (m *UpdateAzureClusterRequest) validateObservabilityConfig(formats strfmt.Registry) error { + if swag.IsZero(m.ObservabilityConfig) { // not required + return nil + } + + if m.ObservabilityConfig != nil { + if err := m.ObservabilityConfig.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("observabilityConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("observabilityConfig") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update azure cluster request based on the context it is used +func (m *UpdateAzureClusterRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateObservabilityConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAzureClusterRequest) contextValidateObservabilityConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.ObservabilityConfig != nil { + + if swag.IsZero(m.ObservabilityConfig) { // not required + return nil + } + + if err := m.ObservabilityConfig.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("observabilityConfig") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("observabilityConfig") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateAzureClusterRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateAzureClusterRequest) UnmarshalBinary(b []byte) error { + var res UpdateAzureClusterRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/update_azure_cluster_response.go b/cdp-sdk-go/gen/dw/models/update_azure_cluster_response.go new file mode 100644 index 00000000..fd80926d --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/update_azure_cluster_response.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// UpdateAzureClusterResponse Response object for the updateAzureCluster method. +// +// swagger:model UpdateAzureClusterResponse +type UpdateAzureClusterResponse interface{} diff --git a/cdp-sdk-go/gen/dw/models/update_cluster_external_bucket_access_info.go b/cdp-sdk-go/gen/dw/models/update_cluster_external_bucket_access_info.go new file mode 100644 index 00000000..4179a013 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/update_cluster_external_bucket_access_info.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateClusterExternalBucketAccessInfo Cluster external bucket definition to update. +// +// swagger:model UpdateClusterExternalBucketAccessInfo +type UpdateClusterExternalBucketAccessInfo struct { + + // Specifies whether the external bucket will be added in read-only or read-write mode. + // Enum: [READ READWRITE] + AccessMode string `json:"accessMode,omitempty"` + + // Enable server side encryption with the specified KMS CMK ARN. If the value is empty or unspecified, default server side encryption will be used when the access mode is read-write. Otherwise this value is ignored. + KmsCmkArn string `json:"kmsCmkArn,omitempty"` +} + +// Validate validates this update cluster external bucket access info +func (m *UpdateClusterExternalBucketAccessInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccessMode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateClusterExternalBucketAccessInfoTypeAccessModePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["READ","READWRITE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateClusterExternalBucketAccessInfoTypeAccessModePropEnum = append(updateClusterExternalBucketAccessInfoTypeAccessModePropEnum, v) + } +} + +const ( + + // UpdateClusterExternalBucketAccessInfoAccessModeREAD captures enum value "READ" + UpdateClusterExternalBucketAccessInfoAccessModeREAD string = "READ" + + // UpdateClusterExternalBucketAccessInfoAccessModeREADWRITE captures enum value "READWRITE" + UpdateClusterExternalBucketAccessInfoAccessModeREADWRITE string = "READWRITE" +) + +// prop value enum +func (m *UpdateClusterExternalBucketAccessInfo) validateAccessModeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateClusterExternalBucketAccessInfoTypeAccessModePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateClusterExternalBucketAccessInfo) validateAccessMode(formats strfmt.Registry) error { + if swag.IsZero(m.AccessMode) { // not required + return nil + } + + // value enum + if err := m.validateAccessModeEnum("accessMode", "body", m.AccessMode); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update cluster external bucket access info based on context it is used +func (m *UpdateClusterExternalBucketAccessInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateClusterExternalBucketAccessInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateClusterExternalBucketAccessInfo) UnmarshalBinary(b []byte) error { + var res UpdateClusterExternalBucketAccessInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/update_cluster_observability_config.go b/cdp-sdk-go/gen/dw/models/update_cluster_observability_config.go new file mode 100644 index 00000000..101ab14e --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/update_cluster_observability_config.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateClusterObservabilityConfig Cluster observability settings to update. +// +// swagger:model UpdateClusterObservabilityConfig +type UpdateClusterObservabilityConfig struct { + + // Create the log forwarding configuration in a valid fluentd format. Then that configuration is later inserted into a larger fluentd configuration. + LogsForwardingConfig string `json:"logsForwardingConfig,omitempty"` + + // Set the proxy CA certificates (PEM Bundle). If you use a TLS-terminating proxy server to inspect outbound internet traffic, you need to provide the proxy server's CA certificates bundle in PEM bundle format when you configure log forwarding. + ProxyCABundle string `json:"proxyCABundle,omitempty"` +} + +// Validate validates this update cluster observability config +func (m *UpdateClusterObservabilityConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update cluster observability config based on context it is used +func (m *UpdateClusterObservabilityConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateClusterObservabilityConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateClusterObservabilityConfig) UnmarshalBinary(b []byte) error { + var res UpdateClusterObservabilityConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/update_cluster_request.go b/cdp-sdk-go/gen/dw/models/update_cluster_request.go index 0bc23c8b..90de7310 100644 --- a/cdp-sdk-go/gen/dw/models/update_cluster_request.go +++ b/cdp-sdk-go/gen/dw/models/update_cluster_request.go @@ -32,8 +32,8 @@ type UpdateClusterRequest struct { // Cluster description. Description string `json:"description,omitempty"` - // observability config - ObservabilityConfig *UpdateClusterRequestObservabilityConfig `json:"observabilityConfig,omitempty"` + // Cluster observability configurations to update. You can forward logs from environments activated in Cloudera Data Warehouse (CDW) to observability and monitoring systems such as Datadog, New Relic, or Splunk. Please refer to the following Cloudera documentation for more info. https://docs.cloudera.com/data-warehouse/cloud/monitoring/topics/dw-observability-log-forwarding.html + ObservabilityConfig *UpdateClusterObservabilityConfig `json:"observabilityConfig,omitempty"` // List of IP address CIDRs to whitelist. NOTE: CDW is in process of rolling out a new feature to whitelist IP CIDR separately for Kubernetes Clusters and Loadbalancers on CDP Public Cloud. For an existing cluster, if different IP CIDR has been already applied to LoadBalancer and the Kubernetes cluster through the DWX UI, then updating the IP CIDR of such cluster is not supported from CLI. In the upcoming release, the CLI will support this feature. Please make use of UI for the same. WhitelistIPCIDRs []string `json:"whitelistIpCIDRs"` @@ -246,7 +246,7 @@ func (m *UpdateClusterRequest) UnmarshalBinary(b []byte) error { type UpdateClusterRequestAwsUpdate struct { // External bucket definition. - ExternalBuckets map[string]ExternalBucketAccessInfo `json:"externalBuckets,omitempty"` + ExternalBuckets map[string]UpdateClusterExternalBucketAccessInfo `json:"externalBuckets,omitempty"` } // Validate validates this update cluster request aws update @@ -372,43 +372,3 @@ func (m *UpdateClusterRequestAzureUpdate) UnmarshalBinary(b []byte) error { *m = res return nil } - -// UpdateClusterRequestObservabilityConfig Update the cluster observability configurations. You can forward logs from environments activated in Cloudera Data Warehouse (CDW) to observability and monitoring systems such as Datadog, New Relic, or Splun. Please refer to the following Cloudera documentation for more info. https://docs.cloudera.com/data-warehouse/cloud/monitoring/topics/dw-observability-log-forwarding.html -// -// swagger:model UpdateClusterRequestObservabilityConfig -type UpdateClusterRequestObservabilityConfig struct { - - // Create the log forwarding configuration in a valid fluentd format. Then that configuration is later inserted into a larger fluentd configuration. - LogsForwardingConfig string `json:"logsForwardingConfig,omitempty"` - - // Set the proxy CA certificates (PEM Bundle). If you use a TLS-terminating proxy server to inspect outbound internet traffic, you need to provide the proxy server's CA certificates bundle in PEM bundle format when you configure log forwarding. - ProxyCABundle string `json:"proxyCABundle,omitempty"` -} - -// Validate validates this update cluster request observability config -func (m *UpdateClusterRequestObservabilityConfig) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update cluster request observability config based on context it is used -func (m *UpdateClusterRequestObservabilityConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateClusterRequestObservabilityConfig) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateClusterRequestObservabilityConfig) UnmarshalBinary(b []byte) error { - var res UpdateClusterRequestObservabilityConfig - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/cdp-sdk-go/gen/dw/models/update_private_cluster_request.go b/cdp-sdk-go/gen/dw/models/update_private_cluster_request.go new file mode 100644 index 00000000..664c5dd0 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/update_private_cluster_request.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdatePrivateClusterRequest Request object for the updatePrivateCluster method. +// +// swagger:model UpdatePrivateClusterRequest +type UpdatePrivateClusterRequest struct { + + // The ID of the Private Cloud cluster to update. + // Required: true + ClusterID *string `json:"clusterId"` + + // Set it true to enable dedicated nodes exclusively for executors and coordinators, and improve performance. You can enable this only if you reserve nodes while adding a CDP Private Cloud containerized ECS cluster. When disabled, non-compute pods such as MetaStore and Data Visualization can also use the reserved nodes. + DedicatedExecutorNodes bool `json:"dedicatedExecutorNodes,omitempty"` + + // The password to update for delegation user. Setting it to the same value as the existing password will be a no-op. + DelegationPassword string `json:"delegationPassword,omitempty"` + + // The user name to update for delegation user. Setting it to the same value as the existing delegation user name will be a no-op. + DelegationUsername string `json:"delegationUsername,omitempty"` + + // Cluster description. + Description string `json:"description,omitempty"` +} + +// Validate validates this update private cluster request +func (m *UpdatePrivateClusterRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClusterID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePrivateClusterRequest) validateClusterID(formats strfmt.Registry) error { + + if err := validate.Required("clusterId", "body", m.ClusterID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update private cluster request based on context it is used +func (m *UpdatePrivateClusterRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePrivateClusterRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePrivateClusterRequest) UnmarshalBinary(b []byte) error { + var res UpdatePrivateClusterRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/dw/models/update_private_cluster_response.go b/cdp-sdk-go/gen/dw/models/update_private_cluster_response.go new file mode 100644 index 00000000..1b8237a9 --- /dev/null +++ b/cdp-sdk-go/gen/dw/models/update_private_cluster_response.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// UpdatePrivateClusterResponse Response object for the updatePrivateCluster method. +// +// swagger:model UpdatePrivateClusterResponse +type UpdatePrivateClusterResponse interface{} diff --git a/cdp-sdk-go/gen/dw/models/update_vw_request.go b/cdp-sdk-go/gen/dw/models/update_vw_request.go index 1a54214e..d063b2ff 100644 --- a/cdp-sdk-go/gen/dw/models/update_vw_request.go +++ b/cdp-sdk-go/gen/dw/models/update_vw_request.go @@ -7,6 +7,7 @@ package models import ( "context" + "encoding/json" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -29,15 +30,25 @@ type UpdateVwRequest struct { // The service configuration to update the VW with. This will be applied on top of the existing configuration so there's no need to list configurations that stay the same. Config *ServiceConfigReq `json:"config,omitempty"` + // DEPRECATED - Sets the authentication mode to use by Hive Server: * `LDAP` * `KERBEROS` If not set then the authentication mode will not be changed during update. + HiveAuthenticationMode *string `json:"hiveAuthenticationMode,omitempty"` + // High Availability settings update for the Impala Virtual Warehouse. ImpalaHaSettings *ImpalaHASettingsUpdateRequest `json:"impalaHaSettings,omitempty"` + // Nodes per compute cluster. If specified, forces 'template' to be 'custom' + NodeCount int32 `json:"nodeCount,omitempty"` + // Value of 'true' automatically configures the Virtual Warehouse to support JWTs issues by the CDP JWT token provider. Value of 'false' does not enable JWT auth on the Virtual Warehouse. If this field is not specified, it defaults to 'false'. PlatformJwtAuth *bool `json:"platformJwtAuth,omitempty"` // Query isolation settings for Hive Virtual Warehouses. QueryIsolationOptions *QueryIsolationOptionsRequest `json:"queryIsolationOptions,omitempty"` + // Name of configuration template to use. + // Enum: [xsmall small medium large] + Template string `json:"template,omitempty"` + // ID of the Virtual Warehouse. // Required: true VwID *string `json:"vwId"` @@ -67,6 +78,10 @@ func (m *UpdateVwRequest) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTemplate(formats); err != nil { + res = append(res, err) + } + if err := m.validateVwID(formats); err != nil { res = append(res, err) } @@ -162,6 +177,54 @@ func (m *UpdateVwRequest) validateQueryIsolationOptions(formats strfmt.Registry) return nil } +var updateVwRequestTypeTemplatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["xsmall","small","medium","large"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateVwRequestTypeTemplatePropEnum = append(updateVwRequestTypeTemplatePropEnum, v) + } +} + +const ( + + // UpdateVwRequestTemplateXsmall captures enum value "xsmall" + UpdateVwRequestTemplateXsmall string = "xsmall" + + // UpdateVwRequestTemplateSmall captures enum value "small" + UpdateVwRequestTemplateSmall string = "small" + + // UpdateVwRequestTemplateMedium captures enum value "medium" + UpdateVwRequestTemplateMedium string = "medium" + + // UpdateVwRequestTemplateLarge captures enum value "large" + UpdateVwRequestTemplateLarge string = "large" +) + +// prop value enum +func (m *UpdateVwRequest) validateTemplateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateVwRequestTypeTemplatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateVwRequest) validateTemplate(formats strfmt.Registry) error { + if swag.IsZero(m.Template) { // not required + return nil + } + + // value enum + if err := m.validateTemplateEnum("template", "body", m.Template); err != nil { + return err + } + + return nil +} + func (m *UpdateVwRequest) validateVwID(formats strfmt.Registry) error { if err := validate.Required("vwId", "body", m.VwID); err != nil { diff --git a/cdp-sdk-go/gen/dw/models/viz_config.go b/cdp-sdk-go/gen/dw/models/viz_config.go index 117e4f8e..fd477e1c 100644 --- a/cdp-sdk-go/gen/dw/models/viz_config.go +++ b/cdp-sdk-go/gen/dw/models/viz_config.go @@ -20,6 +20,9 @@ type VizConfig struct { // Admin groups to allow configuration access to Data Visualization for selected users AdminGroups []string `json:"adminGroups"` + // The Resource Pool of the Cloudera Data Visualization. + ResourcePool string `json:"resourcePool,omitempty"` + // User groups to allow user access to Data Visualization for selected users UserGroups []string `json:"userGroups"` } diff --git a/cdp-sdk-go/gen/dw/models/vw_summary.go b/cdp-sdk-go/gen/dw/models/vw_summary.go index cc429d48..1f55e281 100644 --- a/cdp-sdk-go/gen/dw/models/vw_summary.go +++ b/cdp-sdk-go/gen/dw/models/vw_summary.go @@ -54,6 +54,9 @@ type VwSummary struct { // endpoints Endpoints *VwSummaryEndpoints `json:"endpoints,omitempty"` + // DEPRECATED - Authentication mode used by Hive Server: * `LDAP` * `KERBEROS` + HiveAuthenticationMode *string `json:"hiveAuthenticationMode,omitempty"` + // The ID of the Virtual Warehouse. ID string `json:"id,omitempty"` @@ -66,15 +69,27 @@ type VwSummary struct { // jwt auth JwtAuth *VwSummaryJwtAuth `json:"jwtAuth,omitempty"` + // Memory size of the Virtual Warehouse in MB. + MemoryCapacity int32 `json:"memoryCapacity,omitempty"` + // The name of the Virtual Warehouse. Name string `json:"name,omitempty"` + // Size of the Virtual Warehouse (node count per compute cluster). + NodeCount int32 `json:"nodeCount,omitempty"` + + // Number of cores of the Virtual Warehouse. + NumOfCores int32 `json:"numOfCores,omitempty"` + // The current settings stored for query-isolation. QueryIsolationOptions *QueryIsolationOptionsResponse `json:"queryIsolationOptions,omitempty"` // Status information on the current state of replicas in the virtual warehouse. ReplicaStatus *ReplicaStatus `json:"replicaStatus,omitempty"` + // The name of the Resource Pool the Virtual Warehouse is in. + ResourcePool string `json:"resourcePool,omitempty"` + // Status of the Virtual Warehouse. Possible values are: Creating, Created, Accepted, Starting, Running, Stopping, Stopped, Updating, PreUpdate, Upgrading, PreUpgrade, Restarting, Deleting, Waiting, Failed, Error. Status string `json:"status,omitempty"` @@ -707,6 +722,9 @@ type VwSummaryEndpoints struct { // URL of Data Analytics Studio for Hive Virtual Warehouses. Das string `json:"das,omitempty"` + // Command to use impala-shell for Unified Analytics + FengImpalaShell string `json:"fengImpalaShell,omitempty"` + // JDBC URL for Hive Virtual Warehouses. HiveJdbc string `json:"hiveJdbc,omitempty"` @@ -722,6 +740,9 @@ type VwSummaryEndpoints struct { // JDBC URL for Impala Virtual Warehouses. ImpalaJdbc string `json:"impalaJdbc,omitempty"` + // JDBC URL for Impala Virtual Warehouses with Kerberos authentication. + ImpalaKerberosJdbc string `json:"impalaKerberosJdbc,omitempty"` + // Command to use impala-shell for Impala Virtual Warehouses. ImpalaShell string `json:"impalaShell,omitempty"` @@ -731,6 +752,9 @@ type VwSummaryEndpoints struct { // When platform JWT authentication is enabled, contains a URL where a JWT token can be generated by the CDP JWT token provider. JwtTokenGenURL string `json:"jwtTokenGenUrl,omitempty"` + // Command to use impala-shell for Impala Virtual Warehouses with Kerberos authentication. + KerberosImpalaShell string `json:"kerberosImpalaShell,omitempty"` + // Port for clients to use when connecting to the VW. Port int32 `json:"port,omitempty"` } diff --git a/cdp-sdk-go/gen/environments/client/operations/create_a_w_s_gov_cloud_credential_parameters.go b/cdp-sdk-go/gen/environments/client/operations/create_a_w_s_gov_cloud_credential_parameters.go new file mode 100644 index 00000000..0951f40a --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/create_a_w_s_gov_cloud_credential_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewCreateAWSGovCloudCredentialParams creates a new CreateAWSGovCloudCredentialParams 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 NewCreateAWSGovCloudCredentialParams() *CreateAWSGovCloudCredentialParams { + return &CreateAWSGovCloudCredentialParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateAWSGovCloudCredentialParamsWithTimeout creates a new CreateAWSGovCloudCredentialParams object +// with the ability to set a timeout on a request. +func NewCreateAWSGovCloudCredentialParamsWithTimeout(timeout time.Duration) *CreateAWSGovCloudCredentialParams { + return &CreateAWSGovCloudCredentialParams{ + timeout: timeout, + } +} + +// NewCreateAWSGovCloudCredentialParamsWithContext creates a new CreateAWSGovCloudCredentialParams object +// with the ability to set a context for a request. +func NewCreateAWSGovCloudCredentialParamsWithContext(ctx context.Context) *CreateAWSGovCloudCredentialParams { + return &CreateAWSGovCloudCredentialParams{ + Context: ctx, + } +} + +// NewCreateAWSGovCloudCredentialParamsWithHTTPClient creates a new CreateAWSGovCloudCredentialParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateAWSGovCloudCredentialParamsWithHTTPClient(client *http.Client) *CreateAWSGovCloudCredentialParams { + return &CreateAWSGovCloudCredentialParams{ + HTTPClient: client, + } +} + +/* +CreateAWSGovCloudCredentialParams contains all the parameters to send to the API endpoint + + for the create a w s gov cloud credential operation. + + Typically these are written to a http.Request. +*/ +type CreateAWSGovCloudCredentialParams struct { + + // Input. + Input *models.CreateAWSGovCloudCredentialRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create a w s gov cloud credential params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAWSGovCloudCredentialParams) WithDefaults() *CreateAWSGovCloudCredentialParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create a w s gov cloud credential params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAWSGovCloudCredentialParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create a w s gov cloud credential params +func (o *CreateAWSGovCloudCredentialParams) WithTimeout(timeout time.Duration) *CreateAWSGovCloudCredentialParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create a w s gov cloud credential params +func (o *CreateAWSGovCloudCredentialParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create a w s gov cloud credential params +func (o *CreateAWSGovCloudCredentialParams) WithContext(ctx context.Context) *CreateAWSGovCloudCredentialParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create a w s gov cloud credential params +func (o *CreateAWSGovCloudCredentialParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create a w s gov cloud credential params +func (o *CreateAWSGovCloudCredentialParams) WithHTTPClient(client *http.Client) *CreateAWSGovCloudCredentialParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create a w s gov cloud credential params +func (o *CreateAWSGovCloudCredentialParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the create a w s gov cloud credential params +func (o *CreateAWSGovCloudCredentialParams) WithInput(input *models.CreateAWSGovCloudCredentialRequest) *CreateAWSGovCloudCredentialParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the create a w s gov cloud credential params +func (o *CreateAWSGovCloudCredentialParams) SetInput(input *models.CreateAWSGovCloudCredentialRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateAWSGovCloudCredentialParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/create_a_w_s_gov_cloud_credential_responses.go b/cdp-sdk-go/gen/environments/client/operations/create_a_w_s_gov_cloud_credential_responses.go new file mode 100644 index 00000000..108fc838 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/create_a_w_s_gov_cloud_credential_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// CreateAWSGovCloudCredentialReader is a Reader for the CreateAWSGovCloudCredential structure. +type CreateAWSGovCloudCredentialReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateAWSGovCloudCredentialReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateAWSGovCloudCredentialOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreateAWSGovCloudCredentialDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCreateAWSGovCloudCredentialOK creates a CreateAWSGovCloudCredentialOK with default headers values +func NewCreateAWSGovCloudCredentialOK() *CreateAWSGovCloudCredentialOK { + return &CreateAWSGovCloudCredentialOK{} +} + +/* +CreateAWSGovCloudCredentialOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type CreateAWSGovCloudCredentialOK struct { + Payload *models.CreateAWSGovCloudCredentialResponse +} + +// IsSuccess returns true when this create a w s gov cloud credential o k response has a 2xx status code +func (o *CreateAWSGovCloudCredentialOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create a w s gov cloud credential o k response has a 3xx status code +func (o *CreateAWSGovCloudCredentialOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create a w s gov cloud credential o k response has a 4xx status code +func (o *CreateAWSGovCloudCredentialOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create a w s gov cloud credential o k response has a 5xx status code +func (o *CreateAWSGovCloudCredentialOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create a w s gov cloud credential o k response a status code equal to that given +func (o *CreateAWSGovCloudCredentialOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create a w s gov cloud credential o k response +func (o *CreateAWSGovCloudCredentialOK) Code() int { + return 200 +} + +func (o *CreateAWSGovCloudCredentialOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/createAWSGovCloudCredential][%d] createAWSGovCloudCredentialOK %+v", 200, o.Payload) +} + +func (o *CreateAWSGovCloudCredentialOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/createAWSGovCloudCredential][%d] createAWSGovCloudCredentialOK %+v", 200, o.Payload) +} + +func (o *CreateAWSGovCloudCredentialOK) GetPayload() *models.CreateAWSGovCloudCredentialResponse { + return o.Payload +} + +func (o *CreateAWSGovCloudCredentialOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CreateAWSGovCloudCredentialResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateAWSGovCloudCredentialDefault creates a CreateAWSGovCloudCredentialDefault with default headers values +func NewCreateAWSGovCloudCredentialDefault(code int) *CreateAWSGovCloudCredentialDefault { + return &CreateAWSGovCloudCredentialDefault{ + _statusCode: code, + } +} + +/* +CreateAWSGovCloudCredentialDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type CreateAWSGovCloudCredentialDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this create a w s gov cloud credential default response has a 2xx status code +func (o *CreateAWSGovCloudCredentialDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this create a w s gov cloud credential default response has a 3xx status code +func (o *CreateAWSGovCloudCredentialDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this create a w s gov cloud credential default response has a 4xx status code +func (o *CreateAWSGovCloudCredentialDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this create a w s gov cloud credential default response has a 5xx status code +func (o *CreateAWSGovCloudCredentialDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this create a w s gov cloud credential default response a status code equal to that given +func (o *CreateAWSGovCloudCredentialDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the create a w s gov cloud credential default response +func (o *CreateAWSGovCloudCredentialDefault) Code() int { + return o._statusCode +} + +func (o *CreateAWSGovCloudCredentialDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/createAWSGovCloudCredential][%d] createAWSGovCloudCredential default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAWSGovCloudCredentialDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/createAWSGovCloudCredential][%d] createAWSGovCloudCredential default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAWSGovCloudCredentialDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *CreateAWSGovCloudCredentialDefault) 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/cdp-sdk-go/gen/environments/client/operations/create_a_w_s_gov_cloud_environment_parameters.go b/cdp-sdk-go/gen/environments/client/operations/create_a_w_s_gov_cloud_environment_parameters.go new file mode 100644 index 00000000..8cb2ca02 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/create_a_w_s_gov_cloud_environment_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewCreateAWSGovCloudEnvironmentParams creates a new CreateAWSGovCloudEnvironmentParams 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 NewCreateAWSGovCloudEnvironmentParams() *CreateAWSGovCloudEnvironmentParams { + return &CreateAWSGovCloudEnvironmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateAWSGovCloudEnvironmentParamsWithTimeout creates a new CreateAWSGovCloudEnvironmentParams object +// with the ability to set a timeout on a request. +func NewCreateAWSGovCloudEnvironmentParamsWithTimeout(timeout time.Duration) *CreateAWSGovCloudEnvironmentParams { + return &CreateAWSGovCloudEnvironmentParams{ + timeout: timeout, + } +} + +// NewCreateAWSGovCloudEnvironmentParamsWithContext creates a new CreateAWSGovCloudEnvironmentParams object +// with the ability to set a context for a request. +func NewCreateAWSGovCloudEnvironmentParamsWithContext(ctx context.Context) *CreateAWSGovCloudEnvironmentParams { + return &CreateAWSGovCloudEnvironmentParams{ + Context: ctx, + } +} + +// NewCreateAWSGovCloudEnvironmentParamsWithHTTPClient creates a new CreateAWSGovCloudEnvironmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateAWSGovCloudEnvironmentParamsWithHTTPClient(client *http.Client) *CreateAWSGovCloudEnvironmentParams { + return &CreateAWSGovCloudEnvironmentParams{ + HTTPClient: client, + } +} + +/* +CreateAWSGovCloudEnvironmentParams contains all the parameters to send to the API endpoint + + for the create a w s gov cloud environment operation. + + Typically these are written to a http.Request. +*/ +type CreateAWSGovCloudEnvironmentParams struct { + + // Input. + Input *models.CreateAWSGovCloudEnvironmentRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create a w s gov cloud environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAWSGovCloudEnvironmentParams) WithDefaults() *CreateAWSGovCloudEnvironmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create a w s gov cloud environment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateAWSGovCloudEnvironmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create a w s gov cloud environment params +func (o *CreateAWSGovCloudEnvironmentParams) WithTimeout(timeout time.Duration) *CreateAWSGovCloudEnvironmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create a w s gov cloud environment params +func (o *CreateAWSGovCloudEnvironmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create a w s gov cloud environment params +func (o *CreateAWSGovCloudEnvironmentParams) WithContext(ctx context.Context) *CreateAWSGovCloudEnvironmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create a w s gov cloud environment params +func (o *CreateAWSGovCloudEnvironmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create a w s gov cloud environment params +func (o *CreateAWSGovCloudEnvironmentParams) WithHTTPClient(client *http.Client) *CreateAWSGovCloudEnvironmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create a w s gov cloud environment params +func (o *CreateAWSGovCloudEnvironmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the create a w s gov cloud environment params +func (o *CreateAWSGovCloudEnvironmentParams) WithInput(input *models.CreateAWSGovCloudEnvironmentRequest) *CreateAWSGovCloudEnvironmentParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the create a w s gov cloud environment params +func (o *CreateAWSGovCloudEnvironmentParams) SetInput(input *models.CreateAWSGovCloudEnvironmentRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateAWSGovCloudEnvironmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/create_a_w_s_gov_cloud_environment_responses.go b/cdp-sdk-go/gen/environments/client/operations/create_a_w_s_gov_cloud_environment_responses.go new file mode 100644 index 00000000..4d9d9325 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/create_a_w_s_gov_cloud_environment_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// CreateAWSGovCloudEnvironmentReader is a Reader for the CreateAWSGovCloudEnvironment structure. +type CreateAWSGovCloudEnvironmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateAWSGovCloudEnvironmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateAWSGovCloudEnvironmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreateAWSGovCloudEnvironmentDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCreateAWSGovCloudEnvironmentOK creates a CreateAWSGovCloudEnvironmentOK with default headers values +func NewCreateAWSGovCloudEnvironmentOK() *CreateAWSGovCloudEnvironmentOK { + return &CreateAWSGovCloudEnvironmentOK{} +} + +/* +CreateAWSGovCloudEnvironmentOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type CreateAWSGovCloudEnvironmentOK struct { + Payload *models.CreateAWSGovCloudEnvironmentResponse +} + +// IsSuccess returns true when this create a w s gov cloud environment o k response has a 2xx status code +func (o *CreateAWSGovCloudEnvironmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create a w s gov cloud environment o k response has a 3xx status code +func (o *CreateAWSGovCloudEnvironmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create a w s gov cloud environment o k response has a 4xx status code +func (o *CreateAWSGovCloudEnvironmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create a w s gov cloud environment o k response has a 5xx status code +func (o *CreateAWSGovCloudEnvironmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create a w s gov cloud environment o k response a status code equal to that given +func (o *CreateAWSGovCloudEnvironmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create a w s gov cloud environment o k response +func (o *CreateAWSGovCloudEnvironmentOK) Code() int { + return 200 +} + +func (o *CreateAWSGovCloudEnvironmentOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/createAWSGovCloudEnvironment][%d] createAWSGovCloudEnvironmentOK %+v", 200, o.Payload) +} + +func (o *CreateAWSGovCloudEnvironmentOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/createAWSGovCloudEnvironment][%d] createAWSGovCloudEnvironmentOK %+v", 200, o.Payload) +} + +func (o *CreateAWSGovCloudEnvironmentOK) GetPayload() *models.CreateAWSGovCloudEnvironmentResponse { + return o.Payload +} + +func (o *CreateAWSGovCloudEnvironmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CreateAWSGovCloudEnvironmentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateAWSGovCloudEnvironmentDefault creates a CreateAWSGovCloudEnvironmentDefault with default headers values +func NewCreateAWSGovCloudEnvironmentDefault(code int) *CreateAWSGovCloudEnvironmentDefault { + return &CreateAWSGovCloudEnvironmentDefault{ + _statusCode: code, + } +} + +/* +CreateAWSGovCloudEnvironmentDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type CreateAWSGovCloudEnvironmentDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this create a w s gov cloud environment default response has a 2xx status code +func (o *CreateAWSGovCloudEnvironmentDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this create a w s gov cloud environment default response has a 3xx status code +func (o *CreateAWSGovCloudEnvironmentDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this create a w s gov cloud environment default response has a 4xx status code +func (o *CreateAWSGovCloudEnvironmentDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this create a w s gov cloud environment default response has a 5xx status code +func (o *CreateAWSGovCloudEnvironmentDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this create a w s gov cloud environment default response a status code equal to that given +func (o *CreateAWSGovCloudEnvironmentDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the create a w s gov cloud environment default response +func (o *CreateAWSGovCloudEnvironmentDefault) Code() int { + return o._statusCode +} + +func (o *CreateAWSGovCloudEnvironmentDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/createAWSGovCloudEnvironment][%d] createAWSGovCloudEnvironment default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAWSGovCloudEnvironmentDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/createAWSGovCloudEnvironment][%d] createAWSGovCloudEnvironment default %+v", o._statusCode, o.Payload) +} + +func (o *CreateAWSGovCloudEnvironmentDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *CreateAWSGovCloudEnvironmentDefault) 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/cdp-sdk-go/gen/environments/client/operations/get_azure_image_terms_policy_parameters.go b/cdp-sdk-go/gen/environments/client/operations/get_azure_image_terms_policy_parameters.go new file mode 100644 index 00000000..97fd17be --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/get_azure_image_terms_policy_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewGetAzureImageTermsPolicyParams creates a new GetAzureImageTermsPolicyParams 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 NewGetAzureImageTermsPolicyParams() *GetAzureImageTermsPolicyParams { + return &GetAzureImageTermsPolicyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetAzureImageTermsPolicyParamsWithTimeout creates a new GetAzureImageTermsPolicyParams object +// with the ability to set a timeout on a request. +func NewGetAzureImageTermsPolicyParamsWithTimeout(timeout time.Duration) *GetAzureImageTermsPolicyParams { + return &GetAzureImageTermsPolicyParams{ + timeout: timeout, + } +} + +// NewGetAzureImageTermsPolicyParamsWithContext creates a new GetAzureImageTermsPolicyParams object +// with the ability to set a context for a request. +func NewGetAzureImageTermsPolicyParamsWithContext(ctx context.Context) *GetAzureImageTermsPolicyParams { + return &GetAzureImageTermsPolicyParams{ + Context: ctx, + } +} + +// NewGetAzureImageTermsPolicyParamsWithHTTPClient creates a new GetAzureImageTermsPolicyParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetAzureImageTermsPolicyParamsWithHTTPClient(client *http.Client) *GetAzureImageTermsPolicyParams { + return &GetAzureImageTermsPolicyParams{ + HTTPClient: client, + } +} + +/* +GetAzureImageTermsPolicyParams contains all the parameters to send to the API endpoint + + for the get azure image terms policy operation. + + Typically these are written to a http.Request. +*/ +type GetAzureImageTermsPolicyParams struct { + + // Input. + Input models.GetAzureImageTermsPolicyRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get azure image terms policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAzureImageTermsPolicyParams) WithDefaults() *GetAzureImageTermsPolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get azure image terms policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetAzureImageTermsPolicyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get azure image terms policy params +func (o *GetAzureImageTermsPolicyParams) WithTimeout(timeout time.Duration) *GetAzureImageTermsPolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get azure image terms policy params +func (o *GetAzureImageTermsPolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get azure image terms policy params +func (o *GetAzureImageTermsPolicyParams) WithContext(ctx context.Context) *GetAzureImageTermsPolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get azure image terms policy params +func (o *GetAzureImageTermsPolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get azure image terms policy params +func (o *GetAzureImageTermsPolicyParams) WithHTTPClient(client *http.Client) *GetAzureImageTermsPolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get azure image terms policy params +func (o *GetAzureImageTermsPolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the get azure image terms policy params +func (o *GetAzureImageTermsPolicyParams) WithInput(input models.GetAzureImageTermsPolicyRequest) *GetAzureImageTermsPolicyParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the get azure image terms policy params +func (o *GetAzureImageTermsPolicyParams) SetInput(input models.GetAzureImageTermsPolicyRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAzureImageTermsPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/get_azure_image_terms_policy_responses.go b/cdp-sdk-go/gen/environments/client/operations/get_azure_image_terms_policy_responses.go new file mode 100644 index 00000000..5bb4ad05 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/get_azure_image_terms_policy_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// GetAzureImageTermsPolicyReader is a Reader for the GetAzureImageTermsPolicy structure. +type GetAzureImageTermsPolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAzureImageTermsPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetAzureImageTermsPolicyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetAzureImageTermsPolicyDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetAzureImageTermsPolicyOK creates a GetAzureImageTermsPolicyOK with default headers values +func NewGetAzureImageTermsPolicyOK() *GetAzureImageTermsPolicyOK { + return &GetAzureImageTermsPolicyOK{} +} + +/* +GetAzureImageTermsPolicyOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type GetAzureImageTermsPolicyOK struct { + Payload *models.GetAzureImageTermsPolicyResponse +} + +// IsSuccess returns true when this get azure image terms policy o k response has a 2xx status code +func (o *GetAzureImageTermsPolicyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get azure image terms policy o k response has a 3xx status code +func (o *GetAzureImageTermsPolicyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get azure image terms policy o k response has a 4xx status code +func (o *GetAzureImageTermsPolicyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get azure image terms policy o k response has a 5xx status code +func (o *GetAzureImageTermsPolicyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get azure image terms policy o k response a status code equal to that given +func (o *GetAzureImageTermsPolicyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get azure image terms policy o k response +func (o *GetAzureImageTermsPolicyOK) Code() int { + return 200 +} + +func (o *GetAzureImageTermsPolicyOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/getAzureImageTermsPolicy][%d] getAzureImageTermsPolicyOK %+v", 200, o.Payload) +} + +func (o *GetAzureImageTermsPolicyOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/getAzureImageTermsPolicy][%d] getAzureImageTermsPolicyOK %+v", 200, o.Payload) +} + +func (o *GetAzureImageTermsPolicyOK) GetPayload() *models.GetAzureImageTermsPolicyResponse { + return o.Payload +} + +func (o *GetAzureImageTermsPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetAzureImageTermsPolicyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetAzureImageTermsPolicyDefault creates a GetAzureImageTermsPolicyDefault with default headers values +func NewGetAzureImageTermsPolicyDefault(code int) *GetAzureImageTermsPolicyDefault { + return &GetAzureImageTermsPolicyDefault{ + _statusCode: code, + } +} + +/* +GetAzureImageTermsPolicyDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type GetAzureImageTermsPolicyDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this get azure image terms policy default response has a 2xx status code +func (o *GetAzureImageTermsPolicyDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get azure image terms policy default response has a 3xx status code +func (o *GetAzureImageTermsPolicyDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get azure image terms policy default response has a 4xx status code +func (o *GetAzureImageTermsPolicyDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get azure image terms policy default response has a 5xx status code +func (o *GetAzureImageTermsPolicyDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get azure image terms policy default response a status code equal to that given +func (o *GetAzureImageTermsPolicyDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the get azure image terms policy default response +func (o *GetAzureImageTermsPolicyDefault) Code() int { + return o._statusCode +} + +func (o *GetAzureImageTermsPolicyDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/getAzureImageTermsPolicy][%d] getAzureImageTermsPolicy default %+v", o._statusCode, o.Payload) +} + +func (o *GetAzureImageTermsPolicyDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/getAzureImageTermsPolicy][%d] getAzureImageTermsPolicy default %+v", o._statusCode, o.Payload) +} + +func (o *GetAzureImageTermsPolicyDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetAzureImageTermsPolicyDefault) 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/cdp-sdk-go/gen/environments/client/operations/get_gov_cloud_audit_credential_prerequisites_parameters.go b/cdp-sdk-go/gen/environments/client/operations/get_gov_cloud_audit_credential_prerequisites_parameters.go new file mode 100644 index 00000000..fa0e3f65 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/get_gov_cloud_audit_credential_prerequisites_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewGetGovCloudAuditCredentialPrerequisitesParams creates a new GetGovCloudAuditCredentialPrerequisitesParams 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 NewGetGovCloudAuditCredentialPrerequisitesParams() *GetGovCloudAuditCredentialPrerequisitesParams { + return &GetGovCloudAuditCredentialPrerequisitesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetGovCloudAuditCredentialPrerequisitesParamsWithTimeout creates a new GetGovCloudAuditCredentialPrerequisitesParams object +// with the ability to set a timeout on a request. +func NewGetGovCloudAuditCredentialPrerequisitesParamsWithTimeout(timeout time.Duration) *GetGovCloudAuditCredentialPrerequisitesParams { + return &GetGovCloudAuditCredentialPrerequisitesParams{ + timeout: timeout, + } +} + +// NewGetGovCloudAuditCredentialPrerequisitesParamsWithContext creates a new GetGovCloudAuditCredentialPrerequisitesParams object +// with the ability to set a context for a request. +func NewGetGovCloudAuditCredentialPrerequisitesParamsWithContext(ctx context.Context) *GetGovCloudAuditCredentialPrerequisitesParams { + return &GetGovCloudAuditCredentialPrerequisitesParams{ + Context: ctx, + } +} + +// NewGetGovCloudAuditCredentialPrerequisitesParamsWithHTTPClient creates a new GetGovCloudAuditCredentialPrerequisitesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetGovCloudAuditCredentialPrerequisitesParamsWithHTTPClient(client *http.Client) *GetGovCloudAuditCredentialPrerequisitesParams { + return &GetGovCloudAuditCredentialPrerequisitesParams{ + HTTPClient: client, + } +} + +/* +GetGovCloudAuditCredentialPrerequisitesParams contains all the parameters to send to the API endpoint + + for the get gov cloud audit credential prerequisites operation. + + Typically these are written to a http.Request. +*/ +type GetGovCloudAuditCredentialPrerequisitesParams struct { + + // Input. + Input *models.GetGovCloudAuditCredentialPrerequisitesRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get gov cloud audit credential prerequisites params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetGovCloudAuditCredentialPrerequisitesParams) WithDefaults() *GetGovCloudAuditCredentialPrerequisitesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get gov cloud audit credential prerequisites params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetGovCloudAuditCredentialPrerequisitesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get gov cloud audit credential prerequisites params +func (o *GetGovCloudAuditCredentialPrerequisitesParams) WithTimeout(timeout time.Duration) *GetGovCloudAuditCredentialPrerequisitesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get gov cloud audit credential prerequisites params +func (o *GetGovCloudAuditCredentialPrerequisitesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get gov cloud audit credential prerequisites params +func (o *GetGovCloudAuditCredentialPrerequisitesParams) WithContext(ctx context.Context) *GetGovCloudAuditCredentialPrerequisitesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get gov cloud audit credential prerequisites params +func (o *GetGovCloudAuditCredentialPrerequisitesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get gov cloud audit credential prerequisites params +func (o *GetGovCloudAuditCredentialPrerequisitesParams) WithHTTPClient(client *http.Client) *GetGovCloudAuditCredentialPrerequisitesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get gov cloud audit credential prerequisites params +func (o *GetGovCloudAuditCredentialPrerequisitesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the get gov cloud audit credential prerequisites params +func (o *GetGovCloudAuditCredentialPrerequisitesParams) WithInput(input *models.GetGovCloudAuditCredentialPrerequisitesRequest) *GetGovCloudAuditCredentialPrerequisitesParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the get gov cloud audit credential prerequisites params +func (o *GetGovCloudAuditCredentialPrerequisitesParams) SetInput(input *models.GetGovCloudAuditCredentialPrerequisitesRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *GetGovCloudAuditCredentialPrerequisitesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/get_gov_cloud_audit_credential_prerequisites_responses.go b/cdp-sdk-go/gen/environments/client/operations/get_gov_cloud_audit_credential_prerequisites_responses.go new file mode 100644 index 00000000..ab1b581d --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/get_gov_cloud_audit_credential_prerequisites_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// GetGovCloudAuditCredentialPrerequisitesReader is a Reader for the GetGovCloudAuditCredentialPrerequisites structure. +type GetGovCloudAuditCredentialPrerequisitesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetGovCloudAuditCredentialPrerequisitesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetGovCloudAuditCredentialPrerequisitesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetGovCloudAuditCredentialPrerequisitesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetGovCloudAuditCredentialPrerequisitesOK creates a GetGovCloudAuditCredentialPrerequisitesOK with default headers values +func NewGetGovCloudAuditCredentialPrerequisitesOK() *GetGovCloudAuditCredentialPrerequisitesOK { + return &GetGovCloudAuditCredentialPrerequisitesOK{} +} + +/* +GetGovCloudAuditCredentialPrerequisitesOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type GetGovCloudAuditCredentialPrerequisitesOK struct { + Payload *models.GetGovCloudAuditCredentialPrerequisitesResponse +} + +// IsSuccess returns true when this get gov cloud audit credential prerequisites o k response has a 2xx status code +func (o *GetGovCloudAuditCredentialPrerequisitesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get gov cloud audit credential prerequisites o k response has a 3xx status code +func (o *GetGovCloudAuditCredentialPrerequisitesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get gov cloud audit credential prerequisites o k response has a 4xx status code +func (o *GetGovCloudAuditCredentialPrerequisitesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get gov cloud audit credential prerequisites o k response has a 5xx status code +func (o *GetGovCloudAuditCredentialPrerequisitesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get gov cloud audit credential prerequisites o k response a status code equal to that given +func (o *GetGovCloudAuditCredentialPrerequisitesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get gov cloud audit credential prerequisites o k response +func (o *GetGovCloudAuditCredentialPrerequisitesOK) Code() int { + return 200 +} + +func (o *GetGovCloudAuditCredentialPrerequisitesOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/getGovCloudAuditCredentialPrerequisites][%d] getGovCloudAuditCredentialPrerequisitesOK %+v", 200, o.Payload) +} + +func (o *GetGovCloudAuditCredentialPrerequisitesOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/getGovCloudAuditCredentialPrerequisites][%d] getGovCloudAuditCredentialPrerequisitesOK %+v", 200, o.Payload) +} + +func (o *GetGovCloudAuditCredentialPrerequisitesOK) GetPayload() *models.GetGovCloudAuditCredentialPrerequisitesResponse { + return o.Payload +} + +func (o *GetGovCloudAuditCredentialPrerequisitesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetGovCloudAuditCredentialPrerequisitesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGovCloudAuditCredentialPrerequisitesDefault creates a GetGovCloudAuditCredentialPrerequisitesDefault with default headers values +func NewGetGovCloudAuditCredentialPrerequisitesDefault(code int) *GetGovCloudAuditCredentialPrerequisitesDefault { + return &GetGovCloudAuditCredentialPrerequisitesDefault{ + _statusCode: code, + } +} + +/* +GetGovCloudAuditCredentialPrerequisitesDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type GetGovCloudAuditCredentialPrerequisitesDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this get gov cloud audit credential prerequisites default response has a 2xx status code +func (o *GetGovCloudAuditCredentialPrerequisitesDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get gov cloud audit credential prerequisites default response has a 3xx status code +func (o *GetGovCloudAuditCredentialPrerequisitesDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get gov cloud audit credential prerequisites default response has a 4xx status code +func (o *GetGovCloudAuditCredentialPrerequisitesDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get gov cloud audit credential prerequisites default response has a 5xx status code +func (o *GetGovCloudAuditCredentialPrerequisitesDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get gov cloud audit credential prerequisites default response a status code equal to that given +func (o *GetGovCloudAuditCredentialPrerequisitesDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the get gov cloud audit credential prerequisites default response +func (o *GetGovCloudAuditCredentialPrerequisitesDefault) Code() int { + return o._statusCode +} + +func (o *GetGovCloudAuditCredentialPrerequisitesDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/getGovCloudAuditCredentialPrerequisites][%d] getGovCloudAuditCredentialPrerequisites default %+v", o._statusCode, o.Payload) +} + +func (o *GetGovCloudAuditCredentialPrerequisitesDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/getGovCloudAuditCredentialPrerequisites][%d] getGovCloudAuditCredentialPrerequisites default %+v", o._statusCode, o.Payload) +} + +func (o *GetGovCloudAuditCredentialPrerequisitesDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetGovCloudAuditCredentialPrerequisitesDefault) 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/cdp-sdk-go/gen/environments/client/operations/get_gov_cloud_credential_prerequisites_parameters.go b/cdp-sdk-go/gen/environments/client/operations/get_gov_cloud_credential_prerequisites_parameters.go new file mode 100644 index 00000000..c7efae8c --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/get_gov_cloud_credential_prerequisites_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewGetGovCloudCredentialPrerequisitesParams creates a new GetGovCloudCredentialPrerequisitesParams 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 NewGetGovCloudCredentialPrerequisitesParams() *GetGovCloudCredentialPrerequisitesParams { + return &GetGovCloudCredentialPrerequisitesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetGovCloudCredentialPrerequisitesParamsWithTimeout creates a new GetGovCloudCredentialPrerequisitesParams object +// with the ability to set a timeout on a request. +func NewGetGovCloudCredentialPrerequisitesParamsWithTimeout(timeout time.Duration) *GetGovCloudCredentialPrerequisitesParams { + return &GetGovCloudCredentialPrerequisitesParams{ + timeout: timeout, + } +} + +// NewGetGovCloudCredentialPrerequisitesParamsWithContext creates a new GetGovCloudCredentialPrerequisitesParams object +// with the ability to set a context for a request. +func NewGetGovCloudCredentialPrerequisitesParamsWithContext(ctx context.Context) *GetGovCloudCredentialPrerequisitesParams { + return &GetGovCloudCredentialPrerequisitesParams{ + Context: ctx, + } +} + +// NewGetGovCloudCredentialPrerequisitesParamsWithHTTPClient creates a new GetGovCloudCredentialPrerequisitesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetGovCloudCredentialPrerequisitesParamsWithHTTPClient(client *http.Client) *GetGovCloudCredentialPrerequisitesParams { + return &GetGovCloudCredentialPrerequisitesParams{ + HTTPClient: client, + } +} + +/* +GetGovCloudCredentialPrerequisitesParams contains all the parameters to send to the API endpoint + + for the get gov cloud credential prerequisites operation. + + Typically these are written to a http.Request. +*/ +type GetGovCloudCredentialPrerequisitesParams struct { + + // Input. + Input *models.GetGovCloudCredentialPrerequisitesRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get gov cloud credential prerequisites params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetGovCloudCredentialPrerequisitesParams) WithDefaults() *GetGovCloudCredentialPrerequisitesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get gov cloud credential prerequisites params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetGovCloudCredentialPrerequisitesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get gov cloud credential prerequisites params +func (o *GetGovCloudCredentialPrerequisitesParams) WithTimeout(timeout time.Duration) *GetGovCloudCredentialPrerequisitesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get gov cloud credential prerequisites params +func (o *GetGovCloudCredentialPrerequisitesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get gov cloud credential prerequisites params +func (o *GetGovCloudCredentialPrerequisitesParams) WithContext(ctx context.Context) *GetGovCloudCredentialPrerequisitesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get gov cloud credential prerequisites params +func (o *GetGovCloudCredentialPrerequisitesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get gov cloud credential prerequisites params +func (o *GetGovCloudCredentialPrerequisitesParams) WithHTTPClient(client *http.Client) *GetGovCloudCredentialPrerequisitesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get gov cloud credential prerequisites params +func (o *GetGovCloudCredentialPrerequisitesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the get gov cloud credential prerequisites params +func (o *GetGovCloudCredentialPrerequisitesParams) WithInput(input *models.GetGovCloudCredentialPrerequisitesRequest) *GetGovCloudCredentialPrerequisitesParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the get gov cloud credential prerequisites params +func (o *GetGovCloudCredentialPrerequisitesParams) SetInput(input *models.GetGovCloudCredentialPrerequisitesRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *GetGovCloudCredentialPrerequisitesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/get_gov_cloud_credential_prerequisites_responses.go b/cdp-sdk-go/gen/environments/client/operations/get_gov_cloud_credential_prerequisites_responses.go new file mode 100644 index 00000000..a15717a2 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/get_gov_cloud_credential_prerequisites_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// GetGovCloudCredentialPrerequisitesReader is a Reader for the GetGovCloudCredentialPrerequisites structure. +type GetGovCloudCredentialPrerequisitesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetGovCloudCredentialPrerequisitesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetGovCloudCredentialPrerequisitesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetGovCloudCredentialPrerequisitesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetGovCloudCredentialPrerequisitesOK creates a GetGovCloudCredentialPrerequisitesOK with default headers values +func NewGetGovCloudCredentialPrerequisitesOK() *GetGovCloudCredentialPrerequisitesOK { + return &GetGovCloudCredentialPrerequisitesOK{} +} + +/* +GetGovCloudCredentialPrerequisitesOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type GetGovCloudCredentialPrerequisitesOK struct { + Payload *models.GetGovCloudCredentialPrerequisitesResponse +} + +// IsSuccess returns true when this get gov cloud credential prerequisites o k response has a 2xx status code +func (o *GetGovCloudCredentialPrerequisitesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get gov cloud credential prerequisites o k response has a 3xx status code +func (o *GetGovCloudCredentialPrerequisitesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get gov cloud credential prerequisites o k response has a 4xx status code +func (o *GetGovCloudCredentialPrerequisitesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get gov cloud credential prerequisites o k response has a 5xx status code +func (o *GetGovCloudCredentialPrerequisitesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get gov cloud credential prerequisites o k response a status code equal to that given +func (o *GetGovCloudCredentialPrerequisitesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get gov cloud credential prerequisites o k response +func (o *GetGovCloudCredentialPrerequisitesOK) Code() int { + return 200 +} + +func (o *GetGovCloudCredentialPrerequisitesOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/getGovCloudCredentialPrerequisites][%d] getGovCloudCredentialPrerequisitesOK %+v", 200, o.Payload) +} + +func (o *GetGovCloudCredentialPrerequisitesOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/getGovCloudCredentialPrerequisites][%d] getGovCloudCredentialPrerequisitesOK %+v", 200, o.Payload) +} + +func (o *GetGovCloudCredentialPrerequisitesOK) GetPayload() *models.GetGovCloudCredentialPrerequisitesResponse { + return o.Payload +} + +func (o *GetGovCloudCredentialPrerequisitesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetGovCloudCredentialPrerequisitesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetGovCloudCredentialPrerequisitesDefault creates a GetGovCloudCredentialPrerequisitesDefault with default headers values +func NewGetGovCloudCredentialPrerequisitesDefault(code int) *GetGovCloudCredentialPrerequisitesDefault { + return &GetGovCloudCredentialPrerequisitesDefault{ + _statusCode: code, + } +} + +/* +GetGovCloudCredentialPrerequisitesDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type GetGovCloudCredentialPrerequisitesDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this get gov cloud credential prerequisites default response has a 2xx status code +func (o *GetGovCloudCredentialPrerequisitesDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get gov cloud credential prerequisites default response has a 3xx status code +func (o *GetGovCloudCredentialPrerequisitesDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get gov cloud credential prerequisites default response has a 4xx status code +func (o *GetGovCloudCredentialPrerequisitesDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get gov cloud credential prerequisites default response has a 5xx status code +func (o *GetGovCloudCredentialPrerequisitesDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get gov cloud credential prerequisites default response a status code equal to that given +func (o *GetGovCloudCredentialPrerequisitesDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the get gov cloud credential prerequisites default response +func (o *GetGovCloudCredentialPrerequisitesDefault) Code() int { + return o._statusCode +} + +func (o *GetGovCloudCredentialPrerequisitesDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/getGovCloudCredentialPrerequisites][%d] getGovCloudCredentialPrerequisites default %+v", o._statusCode, o.Payload) +} + +func (o *GetGovCloudCredentialPrerequisitesDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/getGovCloudCredentialPrerequisites][%d] getGovCloudCredentialPrerequisites default %+v", o._statusCode, o.Payload) +} + +func (o *GetGovCloudCredentialPrerequisitesDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetGovCloudCredentialPrerequisitesDefault) 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/cdp-sdk-go/gen/environments/client/operations/get_operation_parameters.go b/cdp-sdk-go/gen/environments/client/operations/get_operation_parameters.go new file mode 100644 index 00000000..0f8bc385 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/get_operation_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewGetOperationParams creates a new GetOperationParams 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 NewGetOperationParams() *GetOperationParams { + return &GetOperationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetOperationParamsWithTimeout creates a new GetOperationParams object +// with the ability to set a timeout on a request. +func NewGetOperationParamsWithTimeout(timeout time.Duration) *GetOperationParams { + return &GetOperationParams{ + timeout: timeout, + } +} + +// NewGetOperationParamsWithContext creates a new GetOperationParams object +// with the ability to set a context for a request. +func NewGetOperationParamsWithContext(ctx context.Context) *GetOperationParams { + return &GetOperationParams{ + Context: ctx, + } +} + +// NewGetOperationParamsWithHTTPClient creates a new GetOperationParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetOperationParamsWithHTTPClient(client *http.Client) *GetOperationParams { + return &GetOperationParams{ + HTTPClient: client, + } +} + +/* +GetOperationParams contains all the parameters to send to the API endpoint + + for the get operation operation. + + Typically these are written to a http.Request. +*/ +type GetOperationParams struct { + + // Input. + Input *models.GetOperationRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get operation params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOperationParams) WithDefaults() *GetOperationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get operation params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetOperationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get operation params +func (o *GetOperationParams) WithTimeout(timeout time.Duration) *GetOperationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get operation params +func (o *GetOperationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get operation params +func (o *GetOperationParams) WithContext(ctx context.Context) *GetOperationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get operation params +func (o *GetOperationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get operation params +func (o *GetOperationParams) WithHTTPClient(client *http.Client) *GetOperationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get operation params +func (o *GetOperationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the get operation params +func (o *GetOperationParams) WithInput(input *models.GetOperationRequest) *GetOperationParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the get operation params +func (o *GetOperationParams) SetInput(input *models.GetOperationRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *GetOperationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/get_operation_responses.go b/cdp-sdk-go/gen/environments/client/operations/get_operation_responses.go new file mode 100644 index 00000000..05894bef --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/get_operation_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// GetOperationReader is a Reader for the GetOperation structure. +type GetOperationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOperationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetOperationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetOperationDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetOperationOK creates a GetOperationOK with default headers values +func NewGetOperationOK() *GetOperationOK { + return &GetOperationOK{} +} + +/* +GetOperationOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type GetOperationOK struct { + Payload *models.GetOperationResponse +} + +// IsSuccess returns true when this get operation o k response has a 2xx status code +func (o *GetOperationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get operation o k response has a 3xx status code +func (o *GetOperationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get operation o k response has a 4xx status code +func (o *GetOperationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get operation o k response has a 5xx status code +func (o *GetOperationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get operation o k response a status code equal to that given +func (o *GetOperationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get operation o k response +func (o *GetOperationOK) Code() int { + return 200 +} + +func (o *GetOperationOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/getOperation][%d] getOperationOK %+v", 200, o.Payload) +} + +func (o *GetOperationOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/getOperation][%d] getOperationOK %+v", 200, o.Payload) +} + +func (o *GetOperationOK) GetPayload() *models.GetOperationResponse { + return o.Payload +} + +func (o *GetOperationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetOperationResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOperationDefault creates a GetOperationDefault with default headers values +func NewGetOperationDefault(code int) *GetOperationDefault { + return &GetOperationDefault{ + _statusCode: code, + } +} + +/* +GetOperationDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type GetOperationDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this get operation default response has a 2xx status code +func (o *GetOperationDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get operation default response has a 3xx status code +func (o *GetOperationDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get operation default response has a 4xx status code +func (o *GetOperationDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get operation default response has a 5xx status code +func (o *GetOperationDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get operation default response a status code equal to that given +func (o *GetOperationDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the get operation default response +func (o *GetOperationDefault) Code() int { + return o._statusCode +} + +func (o *GetOperationDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/getOperation][%d] getOperation default %+v", o._statusCode, o.Payload) +} + +func (o *GetOperationDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/getOperation][%d] getOperation default %+v", o._statusCode, o.Payload) +} + +func (o *GetOperationDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetOperationDefault) 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/cdp-sdk-go/gen/environments/client/operations/list_connected_data_services_parameters.go b/cdp-sdk-go/gen/environments/client/operations/list_connected_data_services_parameters.go new file mode 100644 index 00000000..8dab2faa --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/list_connected_data_services_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewListConnectedDataServicesParams creates a new ListConnectedDataServicesParams 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 NewListConnectedDataServicesParams() *ListConnectedDataServicesParams { + return &ListConnectedDataServicesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListConnectedDataServicesParamsWithTimeout creates a new ListConnectedDataServicesParams object +// with the ability to set a timeout on a request. +func NewListConnectedDataServicesParamsWithTimeout(timeout time.Duration) *ListConnectedDataServicesParams { + return &ListConnectedDataServicesParams{ + timeout: timeout, + } +} + +// NewListConnectedDataServicesParamsWithContext creates a new ListConnectedDataServicesParams object +// with the ability to set a context for a request. +func NewListConnectedDataServicesParamsWithContext(ctx context.Context) *ListConnectedDataServicesParams { + return &ListConnectedDataServicesParams{ + Context: ctx, + } +} + +// NewListConnectedDataServicesParamsWithHTTPClient creates a new ListConnectedDataServicesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListConnectedDataServicesParamsWithHTTPClient(client *http.Client) *ListConnectedDataServicesParams { + return &ListConnectedDataServicesParams{ + HTTPClient: client, + } +} + +/* +ListConnectedDataServicesParams contains all the parameters to send to the API endpoint + + for the list connected data services operation. + + Typically these are written to a http.Request. +*/ +type ListConnectedDataServicesParams struct { + + // Input. + Input *models.ListConnectedDataServicesRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list connected data services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListConnectedDataServicesParams) WithDefaults() *ListConnectedDataServicesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list connected data services params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListConnectedDataServicesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list connected data services params +func (o *ListConnectedDataServicesParams) WithTimeout(timeout time.Duration) *ListConnectedDataServicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list connected data services params +func (o *ListConnectedDataServicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list connected data services params +func (o *ListConnectedDataServicesParams) WithContext(ctx context.Context) *ListConnectedDataServicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list connected data services params +func (o *ListConnectedDataServicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list connected data services params +func (o *ListConnectedDataServicesParams) WithHTTPClient(client *http.Client) *ListConnectedDataServicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list connected data services params +func (o *ListConnectedDataServicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the list connected data services params +func (o *ListConnectedDataServicesParams) WithInput(input *models.ListConnectedDataServicesRequest) *ListConnectedDataServicesParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the list connected data services params +func (o *ListConnectedDataServicesParams) SetInput(input *models.ListConnectedDataServicesRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *ListConnectedDataServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/list_connected_data_services_responses.go b/cdp-sdk-go/gen/environments/client/operations/list_connected_data_services_responses.go new file mode 100644 index 00000000..42921223 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/list_connected_data_services_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// ListConnectedDataServicesReader is a Reader for the ListConnectedDataServices structure. +type ListConnectedDataServicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListConnectedDataServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListConnectedDataServicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListConnectedDataServicesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewListConnectedDataServicesOK creates a ListConnectedDataServicesOK with default headers values +func NewListConnectedDataServicesOK() *ListConnectedDataServicesOK { + return &ListConnectedDataServicesOK{} +} + +/* +ListConnectedDataServicesOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type ListConnectedDataServicesOK struct { + Payload *models.ListConnectedDataServicesResponse +} + +// IsSuccess returns true when this list connected data services o k response has a 2xx status code +func (o *ListConnectedDataServicesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list connected data services o k response has a 3xx status code +func (o *ListConnectedDataServicesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list connected data services o k response has a 4xx status code +func (o *ListConnectedDataServicesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list connected data services o k response has a 5xx status code +func (o *ListConnectedDataServicesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list connected data services o k response a status code equal to that given +func (o *ListConnectedDataServicesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list connected data services o k response +func (o *ListConnectedDataServicesOK) Code() int { + return 200 +} + +func (o *ListConnectedDataServicesOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/listConnectedDataServices][%d] listConnectedDataServicesOK %+v", 200, o.Payload) +} + +func (o *ListConnectedDataServicesOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/listConnectedDataServices][%d] listConnectedDataServicesOK %+v", 200, o.Payload) +} + +func (o *ListConnectedDataServicesOK) GetPayload() *models.ListConnectedDataServicesResponse { + return o.Payload +} + +func (o *ListConnectedDataServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ListConnectedDataServicesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListConnectedDataServicesDefault creates a ListConnectedDataServicesDefault with default headers values +func NewListConnectedDataServicesDefault(code int) *ListConnectedDataServicesDefault { + return &ListConnectedDataServicesDefault{ + _statusCode: code, + } +} + +/* +ListConnectedDataServicesDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type ListConnectedDataServicesDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this list connected data services default response has a 2xx status code +func (o *ListConnectedDataServicesDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this list connected data services default response has a 3xx status code +func (o *ListConnectedDataServicesDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this list connected data services default response has a 4xx status code +func (o *ListConnectedDataServicesDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this list connected data services default response has a 5xx status code +func (o *ListConnectedDataServicesDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this list connected data services default response a status code equal to that given +func (o *ListConnectedDataServicesDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the list connected data services default response +func (o *ListConnectedDataServicesDefault) Code() int { + return o._statusCode +} + +func (o *ListConnectedDataServicesDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/listConnectedDataServices][%d] listConnectedDataServices default %+v", o._statusCode, o.Payload) +} + +func (o *ListConnectedDataServicesDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/listConnectedDataServices][%d] listConnectedDataServices default %+v", o._statusCode, o.Payload) +} + +func (o *ListConnectedDataServicesDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ListConnectedDataServicesDefault) 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/cdp-sdk-go/gen/environments/client/operations/operations_client.go b/cdp-sdk-go/gen/environments/client/operations/operations_client.go index e1a7a8fc..bde62bef 100644 --- a/cdp-sdk-go/gen/environments/client/operations/operations_client.go +++ b/cdp-sdk-go/gen/environments/client/operations/operations_client.go @@ -46,6 +46,10 @@ type ClientService interface { CreateAWSEnvironment(params *CreateAWSEnvironmentParams, opts ...ClientOption) (*CreateAWSEnvironmentOK, error) + CreateAWSGovCloudCredential(params *CreateAWSGovCloudCredentialParams, opts ...ClientOption) (*CreateAWSGovCloudCredentialOK, error) + + CreateAWSGovCloudEnvironment(params *CreateAWSGovCloudEnvironmentParams, opts ...ClientOption) (*CreateAWSGovCloudEnvironmentOK, error) + CreateAzureCredential(params *CreateAzureCredentialParams, opts ...ClientOption) (*CreateAzureCredentialOK, error) CreateAzureEnvironment(params *CreateAzureEnvironmentParams, opts ...ClientOption) (*CreateAzureEnvironmentOK, error) @@ -82,6 +86,8 @@ type ClientService interface { GetAutomatedSyncEnvironmentStatus(params *GetAutomatedSyncEnvironmentStatusParams, opts ...ClientOption) (*GetAutomatedSyncEnvironmentStatusOK, error) + GetAzureImageTermsPolicy(params *GetAzureImageTermsPolicyParams, opts ...ClientOption) (*GetAzureImageTermsPolicyOK, error) + GetCredentialPrerequisites(params *GetCredentialPrerequisitesParams, opts ...ClientOption) (*GetCredentialPrerequisitesOK, error) GetEnvironmentSetting(params *GetEnvironmentSettingParams, opts ...ClientOption) (*GetEnvironmentSettingOK, error) @@ -92,18 +98,26 @@ type ClientService interface { GetFreeipaStatus(params *GetFreeipaStatusParams, opts ...ClientOption) (*GetFreeipaStatusOK, error) + GetGovCloudAuditCredentialPrerequisites(params *GetGovCloudAuditCredentialPrerequisitesParams, opts ...ClientOption) (*GetGovCloudAuditCredentialPrerequisitesOK, error) + + GetGovCloudCredentialPrerequisites(params *GetGovCloudCredentialPrerequisitesParams, opts ...ClientOption) (*GetGovCloudCredentialPrerequisitesOK, error) + GetIDBrokerMappings(params *GetIDBrokerMappingsParams, opts ...ClientOption) (*GetIDBrokerMappingsOK, error) GetIDBrokerMappingsSyncStatus(params *GetIDBrokerMappingsSyncStatusParams, opts ...ClientOption) (*GetIDBrokerMappingsSyncStatusOK, error) GetKeytab(params *GetKeytabParams, opts ...ClientOption) (*GetKeytabOK, error) + GetOperation(params *GetOperationParams, opts ...ClientOption) (*GetOperationOK, error) + GetRepairFreeipaStatus(params *GetRepairFreeipaStatusParams, opts ...ClientOption) (*GetRepairFreeipaStatusOK, error) GetRootCertificate(params *GetRootCertificateParams, opts ...ClientOption) (*GetRootCertificateOK, error) ListAuditCredentials(params *ListAuditCredentialsParams, opts ...ClientOption) (*ListAuditCredentialsOK, error) + ListConnectedDataServices(params *ListConnectedDataServicesParams, opts ...ClientOption) (*ListConnectedDataServicesOK, error) + ListCredentials(params *ListCredentialsParams, opts ...ClientOption) (*ListCredentialsOK, error) ListEnvironments(params *ListEnvironmentsParams, opts ...ClientOption) (*ListEnvironmentsOK, error) @@ -120,6 +134,8 @@ type ClientService interface { SetAWSAuditCredential(params *SetAWSAuditCredentialParams, opts ...ClientOption) (*SetAWSAuditCredentialOK, error) + SetAWSGovCloudAuditCredential(params *SetAWSGovCloudAuditCredentialParams, opts ...ClientOption) (*SetAWSGovCloudAuditCredentialOK, error) + SetAccountTelemetry(params *SetAccountTelemetryParams, opts ...ClientOption) (*SetAccountTelemetryOK, error) SetAzureAuditCredential(params *SetAzureAuditCredentialParams, opts ...ClientOption) (*SetAzureAuditCredentialOK, error) @@ -130,6 +146,8 @@ type ClientService interface { SetEnvironmentSetting(params *SetEnvironmentSettingParams, opts ...ClientOption) (*SetEnvironmentSettingOK, error) + SetGCPAuditCredential(params *SetGCPAuditCredentialParams, opts ...ClientOption) (*SetGCPAuditCredentialOK, error) + SetIDBrokerMappings(params *SetIDBrokerMappingsParams, opts ...ClientOption) (*SetIDBrokerMappingsOK, error) SetPassword(params *SetPasswordParams, opts ...ClientOption) (*SetPasswordOK, error) @@ -158,12 +176,22 @@ type ClientService interface { UpdateAzureCredential(params *UpdateAzureCredentialParams, opts ...ClientOption) (*UpdateAzureCredentialOK, error) + UpdateAzureDatabaseResources(params *UpdateAzureDatabaseResourcesParams, opts ...ClientOption) (*UpdateAzureDatabaseResourcesOK, error) + UpdateAzureEncryptionResources(params *UpdateAzureEncryptionResourcesParams, opts ...ClientOption) (*UpdateAzureEncryptionResourcesOK, error) + UpdateAzureImageTermsPolicy(params *UpdateAzureImageTermsPolicyParams, opts ...ClientOption) (*UpdateAzureImageTermsPolicyOK, error) + + UpdateDataServiceResources(params *UpdateDataServiceResourcesParams, opts ...ClientOption) (*UpdateDataServiceResourcesOK, error) + UpdateOrchestratorState(params *UpdateOrchestratorStateParams, opts ...ClientOption) (*UpdateOrchestratorStateOK, error) UpdateProxyConfig(params *UpdateProxyConfigParams, opts ...ClientOption) (*UpdateProxyConfigOK, error) + UpdateSecurityAccess(params *UpdateSecurityAccessParams, opts ...ClientOption) (*UpdateSecurityAccessOK, error) + + UpdateSSHKey(params *UpdateSSHKeyParams, opts ...ClientOption) (*UpdateSSHKeyOK, error) + UpdateSubnet(params *UpdateSubnetParams, opts ...ClientOption) (*UpdateSubnetOK, error) UpgradeCcm(params *UpgradeCcmParams, opts ...ClientOption) (*UpgradeCcmOK, error) @@ -172,6 +200,10 @@ type ClientService interface { UpscaleFreeipa(params *UpscaleFreeipaParams, opts ...ClientOption) (*UpscaleFreeipaOK, error) + ValidateAwsCloudStorage(params *ValidateAwsCloudStorageParams, opts ...ClientOption) (*ValidateAwsCloudStorageOK, error) + + ValidateAzureCloudStorage(params *ValidateAzureCloudStorageParams, opts ...ClientOption) (*ValidateAzureCloudStorageOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -526,6 +558,84 @@ func (a *Client) CreateAWSEnvironment(params *CreateAWSEnvironmentParams, opts . return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +CreateAWSGovCloudCredential creates a new a w s credential for gov cloud that can be attatched to an environment the credential is used for authorization to provision resources such as compute instances within your cloud provider account + +Creates a new AWS credential for GovCloud. +*/ +func (a *Client) CreateAWSGovCloudCredential(params *CreateAWSGovCloudCredentialParams, opts ...ClientOption) (*CreateAWSGovCloudCredentialOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateAWSGovCloudCredentialParams() + } + op := &runtime.ClientOperation{ + ID: "createAWSGovCloudCredential", + Method: "POST", + PathPattern: "/api/v1/environments2/createAWSGovCloudCredential", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateAWSGovCloudCredentialReader{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.(*CreateAWSGovCloudCredentialOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateAWSGovCloudCredentialDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +CreateAWSGovCloudEnvironment creates a new a w s gov cloud environment by providing the cloud provider access and network information a free IP a server will be automatically provisioned when an environment is created + +Creates a new AWS GovCloud environment. +*/ +func (a *Client) CreateAWSGovCloudEnvironment(params *CreateAWSGovCloudEnvironmentParams, opts ...ClientOption) (*CreateAWSGovCloudEnvironmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateAWSGovCloudEnvironmentParams() + } + op := &runtime.ClientOperation{ + ID: "createAWSGovCloudEnvironment", + Method: "POST", + PathPattern: "/api/v1/environments2/createAWSGovCloudEnvironment", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateAWSGovCloudEnvironmentReader{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.(*CreateAWSGovCloudEnvironmentOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateAWSGovCloudEnvironmentDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* CreateAzureCredential creates a new azure credential that can be attached to an environment the credential is used for authorization to provision resources such as compute instances within your cloud provider account @@ -1228,6 +1338,45 @@ func (a *Client) GetAutomatedSyncEnvironmentStatus(params *GetAutomatedSyncEnvir return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +GetAzureImageTermsPolicy gets account level azure marketplace image policy c d p is capable to automatically accept azure marketplace image terms during cluster deployment you can use this setting in your account to opt in or opt out this behaviour + +Gets account level Azure Marketplace image policy. CDP is capable to automatically accept Azure Marketplace image terms during cluster deployment. You can use this setting in your account to opt in or opt out this behaviour. +*/ +func (a *Client) GetAzureImageTermsPolicy(params *GetAzureImageTermsPolicyParams, opts ...ClientOption) (*GetAzureImageTermsPolicyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAzureImageTermsPolicyParams() + } + op := &runtime.ClientOperation{ + ID: "getAzureImageTermsPolicy", + Method: "POST", + PathPattern: "/api/v1/environments2/getAzureImageTermsPolicy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetAzureImageTermsPolicyReader{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.(*GetAzureImageTermsPolicyOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetAzureImageTermsPolicyDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* GetCredentialPrerequisites this API provides the credential prerequisites for the given cloud provider @@ -1423,6 +1572,84 @@ func (a *Client) GetFreeipaStatus(params *GetFreeipaStatusParams, opts ...Client return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +GetGovCloudAuditCredentialPrerequisites this API provides the audit credential prerequisites for gov cloud for the enabled providers + +Provides the the audit credential prerequisites for GovCloud for the enabled providers. +*/ +func (a *Client) GetGovCloudAuditCredentialPrerequisites(params *GetGovCloudAuditCredentialPrerequisitesParams, opts ...ClientOption) (*GetGovCloudAuditCredentialPrerequisitesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetGovCloudAuditCredentialPrerequisitesParams() + } + op := &runtime.ClientOperation{ + ID: "getGovCloudAuditCredentialPrerequisites", + Method: "POST", + PathPattern: "/api/v1/environments2/getGovCloudAuditCredentialPrerequisites", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetGovCloudAuditCredentialPrerequisitesReader{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.(*GetGovCloudAuditCredentialPrerequisitesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetGovCloudAuditCredentialPrerequisitesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GetGovCloudCredentialPrerequisites this API provides the credential prerequisites for gov cloud for the enabled providers + +Provides the the credential prerequisites for GovCloud for the enabled providers. +*/ +func (a *Client) GetGovCloudCredentialPrerequisites(params *GetGovCloudCredentialPrerequisitesParams, opts ...ClientOption) (*GetGovCloudCredentialPrerequisitesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetGovCloudCredentialPrerequisitesParams() + } + op := &runtime.ClientOperation{ + ID: "getGovCloudCredentialPrerequisites", + Method: "POST", + PathPattern: "/api/v1/environments2/getGovCloudCredentialPrerequisites", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetGovCloudCredentialPrerequisitesReader{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.(*GetGovCloudCredentialPrerequisitesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetGovCloudCredentialPrerequisitesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* GetIDBrokerMappings gets all ID broker mappings for an environment @@ -1540,6 +1767,45 @@ func (a *Client) GetKeytab(params *GetKeytabParams, opts ...ClientOption) (*GetK return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +GetOperation gets the latest in progress or finished operation for the environment resource + +Get the latest (in progress or finished) operation for the environment resource. +*/ +func (a *Client) GetOperation(params *GetOperationParams, opts ...ClientOption) (*GetOperationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetOperationParams() + } + op := &runtime.ClientOperation{ + ID: "getOperation", + Method: "POST", + PathPattern: "/api/v1/environments2/getOperation", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetOperationReader{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.(*GetOperationOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetOperationDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* GetRepairFreeipaStatus returns status of the repair operation for the operation id @@ -1657,6 +1923,45 @@ func (a *Client) ListAuditCredentials(params *ListAuditCredentialsParams, opts . return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ListConnectedDataServices returns the list of data services and their cluster names that are attached the given environment + +Returns the list of Data Services and their cluster names that are attached to the given environment. +*/ +func (a *Client) ListConnectedDataServices(params *ListConnectedDataServicesParams, opts ...ClientOption) (*ListConnectedDataServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListConnectedDataServicesParams() + } + op := &runtime.ClientOperation{ + ID: "listConnectedDataServices", + Method: "POST", + PathPattern: "/api/v1/environments2/listConnectedDataServices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListConnectedDataServicesReader{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.(*ListConnectedDataServicesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListConnectedDataServicesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* ListCredentials lists credentials @@ -1969,6 +2274,45 @@ func (a *Client) SetAWSAuditCredential(params *SetAWSAuditCredentialParams, opts return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +SetAWSGovCloudAuditCredential creates or updates the a w s gov cloud audit credential for the account the credential is used for authorization to archive audit events to your cloud storage + +Creates or updates the AWS GovCloud audit credential for the account. The response will only contain details appropriate to AWS. +*/ +func (a *Client) SetAWSGovCloudAuditCredential(params *SetAWSGovCloudAuditCredentialParams, opts ...ClientOption) (*SetAWSGovCloudAuditCredentialOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSetAWSGovCloudAuditCredentialParams() + } + op := &runtime.ClientOperation{ + ID: "setAWSGovCloudAuditCredential", + Method: "POST", + PathPattern: "/api/v1/environments2/setAWSGovCloudAuditCredential", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &SetAWSGovCloudAuditCredentialReader{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.(*SetAWSGovCloudAuditCredentialOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SetAWSGovCloudAuditCredentialDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* SetAccountTelemetry sets account level telemetry settings telemetry features and anonymization rules @@ -2164,6 +2508,45 @@ func (a *Client) SetEnvironmentSetting(params *SetEnvironmentSettingParams, opts return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +SetGCPAuditCredential creates or updates the g c p audit credential for the account the credential is used for authorization to archive audit events to your cloud storage + +Creates or updates the GCP audit credential for the account. The response will only contain details appropriate to GCP. +*/ +func (a *Client) SetGCPAuditCredential(params *SetGCPAuditCredentialParams, opts ...ClientOption) (*SetGCPAuditCredentialOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSetGCPAuditCredentialParams() + } + op := &runtime.ClientOperation{ + ID: "setGCPAuditCredential", + Method: "POST", + PathPattern: "/api/v1/environments2/setGCPAuditCredential", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &SetGCPAuditCredentialReader{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.(*SetGCPAuditCredentialOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SetGCPAuditCredentialDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* SetIDBrokerMappings sets all ID broker mappings for an environment @@ -2710,6 +3093,45 @@ func (a *Client) UpdateAzureCredential(params *UpdateAzureCredentialParams, opts return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +UpdateAzureDatabaseResources updates the azure database resources for the environment + +Updates the Azure database resources for the environment. Enables deploying private Flexible Server for the existing environment. +*/ +func (a *Client) UpdateAzureDatabaseResources(params *UpdateAzureDatabaseResourcesParams, opts ...ClientOption) (*UpdateAzureDatabaseResourcesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateAzureDatabaseResourcesParams() + } + op := &runtime.ClientOperation{ + ID: "updateAzureDatabaseResources", + Method: "POST", + PathPattern: "/api/v1/environments2/updateAzureDatabaseResources", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateAzureDatabaseResourcesReader{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.(*UpdateAzureDatabaseResourcesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateAzureDatabaseResourcesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* UpdateAzureEncryptionResources updates the azure encryption resources for the environment @@ -2749,6 +3171,84 @@ func (a *Client) UpdateAzureEncryptionResources(params *UpdateAzureEncryptionRes return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +UpdateAzureImageTermsPolicy updates account level azure marketplace image policy c d p is capable to automatically accept azure marketplace image terms during cluster deployment you can use this setting in your account to opt in or opt out this behaviour + +Updates account level Azure Marketplace image policy. CDP is capable to automatically accept Azure Marketplace image terms during cluster deployment. You can use this setting in your account to opt in or opt out this behaviour. +*/ +func (a *Client) UpdateAzureImageTermsPolicy(params *UpdateAzureImageTermsPolicyParams, opts ...ClientOption) (*UpdateAzureImageTermsPolicyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateAzureImageTermsPolicyParams() + } + op := &runtime.ClientOperation{ + ID: "updateAzureImageTermsPolicy", + Method: "POST", + PathPattern: "/api/v1/environments2/updateAzureImageTermsPolicy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateAzureImageTermsPolicyReader{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.(*UpdateAzureImageTermsPolicyOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateAzureImageTermsPolicyDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +UpdateDataServiceResources updates data service resources of an environment + +Updates Data Service resources of an environment. +*/ +func (a *Client) UpdateDataServiceResources(params *UpdateDataServiceResourcesParams, opts ...ClientOption) (*UpdateDataServiceResourcesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateDataServiceResourcesParams() + } + op := &runtime.ClientOperation{ + ID: "updateDataServiceResources", + Method: "POST", + PathPattern: "/api/v1/environments2/updateDataServiceResources", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateDataServiceResourcesReader{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.(*UpdateDataServiceResourcesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateDataServiceResourcesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* UpdateOrchestratorState runs orchestrator engine state update on the free IP a cluster @@ -2827,6 +3327,84 @@ func (a *Client) UpdateProxyConfig(params *UpdateProxyConfigParams, opts ...Clie return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +UpdateSecurityAccess updates the security access settings of the given environment + +Updates the security access settings of the given environment. +*/ +func (a *Client) UpdateSecurityAccess(params *UpdateSecurityAccessParams, opts ...ClientOption) (*UpdateSecurityAccessOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateSecurityAccessParams() + } + op := &runtime.ClientOperation{ + ID: "updateSecurityAccess", + Method: "POST", + PathPattern: "/api/v1/environments2/updateSecurityAccess", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateSecurityAccessReader{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.(*UpdateSecurityAccessOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateSecurityAccessDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +UpdateSSHKey updates the designated SSH key for the given environment + +Updates the designated SSH key for the given environment. +*/ +func (a *Client) UpdateSSHKey(params *UpdateSSHKeyParams, opts ...ClientOption) (*UpdateSSHKeyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateSSHKeyParams() + } + op := &runtime.ClientOperation{ + ID: "updateSshKey", + Method: "POST", + PathPattern: "/api/v1/environments2/updateSshKey", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &UpdateSSHKeyReader{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.(*UpdateSSHKeyOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*UpdateSSHKeyDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* UpdateSubnet updates the subnet s of the given environment @@ -2983,6 +3561,84 @@ func (a *Client) UpscaleFreeipa(params *UpscaleFreeipaParams, opts ...ClientOpti return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ValidateAwsCloudStorage validates a w s cloud storage settings of the given environment + +Validates AWS cloud storage settings of the given environment. +*/ +func (a *Client) ValidateAwsCloudStorage(params *ValidateAwsCloudStorageParams, opts ...ClientOption) (*ValidateAwsCloudStorageOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewValidateAwsCloudStorageParams() + } + op := &runtime.ClientOperation{ + ID: "validateAwsCloudStorage", + Method: "POST", + PathPattern: "/api/v1/environments2/validateAwsCloudStorage", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ValidateAwsCloudStorageReader{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.(*ValidateAwsCloudStorageOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ValidateAwsCloudStorageDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ValidateAzureCloudStorage validates azure cloud storage settings of the given environment + +Validates Azure cloud storage settings of the given environment. +*/ +func (a *Client) ValidateAzureCloudStorage(params *ValidateAzureCloudStorageParams, opts ...ClientOption) (*ValidateAzureCloudStorageOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewValidateAzureCloudStorageParams() + } + op := &runtime.ClientOperation{ + ID: "validateAzureCloudStorage", + Method: "POST", + PathPattern: "/api/v1/environments2/validateAzureCloudStorage", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ValidateAzureCloudStorageReader{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.(*ValidateAzureCloudStorageOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ValidateAzureCloudStorageDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/cdp-sdk-go/gen/environments/client/operations/set_a_w_s_gov_cloud_audit_credential_parameters.go b/cdp-sdk-go/gen/environments/client/operations/set_a_w_s_gov_cloud_audit_credential_parameters.go new file mode 100644 index 00000000..8b879115 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/set_a_w_s_gov_cloud_audit_credential_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewSetAWSGovCloudAuditCredentialParams creates a new SetAWSGovCloudAuditCredentialParams 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 NewSetAWSGovCloudAuditCredentialParams() *SetAWSGovCloudAuditCredentialParams { + return &SetAWSGovCloudAuditCredentialParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSetAWSGovCloudAuditCredentialParamsWithTimeout creates a new SetAWSGovCloudAuditCredentialParams object +// with the ability to set a timeout on a request. +func NewSetAWSGovCloudAuditCredentialParamsWithTimeout(timeout time.Duration) *SetAWSGovCloudAuditCredentialParams { + return &SetAWSGovCloudAuditCredentialParams{ + timeout: timeout, + } +} + +// NewSetAWSGovCloudAuditCredentialParamsWithContext creates a new SetAWSGovCloudAuditCredentialParams object +// with the ability to set a context for a request. +func NewSetAWSGovCloudAuditCredentialParamsWithContext(ctx context.Context) *SetAWSGovCloudAuditCredentialParams { + return &SetAWSGovCloudAuditCredentialParams{ + Context: ctx, + } +} + +// NewSetAWSGovCloudAuditCredentialParamsWithHTTPClient creates a new SetAWSGovCloudAuditCredentialParams object +// with the ability to set a custom HTTPClient for a request. +func NewSetAWSGovCloudAuditCredentialParamsWithHTTPClient(client *http.Client) *SetAWSGovCloudAuditCredentialParams { + return &SetAWSGovCloudAuditCredentialParams{ + HTTPClient: client, + } +} + +/* +SetAWSGovCloudAuditCredentialParams contains all the parameters to send to the API endpoint + + for the set a w s gov cloud audit credential operation. + + Typically these are written to a http.Request. +*/ +type SetAWSGovCloudAuditCredentialParams struct { + + // Input. + Input *models.SetAWSGovCloudAuditCredentialRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the set a w s gov cloud audit credential params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetAWSGovCloudAuditCredentialParams) WithDefaults() *SetAWSGovCloudAuditCredentialParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the set a w s gov cloud audit credential params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetAWSGovCloudAuditCredentialParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the set a w s gov cloud audit credential params +func (o *SetAWSGovCloudAuditCredentialParams) WithTimeout(timeout time.Duration) *SetAWSGovCloudAuditCredentialParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the set a w s gov cloud audit credential params +func (o *SetAWSGovCloudAuditCredentialParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the set a w s gov cloud audit credential params +func (o *SetAWSGovCloudAuditCredentialParams) WithContext(ctx context.Context) *SetAWSGovCloudAuditCredentialParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the set a w s gov cloud audit credential params +func (o *SetAWSGovCloudAuditCredentialParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the set a w s gov cloud audit credential params +func (o *SetAWSGovCloudAuditCredentialParams) WithHTTPClient(client *http.Client) *SetAWSGovCloudAuditCredentialParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the set a w s gov cloud audit credential params +func (o *SetAWSGovCloudAuditCredentialParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the set a w s gov cloud audit credential params +func (o *SetAWSGovCloudAuditCredentialParams) WithInput(input *models.SetAWSGovCloudAuditCredentialRequest) *SetAWSGovCloudAuditCredentialParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the set a w s gov cloud audit credential params +func (o *SetAWSGovCloudAuditCredentialParams) SetInput(input *models.SetAWSGovCloudAuditCredentialRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *SetAWSGovCloudAuditCredentialParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/set_a_w_s_gov_cloud_audit_credential_responses.go b/cdp-sdk-go/gen/environments/client/operations/set_a_w_s_gov_cloud_audit_credential_responses.go new file mode 100644 index 00000000..007ea690 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/set_a_w_s_gov_cloud_audit_credential_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// SetAWSGovCloudAuditCredentialReader is a Reader for the SetAWSGovCloudAuditCredential structure. +type SetAWSGovCloudAuditCredentialReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SetAWSGovCloudAuditCredentialReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSetAWSGovCloudAuditCredentialOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSetAWSGovCloudAuditCredentialDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSetAWSGovCloudAuditCredentialOK creates a SetAWSGovCloudAuditCredentialOK with default headers values +func NewSetAWSGovCloudAuditCredentialOK() *SetAWSGovCloudAuditCredentialOK { + return &SetAWSGovCloudAuditCredentialOK{} +} + +/* +SetAWSGovCloudAuditCredentialOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type SetAWSGovCloudAuditCredentialOK struct { + Payload *models.SetAWSGovCloudAuditCredentialResponse +} + +// IsSuccess returns true when this set a w s gov cloud audit credential o k response has a 2xx status code +func (o *SetAWSGovCloudAuditCredentialOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this set a w s gov cloud audit credential o k response has a 3xx status code +func (o *SetAWSGovCloudAuditCredentialOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this set a w s gov cloud audit credential o k response has a 4xx status code +func (o *SetAWSGovCloudAuditCredentialOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this set a w s gov cloud audit credential o k response has a 5xx status code +func (o *SetAWSGovCloudAuditCredentialOK) IsServerError() bool { + return false +} + +// IsCode returns true when this set a w s gov cloud audit credential o k response a status code equal to that given +func (o *SetAWSGovCloudAuditCredentialOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the set a w s gov cloud audit credential o k response +func (o *SetAWSGovCloudAuditCredentialOK) Code() int { + return 200 +} + +func (o *SetAWSGovCloudAuditCredentialOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/setAWSGovCloudAuditCredential][%d] setAWSGovCloudAuditCredentialOK %+v", 200, o.Payload) +} + +func (o *SetAWSGovCloudAuditCredentialOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/setAWSGovCloudAuditCredential][%d] setAWSGovCloudAuditCredentialOK %+v", 200, o.Payload) +} + +func (o *SetAWSGovCloudAuditCredentialOK) GetPayload() *models.SetAWSGovCloudAuditCredentialResponse { + return o.Payload +} + +func (o *SetAWSGovCloudAuditCredentialOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SetAWSGovCloudAuditCredentialResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSetAWSGovCloudAuditCredentialDefault creates a SetAWSGovCloudAuditCredentialDefault with default headers values +func NewSetAWSGovCloudAuditCredentialDefault(code int) *SetAWSGovCloudAuditCredentialDefault { + return &SetAWSGovCloudAuditCredentialDefault{ + _statusCode: code, + } +} + +/* +SetAWSGovCloudAuditCredentialDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type SetAWSGovCloudAuditCredentialDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this set a w s gov cloud audit credential default response has a 2xx status code +func (o *SetAWSGovCloudAuditCredentialDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this set a w s gov cloud audit credential default response has a 3xx status code +func (o *SetAWSGovCloudAuditCredentialDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this set a w s gov cloud audit credential default response has a 4xx status code +func (o *SetAWSGovCloudAuditCredentialDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this set a w s gov cloud audit credential default response has a 5xx status code +func (o *SetAWSGovCloudAuditCredentialDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this set a w s gov cloud audit credential default response a status code equal to that given +func (o *SetAWSGovCloudAuditCredentialDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the set a w s gov cloud audit credential default response +func (o *SetAWSGovCloudAuditCredentialDefault) Code() int { + return o._statusCode +} + +func (o *SetAWSGovCloudAuditCredentialDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/setAWSGovCloudAuditCredential][%d] setAWSGovCloudAuditCredential default %+v", o._statusCode, o.Payload) +} + +func (o *SetAWSGovCloudAuditCredentialDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/setAWSGovCloudAuditCredential][%d] setAWSGovCloudAuditCredential default %+v", o._statusCode, o.Payload) +} + +func (o *SetAWSGovCloudAuditCredentialDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *SetAWSGovCloudAuditCredentialDefault) 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/cdp-sdk-go/gen/environments/client/operations/set_g_c_p_audit_credential_parameters.go b/cdp-sdk-go/gen/environments/client/operations/set_g_c_p_audit_credential_parameters.go new file mode 100644 index 00000000..3b7aefde --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/set_g_c_p_audit_credential_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewSetGCPAuditCredentialParams creates a new SetGCPAuditCredentialParams 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 NewSetGCPAuditCredentialParams() *SetGCPAuditCredentialParams { + return &SetGCPAuditCredentialParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSetGCPAuditCredentialParamsWithTimeout creates a new SetGCPAuditCredentialParams object +// with the ability to set a timeout on a request. +func NewSetGCPAuditCredentialParamsWithTimeout(timeout time.Duration) *SetGCPAuditCredentialParams { + return &SetGCPAuditCredentialParams{ + timeout: timeout, + } +} + +// NewSetGCPAuditCredentialParamsWithContext creates a new SetGCPAuditCredentialParams object +// with the ability to set a context for a request. +func NewSetGCPAuditCredentialParamsWithContext(ctx context.Context) *SetGCPAuditCredentialParams { + return &SetGCPAuditCredentialParams{ + Context: ctx, + } +} + +// NewSetGCPAuditCredentialParamsWithHTTPClient creates a new SetGCPAuditCredentialParams object +// with the ability to set a custom HTTPClient for a request. +func NewSetGCPAuditCredentialParamsWithHTTPClient(client *http.Client) *SetGCPAuditCredentialParams { + return &SetGCPAuditCredentialParams{ + HTTPClient: client, + } +} + +/* +SetGCPAuditCredentialParams contains all the parameters to send to the API endpoint + + for the set g c p audit credential operation. + + Typically these are written to a http.Request. +*/ +type SetGCPAuditCredentialParams struct { + + // Input. + Input *models.SetGCPAuditCredentialRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the set g c p audit credential params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetGCPAuditCredentialParams) WithDefaults() *SetGCPAuditCredentialParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the set g c p audit credential params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetGCPAuditCredentialParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the set g c p audit credential params +func (o *SetGCPAuditCredentialParams) WithTimeout(timeout time.Duration) *SetGCPAuditCredentialParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the set g c p audit credential params +func (o *SetGCPAuditCredentialParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the set g c p audit credential params +func (o *SetGCPAuditCredentialParams) WithContext(ctx context.Context) *SetGCPAuditCredentialParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the set g c p audit credential params +func (o *SetGCPAuditCredentialParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the set g c p audit credential params +func (o *SetGCPAuditCredentialParams) WithHTTPClient(client *http.Client) *SetGCPAuditCredentialParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the set g c p audit credential params +func (o *SetGCPAuditCredentialParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the set g c p audit credential params +func (o *SetGCPAuditCredentialParams) WithInput(input *models.SetGCPAuditCredentialRequest) *SetGCPAuditCredentialParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the set g c p audit credential params +func (o *SetGCPAuditCredentialParams) SetInput(input *models.SetGCPAuditCredentialRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *SetGCPAuditCredentialParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/set_g_c_p_audit_credential_responses.go b/cdp-sdk-go/gen/environments/client/operations/set_g_c_p_audit_credential_responses.go new file mode 100644 index 00000000..47dfd9fc --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/set_g_c_p_audit_credential_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// SetGCPAuditCredentialReader is a Reader for the SetGCPAuditCredential structure. +type SetGCPAuditCredentialReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SetGCPAuditCredentialReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSetGCPAuditCredentialOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSetGCPAuditCredentialDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSetGCPAuditCredentialOK creates a SetGCPAuditCredentialOK with default headers values +func NewSetGCPAuditCredentialOK() *SetGCPAuditCredentialOK { + return &SetGCPAuditCredentialOK{} +} + +/* +SetGCPAuditCredentialOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type SetGCPAuditCredentialOK struct { + Payload *models.SetGCPAuditCredentialResponse +} + +// IsSuccess returns true when this set g c p audit credential o k response has a 2xx status code +func (o *SetGCPAuditCredentialOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this set g c p audit credential o k response has a 3xx status code +func (o *SetGCPAuditCredentialOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this set g c p audit credential o k response has a 4xx status code +func (o *SetGCPAuditCredentialOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this set g c p audit credential o k response has a 5xx status code +func (o *SetGCPAuditCredentialOK) IsServerError() bool { + return false +} + +// IsCode returns true when this set g c p audit credential o k response a status code equal to that given +func (o *SetGCPAuditCredentialOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the set g c p audit credential o k response +func (o *SetGCPAuditCredentialOK) Code() int { + return 200 +} + +func (o *SetGCPAuditCredentialOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/setGCPAuditCredential][%d] setGCPAuditCredentialOK %+v", 200, o.Payload) +} + +func (o *SetGCPAuditCredentialOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/setGCPAuditCredential][%d] setGCPAuditCredentialOK %+v", 200, o.Payload) +} + +func (o *SetGCPAuditCredentialOK) GetPayload() *models.SetGCPAuditCredentialResponse { + return o.Payload +} + +func (o *SetGCPAuditCredentialOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SetGCPAuditCredentialResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSetGCPAuditCredentialDefault creates a SetGCPAuditCredentialDefault with default headers values +func NewSetGCPAuditCredentialDefault(code int) *SetGCPAuditCredentialDefault { + return &SetGCPAuditCredentialDefault{ + _statusCode: code, + } +} + +/* +SetGCPAuditCredentialDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type SetGCPAuditCredentialDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this set g c p audit credential default response has a 2xx status code +func (o *SetGCPAuditCredentialDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this set g c p audit credential default response has a 3xx status code +func (o *SetGCPAuditCredentialDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this set g c p audit credential default response has a 4xx status code +func (o *SetGCPAuditCredentialDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this set g c p audit credential default response has a 5xx status code +func (o *SetGCPAuditCredentialDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this set g c p audit credential default response a status code equal to that given +func (o *SetGCPAuditCredentialDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the set g c p audit credential default response +func (o *SetGCPAuditCredentialDefault) Code() int { + return o._statusCode +} + +func (o *SetGCPAuditCredentialDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/setGCPAuditCredential][%d] setGCPAuditCredential default %+v", o._statusCode, o.Payload) +} + +func (o *SetGCPAuditCredentialDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/setGCPAuditCredential][%d] setGCPAuditCredential default %+v", o._statusCode, o.Payload) +} + +func (o *SetGCPAuditCredentialDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *SetGCPAuditCredentialDefault) 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/cdp-sdk-go/gen/environments/client/operations/update_azure_database_resources_parameters.go b/cdp-sdk-go/gen/environments/client/operations/update_azure_database_resources_parameters.go new file mode 100644 index 00000000..ff11eb5e --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/update_azure_database_resources_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewUpdateAzureDatabaseResourcesParams creates a new UpdateAzureDatabaseResourcesParams 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 NewUpdateAzureDatabaseResourcesParams() *UpdateAzureDatabaseResourcesParams { + return &UpdateAzureDatabaseResourcesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateAzureDatabaseResourcesParamsWithTimeout creates a new UpdateAzureDatabaseResourcesParams object +// with the ability to set a timeout on a request. +func NewUpdateAzureDatabaseResourcesParamsWithTimeout(timeout time.Duration) *UpdateAzureDatabaseResourcesParams { + return &UpdateAzureDatabaseResourcesParams{ + timeout: timeout, + } +} + +// NewUpdateAzureDatabaseResourcesParamsWithContext creates a new UpdateAzureDatabaseResourcesParams object +// with the ability to set a context for a request. +func NewUpdateAzureDatabaseResourcesParamsWithContext(ctx context.Context) *UpdateAzureDatabaseResourcesParams { + return &UpdateAzureDatabaseResourcesParams{ + Context: ctx, + } +} + +// NewUpdateAzureDatabaseResourcesParamsWithHTTPClient creates a new UpdateAzureDatabaseResourcesParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateAzureDatabaseResourcesParamsWithHTTPClient(client *http.Client) *UpdateAzureDatabaseResourcesParams { + return &UpdateAzureDatabaseResourcesParams{ + HTTPClient: client, + } +} + +/* +UpdateAzureDatabaseResourcesParams contains all the parameters to send to the API endpoint + + for the update azure database resources operation. + + Typically these are written to a http.Request. +*/ +type UpdateAzureDatabaseResourcesParams struct { + + // Input. + Input *models.UpdateAzureDatabaseResourcesRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update azure database resources params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAzureDatabaseResourcesParams) WithDefaults() *UpdateAzureDatabaseResourcesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update azure database resources params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAzureDatabaseResourcesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update azure database resources params +func (o *UpdateAzureDatabaseResourcesParams) WithTimeout(timeout time.Duration) *UpdateAzureDatabaseResourcesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update azure database resources params +func (o *UpdateAzureDatabaseResourcesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update azure database resources params +func (o *UpdateAzureDatabaseResourcesParams) WithContext(ctx context.Context) *UpdateAzureDatabaseResourcesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update azure database resources params +func (o *UpdateAzureDatabaseResourcesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update azure database resources params +func (o *UpdateAzureDatabaseResourcesParams) WithHTTPClient(client *http.Client) *UpdateAzureDatabaseResourcesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update azure database resources params +func (o *UpdateAzureDatabaseResourcesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the update azure database resources params +func (o *UpdateAzureDatabaseResourcesParams) WithInput(input *models.UpdateAzureDatabaseResourcesRequest) *UpdateAzureDatabaseResourcesParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the update azure database resources params +func (o *UpdateAzureDatabaseResourcesParams) SetInput(input *models.UpdateAzureDatabaseResourcesRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateAzureDatabaseResourcesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/update_azure_database_resources_responses.go b/cdp-sdk-go/gen/environments/client/operations/update_azure_database_resources_responses.go new file mode 100644 index 00000000..dcef328e --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/update_azure_database_resources_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// UpdateAzureDatabaseResourcesReader is a Reader for the UpdateAzureDatabaseResources structure. +type UpdateAzureDatabaseResourcesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateAzureDatabaseResourcesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateAzureDatabaseResourcesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateAzureDatabaseResourcesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewUpdateAzureDatabaseResourcesOK creates a UpdateAzureDatabaseResourcesOK with default headers values +func NewUpdateAzureDatabaseResourcesOK() *UpdateAzureDatabaseResourcesOK { + return &UpdateAzureDatabaseResourcesOK{} +} + +/* +UpdateAzureDatabaseResourcesOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type UpdateAzureDatabaseResourcesOK struct { + Payload *models.UpdateAzureDatabaseResourcesResponse +} + +// IsSuccess returns true when this update azure database resources o k response has a 2xx status code +func (o *UpdateAzureDatabaseResourcesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update azure database resources o k response has a 3xx status code +func (o *UpdateAzureDatabaseResourcesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update azure database resources o k response has a 4xx status code +func (o *UpdateAzureDatabaseResourcesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update azure database resources o k response has a 5xx status code +func (o *UpdateAzureDatabaseResourcesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update azure database resources o k response a status code equal to that given +func (o *UpdateAzureDatabaseResourcesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update azure database resources o k response +func (o *UpdateAzureDatabaseResourcesOK) Code() int { + return 200 +} + +func (o *UpdateAzureDatabaseResourcesOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateAzureDatabaseResources][%d] updateAzureDatabaseResourcesOK %+v", 200, o.Payload) +} + +func (o *UpdateAzureDatabaseResourcesOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateAzureDatabaseResources][%d] updateAzureDatabaseResourcesOK %+v", 200, o.Payload) +} + +func (o *UpdateAzureDatabaseResourcesOK) GetPayload() *models.UpdateAzureDatabaseResourcesResponse { + return o.Payload +} + +func (o *UpdateAzureDatabaseResourcesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.UpdateAzureDatabaseResourcesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateAzureDatabaseResourcesDefault creates a UpdateAzureDatabaseResourcesDefault with default headers values +func NewUpdateAzureDatabaseResourcesDefault(code int) *UpdateAzureDatabaseResourcesDefault { + return &UpdateAzureDatabaseResourcesDefault{ + _statusCode: code, + } +} + +/* +UpdateAzureDatabaseResourcesDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type UpdateAzureDatabaseResourcesDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this update azure database resources default response has a 2xx status code +func (o *UpdateAzureDatabaseResourcesDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this update azure database resources default response has a 3xx status code +func (o *UpdateAzureDatabaseResourcesDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this update azure database resources default response has a 4xx status code +func (o *UpdateAzureDatabaseResourcesDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this update azure database resources default response has a 5xx status code +func (o *UpdateAzureDatabaseResourcesDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this update azure database resources default response a status code equal to that given +func (o *UpdateAzureDatabaseResourcesDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the update azure database resources default response +func (o *UpdateAzureDatabaseResourcesDefault) Code() int { + return o._statusCode +} + +func (o *UpdateAzureDatabaseResourcesDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateAzureDatabaseResources][%d] updateAzureDatabaseResources default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateAzureDatabaseResourcesDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateAzureDatabaseResources][%d] updateAzureDatabaseResources default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateAzureDatabaseResourcesDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateAzureDatabaseResourcesDefault) 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/cdp-sdk-go/gen/environments/client/operations/update_azure_image_terms_policy_parameters.go b/cdp-sdk-go/gen/environments/client/operations/update_azure_image_terms_policy_parameters.go new file mode 100644 index 00000000..06b889f3 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/update_azure_image_terms_policy_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewUpdateAzureImageTermsPolicyParams creates a new UpdateAzureImageTermsPolicyParams 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 NewUpdateAzureImageTermsPolicyParams() *UpdateAzureImageTermsPolicyParams { + return &UpdateAzureImageTermsPolicyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateAzureImageTermsPolicyParamsWithTimeout creates a new UpdateAzureImageTermsPolicyParams object +// with the ability to set a timeout on a request. +func NewUpdateAzureImageTermsPolicyParamsWithTimeout(timeout time.Duration) *UpdateAzureImageTermsPolicyParams { + return &UpdateAzureImageTermsPolicyParams{ + timeout: timeout, + } +} + +// NewUpdateAzureImageTermsPolicyParamsWithContext creates a new UpdateAzureImageTermsPolicyParams object +// with the ability to set a context for a request. +func NewUpdateAzureImageTermsPolicyParamsWithContext(ctx context.Context) *UpdateAzureImageTermsPolicyParams { + return &UpdateAzureImageTermsPolicyParams{ + Context: ctx, + } +} + +// NewUpdateAzureImageTermsPolicyParamsWithHTTPClient creates a new UpdateAzureImageTermsPolicyParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateAzureImageTermsPolicyParamsWithHTTPClient(client *http.Client) *UpdateAzureImageTermsPolicyParams { + return &UpdateAzureImageTermsPolicyParams{ + HTTPClient: client, + } +} + +/* +UpdateAzureImageTermsPolicyParams contains all the parameters to send to the API endpoint + + for the update azure image terms policy operation. + + Typically these are written to a http.Request. +*/ +type UpdateAzureImageTermsPolicyParams struct { + + // Input. + Input *models.UpdateAzureImageTermsPolicyRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update azure image terms policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAzureImageTermsPolicyParams) WithDefaults() *UpdateAzureImageTermsPolicyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update azure image terms policy params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateAzureImageTermsPolicyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update azure image terms policy params +func (o *UpdateAzureImageTermsPolicyParams) WithTimeout(timeout time.Duration) *UpdateAzureImageTermsPolicyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update azure image terms policy params +func (o *UpdateAzureImageTermsPolicyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update azure image terms policy params +func (o *UpdateAzureImageTermsPolicyParams) WithContext(ctx context.Context) *UpdateAzureImageTermsPolicyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update azure image terms policy params +func (o *UpdateAzureImageTermsPolicyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update azure image terms policy params +func (o *UpdateAzureImageTermsPolicyParams) WithHTTPClient(client *http.Client) *UpdateAzureImageTermsPolicyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update azure image terms policy params +func (o *UpdateAzureImageTermsPolicyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the update azure image terms policy params +func (o *UpdateAzureImageTermsPolicyParams) WithInput(input *models.UpdateAzureImageTermsPolicyRequest) *UpdateAzureImageTermsPolicyParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the update azure image terms policy params +func (o *UpdateAzureImageTermsPolicyParams) SetInput(input *models.UpdateAzureImageTermsPolicyRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateAzureImageTermsPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/update_azure_image_terms_policy_responses.go b/cdp-sdk-go/gen/environments/client/operations/update_azure_image_terms_policy_responses.go new file mode 100644 index 00000000..3512e0a6 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/update_azure_image_terms_policy_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// UpdateAzureImageTermsPolicyReader is a Reader for the UpdateAzureImageTermsPolicy structure. +type UpdateAzureImageTermsPolicyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateAzureImageTermsPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateAzureImageTermsPolicyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateAzureImageTermsPolicyDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewUpdateAzureImageTermsPolicyOK creates a UpdateAzureImageTermsPolicyOK with default headers values +func NewUpdateAzureImageTermsPolicyOK() *UpdateAzureImageTermsPolicyOK { + return &UpdateAzureImageTermsPolicyOK{} +} + +/* +UpdateAzureImageTermsPolicyOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type UpdateAzureImageTermsPolicyOK struct { + Payload models.UpdateAzureImageTermsPolicyResponse +} + +// IsSuccess returns true when this update azure image terms policy o k response has a 2xx status code +func (o *UpdateAzureImageTermsPolicyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update azure image terms policy o k response has a 3xx status code +func (o *UpdateAzureImageTermsPolicyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update azure image terms policy o k response has a 4xx status code +func (o *UpdateAzureImageTermsPolicyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update azure image terms policy o k response has a 5xx status code +func (o *UpdateAzureImageTermsPolicyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update azure image terms policy o k response a status code equal to that given +func (o *UpdateAzureImageTermsPolicyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update azure image terms policy o k response +func (o *UpdateAzureImageTermsPolicyOK) Code() int { + return 200 +} + +func (o *UpdateAzureImageTermsPolicyOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateAzureImageTermsPolicy][%d] updateAzureImageTermsPolicyOK %+v", 200, o.Payload) +} + +func (o *UpdateAzureImageTermsPolicyOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateAzureImageTermsPolicy][%d] updateAzureImageTermsPolicyOK %+v", 200, o.Payload) +} + +func (o *UpdateAzureImageTermsPolicyOK) GetPayload() models.UpdateAzureImageTermsPolicyResponse { + return o.Payload +} + +func (o *UpdateAzureImageTermsPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateAzureImageTermsPolicyDefault creates a UpdateAzureImageTermsPolicyDefault with default headers values +func NewUpdateAzureImageTermsPolicyDefault(code int) *UpdateAzureImageTermsPolicyDefault { + return &UpdateAzureImageTermsPolicyDefault{ + _statusCode: code, + } +} + +/* +UpdateAzureImageTermsPolicyDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type UpdateAzureImageTermsPolicyDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this update azure image terms policy default response has a 2xx status code +func (o *UpdateAzureImageTermsPolicyDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this update azure image terms policy default response has a 3xx status code +func (o *UpdateAzureImageTermsPolicyDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this update azure image terms policy default response has a 4xx status code +func (o *UpdateAzureImageTermsPolicyDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this update azure image terms policy default response has a 5xx status code +func (o *UpdateAzureImageTermsPolicyDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this update azure image terms policy default response a status code equal to that given +func (o *UpdateAzureImageTermsPolicyDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the update azure image terms policy default response +func (o *UpdateAzureImageTermsPolicyDefault) Code() int { + return o._statusCode +} + +func (o *UpdateAzureImageTermsPolicyDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateAzureImageTermsPolicy][%d] updateAzureImageTermsPolicy default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateAzureImageTermsPolicyDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateAzureImageTermsPolicy][%d] updateAzureImageTermsPolicy default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateAzureImageTermsPolicyDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateAzureImageTermsPolicyDefault) 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/cdp-sdk-go/gen/environments/client/operations/update_data_service_resources_parameters.go b/cdp-sdk-go/gen/environments/client/operations/update_data_service_resources_parameters.go new file mode 100644 index 00000000..8dbd27d7 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/update_data_service_resources_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewUpdateDataServiceResourcesParams creates a new UpdateDataServiceResourcesParams 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 NewUpdateDataServiceResourcesParams() *UpdateDataServiceResourcesParams { + return &UpdateDataServiceResourcesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateDataServiceResourcesParamsWithTimeout creates a new UpdateDataServiceResourcesParams object +// with the ability to set a timeout on a request. +func NewUpdateDataServiceResourcesParamsWithTimeout(timeout time.Duration) *UpdateDataServiceResourcesParams { + return &UpdateDataServiceResourcesParams{ + timeout: timeout, + } +} + +// NewUpdateDataServiceResourcesParamsWithContext creates a new UpdateDataServiceResourcesParams object +// with the ability to set a context for a request. +func NewUpdateDataServiceResourcesParamsWithContext(ctx context.Context) *UpdateDataServiceResourcesParams { + return &UpdateDataServiceResourcesParams{ + Context: ctx, + } +} + +// NewUpdateDataServiceResourcesParamsWithHTTPClient creates a new UpdateDataServiceResourcesParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateDataServiceResourcesParamsWithHTTPClient(client *http.Client) *UpdateDataServiceResourcesParams { + return &UpdateDataServiceResourcesParams{ + HTTPClient: client, + } +} + +/* +UpdateDataServiceResourcesParams contains all the parameters to send to the API endpoint + + for the update data service resources operation. + + Typically these are written to a http.Request. +*/ +type UpdateDataServiceResourcesParams struct { + + // Input. + Input *models.UpdateDataServiceResourcesRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update data service resources params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateDataServiceResourcesParams) WithDefaults() *UpdateDataServiceResourcesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update data service resources params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateDataServiceResourcesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update data service resources params +func (o *UpdateDataServiceResourcesParams) WithTimeout(timeout time.Duration) *UpdateDataServiceResourcesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update data service resources params +func (o *UpdateDataServiceResourcesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update data service resources params +func (o *UpdateDataServiceResourcesParams) WithContext(ctx context.Context) *UpdateDataServiceResourcesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update data service resources params +func (o *UpdateDataServiceResourcesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update data service resources params +func (o *UpdateDataServiceResourcesParams) WithHTTPClient(client *http.Client) *UpdateDataServiceResourcesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update data service resources params +func (o *UpdateDataServiceResourcesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the update data service resources params +func (o *UpdateDataServiceResourcesParams) WithInput(input *models.UpdateDataServiceResourcesRequest) *UpdateDataServiceResourcesParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the update data service resources params +func (o *UpdateDataServiceResourcesParams) SetInput(input *models.UpdateDataServiceResourcesRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateDataServiceResourcesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/update_data_service_resources_responses.go b/cdp-sdk-go/gen/environments/client/operations/update_data_service_resources_responses.go new file mode 100644 index 00000000..a4186a48 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/update_data_service_resources_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// UpdateDataServiceResourcesReader is a Reader for the UpdateDataServiceResources structure. +type UpdateDataServiceResourcesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateDataServiceResourcesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateDataServiceResourcesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateDataServiceResourcesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewUpdateDataServiceResourcesOK creates a UpdateDataServiceResourcesOK with default headers values +func NewUpdateDataServiceResourcesOK() *UpdateDataServiceResourcesOK { + return &UpdateDataServiceResourcesOK{} +} + +/* +UpdateDataServiceResourcesOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type UpdateDataServiceResourcesOK struct { + Payload *models.UpdateDataServiceResourcesResponse +} + +// IsSuccess returns true when this update data service resources o k response has a 2xx status code +func (o *UpdateDataServiceResourcesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update data service resources o k response has a 3xx status code +func (o *UpdateDataServiceResourcesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update data service resources o k response has a 4xx status code +func (o *UpdateDataServiceResourcesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update data service resources o k response has a 5xx status code +func (o *UpdateDataServiceResourcesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update data service resources o k response a status code equal to that given +func (o *UpdateDataServiceResourcesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update data service resources o k response +func (o *UpdateDataServiceResourcesOK) Code() int { + return 200 +} + +func (o *UpdateDataServiceResourcesOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateDataServiceResources][%d] updateDataServiceResourcesOK %+v", 200, o.Payload) +} + +func (o *UpdateDataServiceResourcesOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateDataServiceResources][%d] updateDataServiceResourcesOK %+v", 200, o.Payload) +} + +func (o *UpdateDataServiceResourcesOK) GetPayload() *models.UpdateDataServiceResourcesResponse { + return o.Payload +} + +func (o *UpdateDataServiceResourcesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.UpdateDataServiceResourcesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateDataServiceResourcesDefault creates a UpdateDataServiceResourcesDefault with default headers values +func NewUpdateDataServiceResourcesDefault(code int) *UpdateDataServiceResourcesDefault { + return &UpdateDataServiceResourcesDefault{ + _statusCode: code, + } +} + +/* +UpdateDataServiceResourcesDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type UpdateDataServiceResourcesDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this update data service resources default response has a 2xx status code +func (o *UpdateDataServiceResourcesDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this update data service resources default response has a 3xx status code +func (o *UpdateDataServiceResourcesDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this update data service resources default response has a 4xx status code +func (o *UpdateDataServiceResourcesDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this update data service resources default response has a 5xx status code +func (o *UpdateDataServiceResourcesDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this update data service resources default response a status code equal to that given +func (o *UpdateDataServiceResourcesDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the update data service resources default response +func (o *UpdateDataServiceResourcesDefault) Code() int { + return o._statusCode +} + +func (o *UpdateDataServiceResourcesDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateDataServiceResources][%d] updateDataServiceResources default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateDataServiceResourcesDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateDataServiceResources][%d] updateDataServiceResources default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateDataServiceResourcesDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateDataServiceResourcesDefault) 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/cdp-sdk-go/gen/environments/client/operations/update_security_access_parameters.go b/cdp-sdk-go/gen/environments/client/operations/update_security_access_parameters.go new file mode 100644 index 00000000..6ad1ebc2 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/update_security_access_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewUpdateSecurityAccessParams creates a new UpdateSecurityAccessParams 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 NewUpdateSecurityAccessParams() *UpdateSecurityAccessParams { + return &UpdateSecurityAccessParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSecurityAccessParamsWithTimeout creates a new UpdateSecurityAccessParams object +// with the ability to set a timeout on a request. +func NewUpdateSecurityAccessParamsWithTimeout(timeout time.Duration) *UpdateSecurityAccessParams { + return &UpdateSecurityAccessParams{ + timeout: timeout, + } +} + +// NewUpdateSecurityAccessParamsWithContext creates a new UpdateSecurityAccessParams object +// with the ability to set a context for a request. +func NewUpdateSecurityAccessParamsWithContext(ctx context.Context) *UpdateSecurityAccessParams { + return &UpdateSecurityAccessParams{ + Context: ctx, + } +} + +// NewUpdateSecurityAccessParamsWithHTTPClient creates a new UpdateSecurityAccessParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateSecurityAccessParamsWithHTTPClient(client *http.Client) *UpdateSecurityAccessParams { + return &UpdateSecurityAccessParams{ + HTTPClient: client, + } +} + +/* +UpdateSecurityAccessParams contains all the parameters to send to the API endpoint + + for the update security access operation. + + Typically these are written to a http.Request. +*/ +type UpdateSecurityAccessParams struct { + + // Input. + Input *models.UpdateSecurityAccessRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update security access params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSecurityAccessParams) WithDefaults() *UpdateSecurityAccessParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update security access params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSecurityAccessParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update security access params +func (o *UpdateSecurityAccessParams) WithTimeout(timeout time.Duration) *UpdateSecurityAccessParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update security access params +func (o *UpdateSecurityAccessParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update security access params +func (o *UpdateSecurityAccessParams) WithContext(ctx context.Context) *UpdateSecurityAccessParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update security access params +func (o *UpdateSecurityAccessParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update security access params +func (o *UpdateSecurityAccessParams) WithHTTPClient(client *http.Client) *UpdateSecurityAccessParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update security access params +func (o *UpdateSecurityAccessParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the update security access params +func (o *UpdateSecurityAccessParams) WithInput(input *models.UpdateSecurityAccessRequest) *UpdateSecurityAccessParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the update security access params +func (o *UpdateSecurityAccessParams) SetInput(input *models.UpdateSecurityAccessRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSecurityAccessParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/update_security_access_responses.go b/cdp-sdk-go/gen/environments/client/operations/update_security_access_responses.go new file mode 100644 index 00000000..d74aa460 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/update_security_access_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// UpdateSecurityAccessReader is a Reader for the UpdateSecurityAccess structure. +type UpdateSecurityAccessReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSecurityAccessReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSecurityAccessOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateSecurityAccessDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewUpdateSecurityAccessOK creates a UpdateSecurityAccessOK with default headers values +func NewUpdateSecurityAccessOK() *UpdateSecurityAccessOK { + return &UpdateSecurityAccessOK{} +} + +/* +UpdateSecurityAccessOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type UpdateSecurityAccessOK struct { + Payload *models.UpdateSecurityAccessResponse +} + +// IsSuccess returns true when this update security access o k response has a 2xx status code +func (o *UpdateSecurityAccessOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update security access o k response has a 3xx status code +func (o *UpdateSecurityAccessOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update security access o k response has a 4xx status code +func (o *UpdateSecurityAccessOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update security access o k response has a 5xx status code +func (o *UpdateSecurityAccessOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update security access o k response a status code equal to that given +func (o *UpdateSecurityAccessOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update security access o k response +func (o *UpdateSecurityAccessOK) Code() int { + return 200 +} + +func (o *UpdateSecurityAccessOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateSecurityAccess][%d] updateSecurityAccessOK %+v", 200, o.Payload) +} + +func (o *UpdateSecurityAccessOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateSecurityAccess][%d] updateSecurityAccessOK %+v", 200, o.Payload) +} + +func (o *UpdateSecurityAccessOK) GetPayload() *models.UpdateSecurityAccessResponse { + return o.Payload +} + +func (o *UpdateSecurityAccessOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.UpdateSecurityAccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateSecurityAccessDefault creates a UpdateSecurityAccessDefault with default headers values +func NewUpdateSecurityAccessDefault(code int) *UpdateSecurityAccessDefault { + return &UpdateSecurityAccessDefault{ + _statusCode: code, + } +} + +/* +UpdateSecurityAccessDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type UpdateSecurityAccessDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this update security access default response has a 2xx status code +func (o *UpdateSecurityAccessDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this update security access default response has a 3xx status code +func (o *UpdateSecurityAccessDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this update security access default response has a 4xx status code +func (o *UpdateSecurityAccessDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this update security access default response has a 5xx status code +func (o *UpdateSecurityAccessDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this update security access default response a status code equal to that given +func (o *UpdateSecurityAccessDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the update security access default response +func (o *UpdateSecurityAccessDefault) Code() int { + return o._statusCode +} + +func (o *UpdateSecurityAccessDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateSecurityAccess][%d] updateSecurityAccess default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateSecurityAccessDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateSecurityAccess][%d] updateSecurityAccess default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateSecurityAccessDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateSecurityAccessDefault) 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/cdp-sdk-go/gen/environments/client/operations/update_ssh_key_parameters.go b/cdp-sdk-go/gen/environments/client/operations/update_ssh_key_parameters.go new file mode 100644 index 00000000..026414de --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/update_ssh_key_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewUpdateSSHKeyParams creates a new UpdateSSHKeyParams 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 NewUpdateSSHKeyParams() *UpdateSSHKeyParams { + return &UpdateSSHKeyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateSSHKeyParamsWithTimeout creates a new UpdateSSHKeyParams object +// with the ability to set a timeout on a request. +func NewUpdateSSHKeyParamsWithTimeout(timeout time.Duration) *UpdateSSHKeyParams { + return &UpdateSSHKeyParams{ + timeout: timeout, + } +} + +// NewUpdateSSHKeyParamsWithContext creates a new UpdateSSHKeyParams object +// with the ability to set a context for a request. +func NewUpdateSSHKeyParamsWithContext(ctx context.Context) *UpdateSSHKeyParams { + return &UpdateSSHKeyParams{ + Context: ctx, + } +} + +// NewUpdateSSHKeyParamsWithHTTPClient creates a new UpdateSSHKeyParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateSSHKeyParamsWithHTTPClient(client *http.Client) *UpdateSSHKeyParams { + return &UpdateSSHKeyParams{ + HTTPClient: client, + } +} + +/* +UpdateSSHKeyParams contains all the parameters to send to the API endpoint + + for the update Ssh key operation. + + Typically these are written to a http.Request. +*/ +type UpdateSSHKeyParams struct { + + // Input. + Input *models.UpdateSSHKeyRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update Ssh key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSSHKeyParams) WithDefaults() *UpdateSSHKeyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update Ssh key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateSSHKeyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update Ssh key params +func (o *UpdateSSHKeyParams) WithTimeout(timeout time.Duration) *UpdateSSHKeyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update Ssh key params +func (o *UpdateSSHKeyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update Ssh key params +func (o *UpdateSSHKeyParams) WithContext(ctx context.Context) *UpdateSSHKeyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update Ssh key params +func (o *UpdateSSHKeyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update Ssh key params +func (o *UpdateSSHKeyParams) WithHTTPClient(client *http.Client) *UpdateSSHKeyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update Ssh key params +func (o *UpdateSSHKeyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the update Ssh key params +func (o *UpdateSSHKeyParams) WithInput(input *models.UpdateSSHKeyRequest) *UpdateSSHKeyParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the update Ssh key params +func (o *UpdateSSHKeyParams) SetInput(input *models.UpdateSSHKeyRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateSSHKeyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/update_ssh_key_responses.go b/cdp-sdk-go/gen/environments/client/operations/update_ssh_key_responses.go new file mode 100644 index 00000000..c3179b18 --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/update_ssh_key_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// UpdateSSHKeyReader is a Reader for the UpdateSSHKey structure. +type UpdateSSHKeyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateSSHKeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateSSHKeyOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewUpdateSSHKeyDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewUpdateSSHKeyOK creates a UpdateSSHKeyOK with default headers values +func NewUpdateSSHKeyOK() *UpdateSSHKeyOK { + return &UpdateSSHKeyOK{} +} + +/* +UpdateSSHKeyOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type UpdateSSHKeyOK struct { + Payload *models.UpdateSSHKeyResponse +} + +// IsSuccess returns true when this update Ssh key o k response has a 2xx status code +func (o *UpdateSSHKeyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update Ssh key o k response has a 3xx status code +func (o *UpdateSSHKeyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update Ssh key o k response has a 4xx status code +func (o *UpdateSSHKeyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update Ssh key o k response has a 5xx status code +func (o *UpdateSSHKeyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update Ssh key o k response a status code equal to that given +func (o *UpdateSSHKeyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update Ssh key o k response +func (o *UpdateSSHKeyOK) Code() int { + return 200 +} + +func (o *UpdateSSHKeyOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateSshKey][%d] updateSshKeyOK %+v", 200, o.Payload) +} + +func (o *UpdateSSHKeyOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateSshKey][%d] updateSshKeyOK %+v", 200, o.Payload) +} + +func (o *UpdateSSHKeyOK) GetPayload() *models.UpdateSSHKeyResponse { + return o.Payload +} + +func (o *UpdateSSHKeyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.UpdateSSHKeyResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateSSHKeyDefault creates a UpdateSSHKeyDefault with default headers values +func NewUpdateSSHKeyDefault(code int) *UpdateSSHKeyDefault { + return &UpdateSSHKeyDefault{ + _statusCode: code, + } +} + +/* +UpdateSSHKeyDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type UpdateSSHKeyDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this update Ssh key default response has a 2xx status code +func (o *UpdateSSHKeyDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this update Ssh key default response has a 3xx status code +func (o *UpdateSSHKeyDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this update Ssh key default response has a 4xx status code +func (o *UpdateSSHKeyDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this update Ssh key default response has a 5xx status code +func (o *UpdateSSHKeyDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this update Ssh key default response a status code equal to that given +func (o *UpdateSSHKeyDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the update Ssh key default response +func (o *UpdateSSHKeyDefault) Code() int { + return o._statusCode +} + +func (o *UpdateSSHKeyDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateSshKey][%d] updateSshKey default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateSSHKeyDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/updateSshKey][%d] updateSshKey default %+v", o._statusCode, o.Payload) +} + +func (o *UpdateSSHKeyDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *UpdateSSHKeyDefault) 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/cdp-sdk-go/gen/environments/client/operations/validate_aws_cloud_storage_parameters.go b/cdp-sdk-go/gen/environments/client/operations/validate_aws_cloud_storage_parameters.go new file mode 100644 index 00000000..17c0d52b --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/validate_aws_cloud_storage_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewValidateAwsCloudStorageParams creates a new ValidateAwsCloudStorageParams 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 NewValidateAwsCloudStorageParams() *ValidateAwsCloudStorageParams { + return &ValidateAwsCloudStorageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewValidateAwsCloudStorageParamsWithTimeout creates a new ValidateAwsCloudStorageParams object +// with the ability to set a timeout on a request. +func NewValidateAwsCloudStorageParamsWithTimeout(timeout time.Duration) *ValidateAwsCloudStorageParams { + return &ValidateAwsCloudStorageParams{ + timeout: timeout, + } +} + +// NewValidateAwsCloudStorageParamsWithContext creates a new ValidateAwsCloudStorageParams object +// with the ability to set a context for a request. +func NewValidateAwsCloudStorageParamsWithContext(ctx context.Context) *ValidateAwsCloudStorageParams { + return &ValidateAwsCloudStorageParams{ + Context: ctx, + } +} + +// NewValidateAwsCloudStorageParamsWithHTTPClient creates a new ValidateAwsCloudStorageParams object +// with the ability to set a custom HTTPClient for a request. +func NewValidateAwsCloudStorageParamsWithHTTPClient(client *http.Client) *ValidateAwsCloudStorageParams { + return &ValidateAwsCloudStorageParams{ + HTTPClient: client, + } +} + +/* +ValidateAwsCloudStorageParams contains all the parameters to send to the API endpoint + + for the validate aws cloud storage operation. + + Typically these are written to a http.Request. +*/ +type ValidateAwsCloudStorageParams struct { + + // Input. + Input *models.ValidateAwsCloudStorageRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the validate aws cloud storage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateAwsCloudStorageParams) WithDefaults() *ValidateAwsCloudStorageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the validate aws cloud storage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateAwsCloudStorageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) WithTimeout(timeout time.Duration) *ValidateAwsCloudStorageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) WithContext(ctx context.Context) *ValidateAwsCloudStorageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) WithHTTPClient(client *http.Client) *ValidateAwsCloudStorageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) WithInput(input *models.ValidateAwsCloudStorageRequest) *ValidateAwsCloudStorageParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the validate aws cloud storage params +func (o *ValidateAwsCloudStorageParams) SetInput(input *models.ValidateAwsCloudStorageRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *ValidateAwsCloudStorageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/validate_aws_cloud_storage_responses.go b/cdp-sdk-go/gen/environments/client/operations/validate_aws_cloud_storage_responses.go new file mode 100644 index 00000000..eb6237ff --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/validate_aws_cloud_storage_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// ValidateAwsCloudStorageReader is a Reader for the ValidateAwsCloudStorage structure. +type ValidateAwsCloudStorageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ValidateAwsCloudStorageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewValidateAwsCloudStorageOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewValidateAwsCloudStorageDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewValidateAwsCloudStorageOK creates a ValidateAwsCloudStorageOK with default headers values +func NewValidateAwsCloudStorageOK() *ValidateAwsCloudStorageOK { + return &ValidateAwsCloudStorageOK{} +} + +/* +ValidateAwsCloudStorageOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type ValidateAwsCloudStorageOK struct { + Payload *models.ValidateAwsCloudStorageResponse +} + +// IsSuccess returns true when this validate aws cloud storage o k response has a 2xx status code +func (o *ValidateAwsCloudStorageOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate aws cloud storage o k response has a 3xx status code +func (o *ValidateAwsCloudStorageOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate aws cloud storage o k response has a 4xx status code +func (o *ValidateAwsCloudStorageOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate aws cloud storage o k response has a 5xx status code +func (o *ValidateAwsCloudStorageOK) IsServerError() bool { + return false +} + +// IsCode returns true when this validate aws cloud storage o k response a status code equal to that given +func (o *ValidateAwsCloudStorageOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the validate aws cloud storage o k response +func (o *ValidateAwsCloudStorageOK) Code() int { + return 200 +} + +func (o *ValidateAwsCloudStorageOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/validateAwsCloudStorage][%d] validateAwsCloudStorageOK %+v", 200, o.Payload) +} + +func (o *ValidateAwsCloudStorageOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/validateAwsCloudStorage][%d] validateAwsCloudStorageOK %+v", 200, o.Payload) +} + +func (o *ValidateAwsCloudStorageOK) GetPayload() *models.ValidateAwsCloudStorageResponse { + return o.Payload +} + +func (o *ValidateAwsCloudStorageOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ValidateAwsCloudStorageResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateAwsCloudStorageDefault creates a ValidateAwsCloudStorageDefault with default headers values +func NewValidateAwsCloudStorageDefault(code int) *ValidateAwsCloudStorageDefault { + return &ValidateAwsCloudStorageDefault{ + _statusCode: code, + } +} + +/* +ValidateAwsCloudStorageDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type ValidateAwsCloudStorageDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this validate aws cloud storage default response has a 2xx status code +func (o *ValidateAwsCloudStorageDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this validate aws cloud storage default response has a 3xx status code +func (o *ValidateAwsCloudStorageDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this validate aws cloud storage default response has a 4xx status code +func (o *ValidateAwsCloudStorageDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this validate aws cloud storage default response has a 5xx status code +func (o *ValidateAwsCloudStorageDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this validate aws cloud storage default response a status code equal to that given +func (o *ValidateAwsCloudStorageDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the validate aws cloud storage default response +func (o *ValidateAwsCloudStorageDefault) Code() int { + return o._statusCode +} + +func (o *ValidateAwsCloudStorageDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/validateAwsCloudStorage][%d] validateAwsCloudStorage default %+v", o._statusCode, o.Payload) +} + +func (o *ValidateAwsCloudStorageDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/validateAwsCloudStorage][%d] validateAwsCloudStorage default %+v", o._statusCode, o.Payload) +} + +func (o *ValidateAwsCloudStorageDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ValidateAwsCloudStorageDefault) 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/cdp-sdk-go/gen/environments/client/operations/validate_azure_cloud_storage_parameters.go b/cdp-sdk-go/gen/environments/client/operations/validate_azure_cloud_storage_parameters.go new file mode 100644 index 00000000..59f14b9f --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/validate_azure_cloud_storage_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// NewValidateAzureCloudStorageParams creates a new ValidateAzureCloudStorageParams 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 NewValidateAzureCloudStorageParams() *ValidateAzureCloudStorageParams { + return &ValidateAzureCloudStorageParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewValidateAzureCloudStorageParamsWithTimeout creates a new ValidateAzureCloudStorageParams object +// with the ability to set a timeout on a request. +func NewValidateAzureCloudStorageParamsWithTimeout(timeout time.Duration) *ValidateAzureCloudStorageParams { + return &ValidateAzureCloudStorageParams{ + timeout: timeout, + } +} + +// NewValidateAzureCloudStorageParamsWithContext creates a new ValidateAzureCloudStorageParams object +// with the ability to set a context for a request. +func NewValidateAzureCloudStorageParamsWithContext(ctx context.Context) *ValidateAzureCloudStorageParams { + return &ValidateAzureCloudStorageParams{ + Context: ctx, + } +} + +// NewValidateAzureCloudStorageParamsWithHTTPClient creates a new ValidateAzureCloudStorageParams object +// with the ability to set a custom HTTPClient for a request. +func NewValidateAzureCloudStorageParamsWithHTTPClient(client *http.Client) *ValidateAzureCloudStorageParams { + return &ValidateAzureCloudStorageParams{ + HTTPClient: client, + } +} + +/* +ValidateAzureCloudStorageParams contains all the parameters to send to the API endpoint + + for the validate azure cloud storage operation. + + Typically these are written to a http.Request. +*/ +type ValidateAzureCloudStorageParams struct { + + // Input. + Input *models.ValidateAzureCloudStorageRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the validate azure cloud storage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateAzureCloudStorageParams) WithDefaults() *ValidateAzureCloudStorageParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the validate azure cloud storage params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ValidateAzureCloudStorageParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) WithTimeout(timeout time.Duration) *ValidateAzureCloudStorageParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) WithContext(ctx context.Context) *ValidateAzureCloudStorageParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) WithHTTPClient(client *http.Client) *ValidateAzureCloudStorageParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) WithInput(input *models.ValidateAzureCloudStorageRequest) *ValidateAzureCloudStorageParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the validate azure cloud storage params +func (o *ValidateAzureCloudStorageParams) SetInput(input *models.ValidateAzureCloudStorageRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *ValidateAzureCloudStorageParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/environments/client/operations/validate_azure_cloud_storage_responses.go b/cdp-sdk-go/gen/environments/client/operations/validate_azure_cloud_storage_responses.go new file mode 100644 index 00000000..7685395d --- /dev/null +++ b/cdp-sdk-go/gen/environments/client/operations/validate_azure_cloud_storage_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" +) + +// ValidateAzureCloudStorageReader is a Reader for the ValidateAzureCloudStorage structure. +type ValidateAzureCloudStorageReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ValidateAzureCloudStorageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewValidateAzureCloudStorageOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewValidateAzureCloudStorageDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewValidateAzureCloudStorageOK creates a ValidateAzureCloudStorageOK with default headers values +func NewValidateAzureCloudStorageOK() *ValidateAzureCloudStorageOK { + return &ValidateAzureCloudStorageOK{} +} + +/* +ValidateAzureCloudStorageOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type ValidateAzureCloudStorageOK struct { + Payload *models.ValidateAzureCloudStorageResponse +} + +// IsSuccess returns true when this validate azure cloud storage o k response has a 2xx status code +func (o *ValidateAzureCloudStorageOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this validate azure cloud storage o k response has a 3xx status code +func (o *ValidateAzureCloudStorageOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this validate azure cloud storage o k response has a 4xx status code +func (o *ValidateAzureCloudStorageOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this validate azure cloud storage o k response has a 5xx status code +func (o *ValidateAzureCloudStorageOK) IsServerError() bool { + return false +} + +// IsCode returns true when this validate azure cloud storage o k response a status code equal to that given +func (o *ValidateAzureCloudStorageOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the validate azure cloud storage o k response +func (o *ValidateAzureCloudStorageOK) Code() int { + return 200 +} + +func (o *ValidateAzureCloudStorageOK) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/validateAzureCloudStorage][%d] validateAzureCloudStorageOK %+v", 200, o.Payload) +} + +func (o *ValidateAzureCloudStorageOK) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/validateAzureCloudStorage][%d] validateAzureCloudStorageOK %+v", 200, o.Payload) +} + +func (o *ValidateAzureCloudStorageOK) GetPayload() *models.ValidateAzureCloudStorageResponse { + return o.Payload +} + +func (o *ValidateAzureCloudStorageOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ValidateAzureCloudStorageResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewValidateAzureCloudStorageDefault creates a ValidateAzureCloudStorageDefault with default headers values +func NewValidateAzureCloudStorageDefault(code int) *ValidateAzureCloudStorageDefault { + return &ValidateAzureCloudStorageDefault{ + _statusCode: code, + } +} + +/* +ValidateAzureCloudStorageDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type ValidateAzureCloudStorageDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this validate azure cloud storage default response has a 2xx status code +func (o *ValidateAzureCloudStorageDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this validate azure cloud storage default response has a 3xx status code +func (o *ValidateAzureCloudStorageDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this validate azure cloud storage default response has a 4xx status code +func (o *ValidateAzureCloudStorageDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this validate azure cloud storage default response has a 5xx status code +func (o *ValidateAzureCloudStorageDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this validate azure cloud storage default response a status code equal to that given +func (o *ValidateAzureCloudStorageDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the validate azure cloud storage default response +func (o *ValidateAzureCloudStorageDefault) Code() int { + return o._statusCode +} + +func (o *ValidateAzureCloudStorageDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/environments2/validateAzureCloudStorage][%d] validateAzureCloudStorage default %+v", o._statusCode, o.Payload) +} + +func (o *ValidateAzureCloudStorageDefault) String() string { + return fmt.Sprintf("[POST /api/v1/environments2/validateAzureCloudStorage][%d] validateAzureCloudStorage default %+v", o._statusCode, o.Payload) +} + +func (o *ValidateAzureCloudStorageDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ValidateAzureCloudStorageDefault) 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/cdp-sdk-go/gen/environments/models/aws_credential_properties.go b/cdp-sdk-go/gen/environments/models/aws_credential_properties.go index 680de8d8..64d55b38 100644 --- a/cdp-sdk-go/gen/environments/models/aws_credential_properties.go +++ b/cdp-sdk-go/gen/environments/models/aws_credential_properties.go @@ -17,6 +17,9 @@ import ( // swagger:model AwsCredentialProperties type AwsCredentialProperties struct { + // Flag that indicates that the given AWS credential is GovCloud specfic. + GovCloud bool `json:"govCloud,omitempty"` + // The AWS role arn for the given credential. RoleArn string `json:"roleArn,omitempty"` } diff --git a/cdp-sdk-go/gen/environments/models/azure_data_services_parameters.go b/cdp-sdk-go/gen/environments/models/azure_data_services_parameters.go new file mode 100644 index 00000000..c1d406d5 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/azure_data_services_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AzureDataServicesParameters Azure-specific Data Service parameters response. +// +// swagger:model AzureDataServicesParameters +type AzureDataServicesParameters struct { + + // User-assigned managed identity used by the AKS control plane. + // Required: true + SharedManagedIdentity *string `json:"sharedManagedIdentity"` +} + +// Validate validates this azure data services parameters +func (m *AzureDataServicesParameters) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSharedManagedIdentity(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AzureDataServicesParameters) validateSharedManagedIdentity(formats strfmt.Registry) error { + + if err := validate.Required("sharedManagedIdentity", "body", m.SharedManagedIdentity); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this azure data services parameters based on context it is used +func (m *AzureDataServicesParameters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AzureDataServicesParameters) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AzureDataServicesParameters) UnmarshalBinary(b []byte) error { + var res AzureDataServicesParameters + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/azure_data_services_parameters_request.go b/cdp-sdk-go/gen/environments/models/azure_data_services_parameters_request.go new file mode 100644 index 00000000..28bfaea7 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/azure_data_services_parameters_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AzureDataServicesParametersRequest Azure-specific Data Service parameters request. +// +// swagger:model AzureDataServicesParametersRequest +type AzureDataServicesParametersRequest struct { + + // User-assigned managed identity used by the AKS control plane. + // Required: true + SharedManagedIdentity *string `json:"sharedManagedIdentity"` +} + +// Validate validates this azure data services parameters request +func (m *AzureDataServicesParametersRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSharedManagedIdentity(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AzureDataServicesParametersRequest) validateSharedManagedIdentity(formats strfmt.Registry) error { + + if err := validate.Required("sharedManagedIdentity", "body", m.SharedManagedIdentity); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this azure data services parameters request based on context it is used +func (m *AzureDataServicesParametersRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AzureDataServicesParametersRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AzureDataServicesParametersRequest) UnmarshalBinary(b []byte) error { + var res AzureDataServicesParametersRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/azure_database_resources.go b/cdp-sdk-go/gen/environments/models/azure_database_resources.go new file mode 100644 index 00000000..c7dfbd0f --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/azure_database_resources.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AzureDatabaseResources Object containing details of database resources for Azure cloud. +// +// swagger:model AzureDatabaseResources +type AzureDatabaseResources struct { + + // The full Azure resource ID of the existing Private DNS Zone used for Flexible Server and Single Server Databases. + DatabasePrivateDNSZoneID string `json:"databasePrivateDnsZoneId,omitempty"` + + // The subnets delegated for Flexible Server database. Accepts either the name or the full resource id. + FlexibleServerSubnetIds []string `json:"flexibleServerSubnetIds"` +} + +// Validate validates this azure database resources +func (m *AzureDatabaseResources) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this azure database resources based on context it is used +func (m *AzureDatabaseResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AzureDatabaseResources) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AzureDatabaseResources) UnmarshalBinary(b []byte) error { + var res AzureDatabaseResources + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/azure_free_ipa_creation_request.go b/cdp-sdk-go/gen/environments/models/azure_free_ipa_creation_request.go index fd70d95b..4ca54863 100644 --- a/cdp-sdk-go/gen/environments/models/azure_free_ipa_creation_request.go +++ b/cdp-sdk-go/gen/environments/models/azure_free_ipa_creation_request.go @@ -23,6 +23,9 @@ type AzureFreeIpaCreationRequest struct { // Custom instance type of FreeIPA instances. InstanceType string `json:"instanceType,omitempty"` + // Flag that enables deployment of the FreeIPA in a multi-availability zone. + MultiAz *bool `json:"multiAz,omitempty"` + // The recipes for the FreeIPA cluster. Recipes []string `json:"recipes"` } diff --git a/cdp-sdk-go/gen/environments/models/connected_data_service.go b/cdp-sdk-go/gen/environments/models/connected_data_service.go new file mode 100644 index 00000000..7ba87fff --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/connected_data_service.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ConnectedDataService A single entry that contains the name of the given Data Service and its related resource(s). +// +// swagger:model ConnectedDataService +type ConnectedDataService struct { + + // List of resource names for the given Data Service. + // Required: true + Clusters []string `json:"clusters"` + + // The name of the given Data Service. + // Required: true + Name *string `json:"name"` +} + +// Validate validates this connected data service +func (m *ConnectedDataService) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClusters(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConnectedDataService) validateClusters(formats strfmt.Registry) error { + + if err := validate.Required("clusters", "body", m.Clusters); err != nil { + return err + } + + return nil +} + +func (m *ConnectedDataService) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this connected data service based on context it is used +func (m *ConnectedDataService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ConnectedDataService) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConnectedDataService) UnmarshalBinary(b []byte) error { + var res ConnectedDataService + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/create_a_w_s_environment_request.go b/cdp-sdk-go/gen/environments/models/create_a_w_s_environment_request.go index 1690d81d..a46ac9db 100644 --- a/cdp-sdk-go/gen/environments/models/create_a_w_s_environment_request.go +++ b/cdp-sdk-go/gen/environments/models/create_a_w_s_environment_request.go @@ -39,7 +39,7 @@ type CreateAWSEnvironmentRequest struct { Description string `json:"description,omitempty"` // Whether to enable SSH tunneling for the environment. - EnableTunnel bool `json:"enableTunnel,omitempty"` + EnableTunnel *bool `json:"enableTunnel,omitempty"` // ARN of the AWS KMS CMK to use for the server-side encryption of AWS storage resources. EncryptionKeyArn string `json:"encryptionKeyArn,omitempty"` diff --git a/cdp-sdk-go/gen/environments/models/create_a_w_s_gov_cloud_credential_request.go b/cdp-sdk-go/gen/environments/models/create_a_w_s_gov_cloud_credential_request.go new file mode 100644 index 00000000..ab1b020a --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/create_a_w_s_gov_cloud_credential_request.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateAWSGovCloudCredentialRequest Request object for a create AWS credential request for GovCloud. +// +// swagger:model CreateAWSGovCloudCredentialRequest +type CreateAWSGovCloudCredentialRequest struct { + + // The name of the credential. + // Required: true + CredentialName *string `json:"credentialName"` + + // A description for the credential. + Description string `json:"description,omitempty"` + + // The ARN of the delegated access role. + // Required: true + RoleArn *string `json:"roleArn"` +} + +// Validate validates this create a w s gov cloud credential request +func (m *CreateAWSGovCloudCredentialRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCredentialName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoleArn(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudCredentialRequest) validateCredentialName(formats strfmt.Registry) error { + + if err := validate.Required("credentialName", "body", m.CredentialName); err != nil { + return err + } + + return nil +} + +func (m *CreateAWSGovCloudCredentialRequest) validateRoleArn(formats strfmt.Registry) error { + + if err := validate.Required("roleArn", "body", m.RoleArn); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create a w s gov cloud credential request based on context it is used +func (m *CreateAWSGovCloudCredentialRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAWSGovCloudCredentialRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAWSGovCloudCredentialRequest) UnmarshalBinary(b []byte) error { + var res CreateAWSGovCloudCredentialRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/create_a_w_s_gov_cloud_credential_response.go b/cdp-sdk-go/gen/environments/models/create_a_w_s_gov_cloud_credential_response.go new file mode 100644 index 00000000..ff0b5d0d --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/create_a_w_s_gov_cloud_credential_response.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateAWSGovCloudCredentialResponse Response object for a create AWS credential request for GovCloud. +// +// swagger:model CreateAWSGovCloudCredentialResponse +type CreateAWSGovCloudCredentialResponse struct { + + // The credential object. + // Required: true + Credential *Credential `json:"credential"` +} + +// Validate validates this create a w s gov cloud credential response +func (m *CreateAWSGovCloudCredentialResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCredential(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudCredentialResponse) validateCredential(formats strfmt.Registry) error { + + if err := validate.Required("credential", "body", m.Credential); err != nil { + return err + } + + if m.Credential != nil { + if err := m.Credential.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("credential") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("credential") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create a w s gov cloud credential response based on the context it is used +func (m *CreateAWSGovCloudCredentialResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCredential(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudCredentialResponse) contextValidateCredential(ctx context.Context, formats strfmt.Registry) error { + + if m.Credential != nil { + + if err := m.Credential.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("credential") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("credential") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAWSGovCloudCredentialResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAWSGovCloudCredentialResponse) UnmarshalBinary(b []byte) error { + var res CreateAWSGovCloudCredentialResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/create_a_w_s_gov_cloud_environment_request.go b/cdp-sdk-go/gen/environments/models/create_a_w_s_gov_cloud_environment_request.go new file mode 100644 index 00000000..e52b30e0 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/create_a_w_s_gov_cloud_environment_request.go @@ -0,0 +1,529 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateAWSGovCloudEnvironmentRequest Request object for a create AWS GovCloud environment request. +// +// swagger:model CreateAWSGovCloudEnvironmentRequest +type CreateAWSGovCloudEnvironmentRequest struct { + + // SSH authentication information for accessing cluster node instances. Users with access to this authentication information have root level access to the Data Lake and Data Hub cluster instances. + // Required: true + Authentication *AuthenticationRequest `json:"authentication"` + + // Whether to create private subnets or not. + CreatePrivateSubnets bool `json:"createPrivateSubnets,omitempty"` + + // Whether to create service endpoints or not. + CreateServiceEndpoints bool `json:"createServiceEndpoints,omitempty"` + + // Name of the credential to use for the environment. + // Required: true + CredentialName *string `json:"credentialName"` + + // An description of the environment. + Description string `json:"description,omitempty"` + + // Whether to enable SSH tunneling for the environment. + EnableTunnel *bool `json:"enableTunnel,omitempty"` + + // ARN of the AWS KMS CMK to use for the server-side encryption of AWS storage resources. + EncryptionKeyArn string `json:"encryptionKeyArn,omitempty"` + + // The scheme for the endpoint gateway. PUBLIC creates an external endpoint that can be accessed over the Internet. Defaults to PRIVATE which restricts the traffic to be internal to the VPC. + // Enum: [PUBLIC PRIVATE] + EndpointAccessGatewayScheme string `json:"endpointAccessGatewayScheme,omitempty"` + + // The subnets to use for endpoint access gateway. + EndpointAccessGatewaySubnetIds []string `json:"endpointAccessGatewaySubnetIds"` + + // The name of the environment. Must contain only lowercase letters, numbers and hyphens. + // Required: true + EnvironmentName *string `json:"environmentName"` + + // The FreeIPA creation request for the environment + FreeIpa *AWSFreeIpaCreationRequest `json:"freeIpa,omitempty"` + + // The FreeIPA image request for the environment + Image *FreeIpaImageRequest `json:"image,omitempty"` + + // AWS storage configuration for cluster and audit logs. + // Required: true + LogStorage *AwsLogStorageRequest `json:"logStorage"` + + // The network CIDR. This will create a VPC along with subnets in multiple Availability Zones. + NetworkCidr string `json:"networkCidr,omitempty"` + + // Name of the proxy config to use for the environment. + ProxyConfigName string `json:"proxyConfigName,omitempty"` + + // The region of the environment. + // Required: true + Region *string `json:"region"` + + // When true, this will report additional diagnostic information back to Cloudera. + ReportDeploymentLogs bool `json:"reportDeploymentLogs,omitempty"` + + // The name for the DynamoDB table backing S3Guard. + S3GuardTableName string `json:"s3GuardTableName,omitempty"` + + // Security control for FreeIPA and Data Lake deployment. + // Required: true + SecurityAccess *SecurityAccessRequest `json:"securityAccess"` + + // One or more subnet IDs within the VPC. Mutually exclusive with networkCidr. + // Unique: true + SubnetIds []string `json:"subnetIds"` + + // Tags associated with the resources. + Tags []*TagRequest `json:"tags"` + + // The Amazon VPC ID. Mutually exclusive with networkCidr. + VpcID string `json:"vpcId,omitempty"` + + // When this is enabled, diagnostic information about job and query execution is sent to Workload Manager for Data Hub clusters created within this environment. + WorkloadAnalytics bool `json:"workloadAnalytics,omitempty"` +} + +// Validate validates this create a w s gov cloud environment request +func (m *CreateAWSGovCloudEnvironmentRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAuthentication(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCredentialName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEndpointAccessGatewayScheme(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvironmentName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFreeIpa(formats); err != nil { + res = append(res, err) + } + + if err := m.validateImage(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLogStorage(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegion(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecurityAccess(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubnetIds(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) validateAuthentication(formats strfmt.Registry) error { + + if err := validate.Required("authentication", "body", m.Authentication); err != nil { + return err + } + + if m.Authentication != nil { + if err := m.Authentication.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) validateCredentialName(formats strfmt.Registry) error { + + if err := validate.Required("credentialName", "body", m.CredentialName); err != nil { + return err + } + + return nil +} + +var createAWSGovCloudEnvironmentRequestTypeEndpointAccessGatewaySchemePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["PUBLIC","PRIVATE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createAWSGovCloudEnvironmentRequestTypeEndpointAccessGatewaySchemePropEnum = append(createAWSGovCloudEnvironmentRequestTypeEndpointAccessGatewaySchemePropEnum, v) + } +} + +const ( + + // CreateAWSGovCloudEnvironmentRequestEndpointAccessGatewaySchemePUBLIC captures enum value "PUBLIC" + CreateAWSGovCloudEnvironmentRequestEndpointAccessGatewaySchemePUBLIC string = "PUBLIC" + + // CreateAWSGovCloudEnvironmentRequestEndpointAccessGatewaySchemePRIVATE captures enum value "PRIVATE" + CreateAWSGovCloudEnvironmentRequestEndpointAccessGatewaySchemePRIVATE string = "PRIVATE" +) + +// prop value enum +func (m *CreateAWSGovCloudEnvironmentRequest) validateEndpointAccessGatewaySchemeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createAWSGovCloudEnvironmentRequestTypeEndpointAccessGatewaySchemePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) validateEndpointAccessGatewayScheme(formats strfmt.Registry) error { + if swag.IsZero(m.EndpointAccessGatewayScheme) { // not required + return nil + } + + // value enum + if err := m.validateEndpointAccessGatewaySchemeEnum("endpointAccessGatewayScheme", "body", m.EndpointAccessGatewayScheme); err != nil { + return err + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) validateEnvironmentName(formats strfmt.Registry) error { + + if err := validate.Required("environmentName", "body", m.EnvironmentName); err != nil { + return err + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) validateFreeIpa(formats strfmt.Registry) error { + if swag.IsZero(m.FreeIpa) { // not required + return nil + } + + if m.FreeIpa != nil { + if err := m.FreeIpa.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("freeIpa") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("freeIpa") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) validateImage(formats strfmt.Registry) error { + if swag.IsZero(m.Image) { // not required + return nil + } + + if m.Image != nil { + if err := m.Image.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("image") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("image") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) validateLogStorage(formats strfmt.Registry) error { + + if err := validate.Required("logStorage", "body", m.LogStorage); err != nil { + return err + } + + if m.LogStorage != nil { + if err := m.LogStorage.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("logStorage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("logStorage") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) validateRegion(formats strfmt.Registry) error { + + if err := validate.Required("region", "body", m.Region); err != nil { + return err + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) validateSecurityAccess(formats strfmt.Registry) error { + + if err := validate.Required("securityAccess", "body", m.SecurityAccess); err != nil { + return err + } + + if m.SecurityAccess != nil { + if err := m.SecurityAccess.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("securityAccess") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("securityAccess") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) validateSubnetIds(formats strfmt.Registry) error { + if swag.IsZero(m.SubnetIds) { // not required + return nil + } + + if err := validate.UniqueItems("subnetIds", "body", m.SubnetIds); err != nil { + return err + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this create a w s gov cloud environment request based on the context it is used +func (m *CreateAWSGovCloudEnvironmentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAuthentication(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFreeIpa(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateImage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLogStorage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecurityAccess(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) contextValidateAuthentication(ctx context.Context, formats strfmt.Registry) error { + + if m.Authentication != nil { + + if err := m.Authentication.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("authentication") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("authentication") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) contextValidateFreeIpa(ctx context.Context, formats strfmt.Registry) error { + + if m.FreeIpa != nil { + + if swag.IsZero(m.FreeIpa) { // not required + return nil + } + + if err := m.FreeIpa.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("freeIpa") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("freeIpa") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) contextValidateImage(ctx context.Context, formats strfmt.Registry) error { + + if m.Image != nil { + + if swag.IsZero(m.Image) { // not required + return nil + } + + if err := m.Image.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("image") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("image") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) contextValidateLogStorage(ctx context.Context, formats strfmt.Registry) error { + + if m.LogStorage != nil { + + if err := m.LogStorage.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("logStorage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("logStorage") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) contextValidateSecurityAccess(ctx context.Context, formats strfmt.Registry) error { + + if m.SecurityAccess != nil { + + if err := m.SecurityAccess.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("securityAccess") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("securityAccess") + } + return err + } + } + + return nil +} + +func (m *CreateAWSGovCloudEnvironmentRequest) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + + if swag.IsZero(m.Tags[i]) { // not required + return nil + } + + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAWSGovCloudEnvironmentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAWSGovCloudEnvironmentRequest) UnmarshalBinary(b []byte) error { + var res CreateAWSGovCloudEnvironmentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/create_a_w_s_gov_cloud_environment_response.go b/cdp-sdk-go/gen/environments/models/create_a_w_s_gov_cloud_environment_response.go new file mode 100644 index 00000000..9a70593f --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/create_a_w_s_gov_cloud_environment_response.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateAWSGovCloudEnvironmentResponse Response object for a create AWS GovCloud environment request. +// +// swagger:model CreateAWSGovCloudEnvironmentResponse +type CreateAWSGovCloudEnvironmentResponse struct { + + // Created environment object. + // Required: true + Environment *Environment `json:"environment"` +} + +// Validate validates this create a w s gov cloud environment response +func (m *CreateAWSGovCloudEnvironmentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnvironment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudEnvironmentResponse) validateEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("environment", "body", m.Environment); err != nil { + return err + } + + if m.Environment != nil { + if err := m.Environment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environment") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create a w s gov cloud environment response based on the context it is used +func (m *CreateAWSGovCloudEnvironmentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEnvironment(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateAWSGovCloudEnvironmentResponse) contextValidateEnvironment(ctx context.Context, formats strfmt.Registry) error { + + if m.Environment != nil { + + if err := m.Environment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environment") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAWSGovCloudEnvironmentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAWSGovCloudEnvironmentResponse) UnmarshalBinary(b []byte) error { + var res CreateAWSGovCloudEnvironmentResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/create_azure_environment_request.go b/cdp-sdk-go/gen/environments/models/create_azure_environment_request.go index 77c38238..60cdf5fd 100644 --- a/cdp-sdk-go/gen/environments/models/create_azure_environment_request.go +++ b/cdp-sdk-go/gen/environments/models/create_azure_environment_request.go @@ -28,6 +28,9 @@ type CreateAzureEnvironmentRequest struct { // Required: true CredentialName *string `json:"credentialName"` + // Data Services parameters of the environment. + DataServices *DataServicesRequest `json:"dataServices,omitempty"` + // An description of the environment. Description string `json:"description,omitempty"` @@ -35,7 +38,7 @@ type CreateAzureEnvironmentRequest struct { EnableOutboundLoadBalancer bool `json:"enableOutboundLoadBalancer,omitempty"` // Whether to enable SSH tunneling for the environment. - EnableTunnel bool `json:"enableTunnel,omitempty"` + EnableTunnel *bool `json:"enableTunnel,omitempty"` // Name of the existing Azure resource group hosting the Azure Key Vault containing customer managed key which will be used to encrypt the Azure Managed Disks. It is required only when the entitlement is granted and the resource group of the key vault is different from the resource group in which the environment is to be created. Omitting it implies that, the key vault containing the encryption key is present in the same resource group where the environment would be created. EncryptionKeyResourceGroupName string `json:"encryptionKeyResourceGroupName,omitempty"` @@ -57,6 +60,9 @@ type CreateAzureEnvironmentRequest struct { // Parameters needed to use an existing VNet and Subnets. ExistingNetworkParams *ExistingAzureNetworkRequest `json:"existingNetworkParams,omitempty"` + // The subnets delegated for Flexible Server database. Accepts either the name or the full resource id. + FlexibleServerSubnetIds []string `json:"flexibleServerSubnetIds"` + // The FreeIPA creation request for the environment FreeIpa *AzureFreeIpaCreationRequest `json:"freeIpa,omitempty"` @@ -110,6 +116,10 @@ func (m *CreateAzureEnvironmentRequest) Validate(formats strfmt.Registry) error res = append(res, err) } + if err := m.validateDataServices(formats); err != nil { + res = append(res, err) + } + if err := m.validateEndpointAccessGatewayScheme(formats); err != nil { res = append(res, err) } @@ -173,6 +183,25 @@ func (m *CreateAzureEnvironmentRequest) validateCredentialName(formats strfmt.Re return nil } +func (m *CreateAzureEnvironmentRequest) validateDataServices(formats strfmt.Registry) error { + if swag.IsZero(m.DataServices) { // not required + return nil + } + + if m.DataServices != nil { + if err := m.DataServices.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dataServices") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dataServices") + } + return err + } + } + + return nil +} + var createAzureEnvironmentRequestTypeEndpointAccessGatewaySchemePropEnum []interface{} func init() { @@ -397,6 +426,10 @@ func (m *CreateAzureEnvironmentRequest) validateUsePublicIP(formats strfmt.Regis func (m *CreateAzureEnvironmentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateDataServices(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateExistingNetworkParams(ctx, formats); err != nil { res = append(res, err) } @@ -431,6 +464,27 @@ func (m *CreateAzureEnvironmentRequest) ContextValidate(ctx context.Context, for return nil } +func (m *CreateAzureEnvironmentRequest) contextValidateDataServices(ctx context.Context, formats strfmt.Registry) error { + + if m.DataServices != nil { + + if swag.IsZero(m.DataServices) { // not required + return nil + } + + if err := m.DataServices.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dataServices") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dataServices") + } + return err + } + } + + return nil +} + func (m *CreateAzureEnvironmentRequest) contextValidateExistingNetworkParams(ctx context.Context, formats strfmt.Registry) error { if m.ExistingNetworkParams != nil { diff --git a/cdp-sdk-go/gen/environments/models/create_g_c_p_environment_request.go b/cdp-sdk-go/gen/environments/models/create_g_c_p_environment_request.go index 75809a3f..47c8280b 100644 --- a/cdp-sdk-go/gen/environments/models/create_g_c_p_environment_request.go +++ b/cdp-sdk-go/gen/environments/models/create_g_c_p_environment_request.go @@ -32,7 +32,7 @@ type CreateGCPEnvironmentRequest struct { Description string `json:"description,omitempty"` // Whether to enable SSH tunneling for the environment. - EnableTunnel bool `json:"enableTunnel,omitempty"` + EnableTunnel *bool `json:"enableTunnel,omitempty"` // Key Resource ID of the customer managed encryption key to encrypt GCP resources. EncryptionKey string `json:"encryptionKey,omitempty"` diff --git a/cdp-sdk-go/gen/environments/models/data_services.go b/cdp-sdk-go/gen/environments/models/data_services.go new file mode 100644 index 00000000..6756c51f --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/data_services.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataServices Data Services parameters response of the environment. +// +// swagger:model DataServices +type DataServices struct { + + // Azure-specific Data Service parameters response. + Azure *AzureDataServicesParameters `json:"azure,omitempty"` +} + +// Validate validates this data services +func (m *DataServices) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAzure(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataServices) validateAzure(formats strfmt.Registry) error { + if swag.IsZero(m.Azure) { // not required + return nil + } + + if m.Azure != nil { + if err := m.Azure.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("azure") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("azure") + } + return err + } + } + + return nil +} + +// ContextValidate validate this data services based on the context it is used +func (m *DataServices) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAzure(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataServices) contextValidateAzure(ctx context.Context, formats strfmt.Registry) error { + + if m.Azure != nil { + + if swag.IsZero(m.Azure) { // not required + return nil + } + + if err := m.Azure.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("azure") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("azure") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataServices) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataServices) UnmarshalBinary(b []byte) error { + var res DataServices + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/data_services_request.go b/cdp-sdk-go/gen/environments/models/data_services_request.go new file mode 100644 index 00000000..a92bc11b --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/data_services_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataServicesRequest Data Services parameters request of the environment. +// +// swagger:model DataServicesRequest +type DataServicesRequest struct { + + // Azure-specific Data Service parameters request. + Azure *AzureDataServicesParametersRequest `json:"azure,omitempty"` +} + +// Validate validates this data services request +func (m *DataServicesRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAzure(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataServicesRequest) validateAzure(formats strfmt.Registry) error { + if swag.IsZero(m.Azure) { // not required + return nil + } + + if m.Azure != nil { + if err := m.Azure.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("azure") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("azure") + } + return err + } + } + + return nil +} + +// ContextValidate validate this data services request based on the context it is used +func (m *DataServicesRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAzure(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataServicesRequest) contextValidateAzure(ctx context.Context, formats strfmt.Registry) error { + + if m.Azure != nil { + + if swag.IsZero(m.Azure) { // not required + return nil + } + + if err := m.Azure.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("azure") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("azure") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataServicesRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataServicesRequest) UnmarshalBinary(b []byte) error { + var res DataServicesRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/downscale_freeipa_request.go b/cdp-sdk-go/gen/environments/models/downscale_freeipa_request.go index 62257959..201f4123 100644 --- a/cdp-sdk-go/gen/environments/models/downscale_freeipa_request.go +++ b/cdp-sdk-go/gen/environments/models/downscale_freeipa_request.go @@ -24,6 +24,9 @@ type DownscaleFreeipaRequest struct { // Required: true EnvironmentName *string `json:"environmentName"` + // The instance Ids to downscale. + Instances []string `json:"instances"` + // The target FreeIPA availability type. // Enum: [HA TWO_NODE_BASED] TargetAvailabilityType string `json:"targetAvailabilityType,omitempty"` diff --git a/cdp-sdk-go/gen/environments/models/environment.go b/cdp-sdk-go/gen/environments/models/environment.go index 018a3203..ebae4ee2 100644 --- a/cdp-sdk-go/gen/environments/models/environment.go +++ b/cdp-sdk-go/gen/environments/models/environment.go @@ -47,6 +47,9 @@ type Environment struct { // Required: true Crn *string `json:"crn"` + // Data Services parameters of the environment. + DataServices *DataServices `json:"dataServices,omitempty"` + // Description of the environment Description string `json:"description,omitempty"` @@ -133,6 +136,10 @@ func (m *Environment) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDataServices(formats); err != nil { + res = append(res, err) + } + if err := m.validateEnvironmentName(formats); err != nil { res = append(res, err) } @@ -279,6 +286,25 @@ func (m *Environment) validateCrn(formats strfmt.Registry) error { return nil } +func (m *Environment) validateDataServices(formats strfmt.Registry) error { + if swag.IsZero(m.DataServices) { // not required + return nil + } + + if m.DataServices != nil { + if err := m.DataServices.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dataServices") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dataServices") + } + return err + } + } + + return nil +} + func (m *Environment) validateEnvironmentName(formats strfmt.Registry) error { if err := validate.Required("environmentName", "body", m.EnvironmentName); err != nil { @@ -474,6 +500,10 @@ func (m *Environment) ContextValidate(ctx context.Context, formats strfmt.Regist res = append(res, err) } + if err := m.contextValidateDataServices(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateFreeipa(ctx, formats); err != nil { res = append(res, err) } @@ -575,6 +605,27 @@ func (m *Environment) contextValidateBackupStorage(ctx context.Context, formats return nil } +func (m *Environment) contextValidateDataServices(ctx context.Context, formats strfmt.Registry) error { + + if m.DataServices != nil { + + if swag.IsZero(m.DataServices) { // not required + return nil + } + + if err := m.DataServices.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dataServices") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dataServices") + } + return err + } + } + + return nil +} + func (m *Environment) contextValidateFreeipa(ctx context.Context, formats strfmt.Registry) error { if m.Freeipa != nil { diff --git a/cdp-sdk-go/gen/environments/models/existing_azure_network_request.go b/cdp-sdk-go/gen/environments/models/existing_azure_network_request.go index d4e6dee0..0a922160 100644 --- a/cdp-sdk-go/gen/environments/models/existing_azure_network_request.go +++ b/cdp-sdk-go/gen/environments/models/existing_azure_network_request.go @@ -19,10 +19,10 @@ import ( // swagger:model ExistingAzureNetworkRequest type ExistingAzureNetworkRequest struct { - // The ID of an existing private DNS zone used for the AKS. + // The full Azure resource ID of an existing Private DNS zone used for the AKS. AksPrivateDNSZoneID string `json:"aksPrivateDnsZoneId,omitempty"` - // The ID of an existing private DNS zone used for the database. + // The full Azure resource ID of the existing Private DNS Zone used for Flexible Server and Single Server Databases. DatabasePrivateDNSZoneID string `json:"databasePrivateDnsZoneId,omitempty"` // The id of the Azure VNet. diff --git a/cdp-sdk-go/gen/environments/models/existing_g_c_p_network_request.go b/cdp-sdk-go/gen/environments/models/existing_g_c_p_network_request.go index 9b51bdeb..e738bf30 100644 --- a/cdp-sdk-go/gen/environments/models/existing_g_c_p_network_request.go +++ b/cdp-sdk-go/gen/environments/models/existing_g_c_p_network_request.go @@ -24,8 +24,7 @@ type ExistingGCPNetworkRequest struct { NetworkName *string `json:"networkName"` // The ID of the Google project associated with the VPC. - // Required: true - SharedProjectID *string `json:"sharedProjectId"` + SharedProjectID string `json:"sharedProjectId,omitempty"` // One or more subnet names within the VPC. Google VPC's are global, please give subnets from single geographic region only to reduce latency. // Required: true @@ -41,10 +40,6 @@ func (m *ExistingGCPNetworkRequest) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateSharedProjectID(formats); err != nil { - res = append(res, err) - } - if err := m.validateSubnetNames(formats); err != nil { res = append(res, err) } @@ -64,15 +59,6 @@ func (m *ExistingGCPNetworkRequest) validateNetworkName(formats strfmt.Registry) return nil } -func (m *ExistingGCPNetworkRequest) validateSharedProjectID(formats strfmt.Registry) error { - - if err := validate.Required("sharedProjectId", "body", m.SharedProjectID); err != nil { - return err - } - - return nil -} - func (m *ExistingGCPNetworkRequest) validateSubnetNames(formats strfmt.Registry) error { if err := validate.Required("subnetNames", "body", m.SubnetNames); err != nil { diff --git a/cdp-sdk-go/gen/environments/models/free_ipa_image_request.go b/cdp-sdk-go/gen/environments/models/free_ipa_image_request.go index 19cfb414..b5aab1b3 100644 --- a/cdp-sdk-go/gen/environments/models/free_ipa_image_request.go +++ b/cdp-sdk-go/gen/environments/models/free_ipa_image_request.go @@ -22,6 +22,9 @@ type FreeIpaImageRequest struct { // Image ID to use for creating FreeIPA instances. ID string `json:"id,omitempty"` + + // The OS to use for creating FreeIPA instances. + Os string `json:"os,omitempty"` } // Validate validates this free ipa image request diff --git a/cdp-sdk-go/gen/environments/models/freeipa_details.go b/cdp-sdk-go/gen/environments/models/freeipa_details.go index 542ab852..800314c3 100644 --- a/cdp-sdk-go/gen/environments/models/freeipa_details.go +++ b/cdp-sdk-go/gen/environments/models/freeipa_details.go @@ -29,6 +29,9 @@ type FreeipaDetails struct { // The hostname of the FreeIPA cluster. Hostname string `json:"hostname,omitempty"` + // The number of FreeIPA instances to create per group when creating FreeIPA in environment. + InstanceCountByGroup int32 `json:"instanceCountByGroup,omitempty"` + // The instances of the FreeIPA cluster. // Unique: true Instances []*FreeIpaInstance `json:"instances"` diff --git a/cdp-sdk-go/gen/environments/models/gcp_credential_prerequisites_response.go b/cdp-sdk-go/gen/environments/models/gcp_credential_prerequisites_response.go new file mode 100644 index 00000000..c903aa64 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/gcp_credential_prerequisites_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GcpCredentialPrerequisitesResponse Response object for getting GCP credential prerequisites. +// +// swagger:model GcpCredentialPrerequisitesResponse +type GcpCredentialPrerequisitesResponse struct { + + // GCP CLI command to create service account encoded in base64. + // Required: true + ServiceAccountCreationCommand *string `json:"serviceAccountCreationCommand"` +} + +// Validate validates this gcp credential prerequisites response +func (m *GcpCredentialPrerequisitesResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateServiceAccountCreationCommand(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GcpCredentialPrerequisitesResponse) validateServiceAccountCreationCommand(formats strfmt.Registry) error { + + if err := validate.Required("serviceAccountCreationCommand", "body", m.ServiceAccountCreationCommand); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this gcp credential prerequisites response based on context it is used +func (m *GcpCredentialPrerequisitesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GcpCredentialPrerequisitesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GcpCredentialPrerequisitesResponse) UnmarshalBinary(b []byte) error { + var res GcpCredentialPrerequisitesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/get_audit_credential_prerequisites_request.go b/cdp-sdk-go/gen/environments/models/get_audit_credential_prerequisites_request.go index 1a472f5d..06013fdf 100644 --- a/cdp-sdk-go/gen/environments/models/get_audit_credential_prerequisites_request.go +++ b/cdp-sdk-go/gen/environments/models/get_audit_credential_prerequisites_request.go @@ -22,7 +22,7 @@ type GetAuditCredentialPrerequisitesRequest struct { // The kind of cloud platform. // Required: true - // Enum: [AWS AZURE] + // Enum: [AWS AZURE GCP] CloudPlatform *string `json:"cloudPlatform"` } @@ -44,7 +44,7 @@ var getAuditCredentialPrerequisitesRequestTypeCloudPlatformPropEnum []interface{ func init() { var res []string - if err := json.Unmarshal([]byte(`["AWS","AZURE"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["AWS","AZURE","GCP"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -59,6 +59,9 @@ const ( // GetAuditCredentialPrerequisitesRequestCloudPlatformAZURE captures enum value "AZURE" GetAuditCredentialPrerequisitesRequestCloudPlatformAZURE string = "AZURE" + + // GetAuditCredentialPrerequisitesRequestCloudPlatformGCP captures enum value "GCP" + GetAuditCredentialPrerequisitesRequestCloudPlatformGCP string = "GCP" ) // prop value enum diff --git a/cdp-sdk-go/gen/environments/models/get_audit_credential_prerequisites_response.go b/cdp-sdk-go/gen/environments/models/get_audit_credential_prerequisites_response.go index e5ac9f27..268aa161 100644 --- a/cdp-sdk-go/gen/environments/models/get_audit_credential_prerequisites_response.go +++ b/cdp-sdk-go/gen/environments/models/get_audit_credential_prerequisites_response.go @@ -31,6 +31,9 @@ type GetAuditCredentialPrerequisitesResponse struct { // The name of the given cloud platform // Required: true CloudPlatform *string `json:"cloudPlatform"` + + // Provides the service account creation command for GCP credential creation. + Gcp *GcpCredentialPrerequisitesResponse `json:"gcp,omitempty"` } // Validate validates this get audit credential prerequisites response @@ -49,6 +52,10 @@ func (m *GetAuditCredentialPrerequisitesResponse) Validate(formats strfmt.Regist res = append(res, err) } + if err := m.validateGcp(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -102,6 +109,25 @@ func (m *GetAuditCredentialPrerequisitesResponse) validateCloudPlatform(formats return nil } +func (m *GetAuditCredentialPrerequisitesResponse) validateGcp(formats strfmt.Registry) error { + if swag.IsZero(m.Gcp) { // not required + return nil + } + + if m.Gcp != nil { + if err := m.Gcp.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("gcp") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("gcp") + } + return err + } + } + + return nil +} + // ContextValidate validate this get audit credential prerequisites response based on the context it is used func (m *GetAuditCredentialPrerequisitesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -114,6 +140,10 @@ func (m *GetAuditCredentialPrerequisitesResponse) ContextValidate(ctx context.Co res = append(res, err) } + if err := m.contextValidateGcp(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -162,6 +192,27 @@ func (m *GetAuditCredentialPrerequisitesResponse) contextValidateAzure(ctx conte return nil } +func (m *GetAuditCredentialPrerequisitesResponse) contextValidateGcp(ctx context.Context, formats strfmt.Registry) error { + + if m.Gcp != nil { + + if swag.IsZero(m.Gcp) { // not required + return nil + } + + if err := m.Gcp.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("gcp") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("gcp") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *GetAuditCredentialPrerequisitesResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/cdp-sdk-go/gen/environments/models/get_azure_image_terms_policy_request.go b/cdp-sdk-go/gen/environments/models/get_azure_image_terms_policy_request.go new file mode 100644 index 00000000..72ed9a04 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/get_azure_image_terms_policy_request.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// GetAzureImageTermsPolicyRequest Request object to retrieve current value of setting that controls automatic acceptance of Azure Marketplace image terms. +// +// swagger:model GetAzureImageTermsPolicyRequest +type GetAzureImageTermsPolicyRequest interface{} diff --git a/cdp-sdk-go/gen/environments/models/get_azure_image_terms_policy_response.go b/cdp-sdk-go/gen/environments/models/get_azure_image_terms_policy_response.go new file mode 100644 index 00000000..6b8bb57b --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/get_azure_image_terms_policy_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GetAzureImageTermsPolicyResponse Response object to retrieve current value of setting that controls automatic acceptance of Azure Marketplace image terms. +// +// swagger:model GetAzureImageTermsPolicyResponse +type GetAzureImageTermsPolicyResponse struct { + + // Flag denoting whether automatic Azure Marketplace image terms acceptance is enabled or disabled. + // Required: true + Accepted *bool `json:"accepted"` +} + +// Validate validates this get azure image terms policy response +func (m *GetAzureImageTermsPolicyResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccepted(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetAzureImageTermsPolicyResponse) validateAccepted(formats strfmt.Registry) error { + + if err := validate.Required("accepted", "body", m.Accepted); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this get azure image terms policy response based on context it is used +func (m *GetAzureImageTermsPolicyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetAzureImageTermsPolicyResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetAzureImageTermsPolicyResponse) UnmarshalBinary(b []byte) error { + var res GetAzureImageTermsPolicyResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/get_gov_cloud_audit_credential_prerequisites_request.go b/cdp-sdk-go/gen/environments/models/get_gov_cloud_audit_credential_prerequisites_request.go new file mode 100644 index 00000000..ea1fe7c0 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/get_gov_cloud_audit_credential_prerequisites_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GetGovCloudAuditCredentialPrerequisitesRequest Request object for getting the audit credential prerequisites for GovCloud for the enabled providers. +// +// swagger:model GetGovCloudAuditCredentialPrerequisitesRequest +type GetGovCloudAuditCredentialPrerequisitesRequest struct { + + // The kind of cloud platform. As of now, the following cloud provider is accepted as the value of this field - AWS + // Required: true + CloudPlatform *string `json:"cloudPlatform"` +} + +// Validate validates this get gov cloud audit credential prerequisites request +func (m *GetGovCloudAuditCredentialPrerequisitesRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCloudPlatform(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetGovCloudAuditCredentialPrerequisitesRequest) validateCloudPlatform(formats strfmt.Registry) error { + + if err := validate.Required("cloudPlatform", "body", m.CloudPlatform); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this get gov cloud audit credential prerequisites request based on context it is used +func (m *GetGovCloudAuditCredentialPrerequisitesRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetGovCloudAuditCredentialPrerequisitesRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetGovCloudAuditCredentialPrerequisitesRequest) UnmarshalBinary(b []byte) error { + var res GetGovCloudAuditCredentialPrerequisitesRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/get_gov_cloud_audit_credential_prerequisites_response.go b/cdp-sdk-go/gen/environments/models/get_gov_cloud_audit_credential_prerequisites_response.go new file mode 100644 index 00000000..3ee72201 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/get_gov_cloud_audit_credential_prerequisites_response.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetGovCloudAuditCredentialPrerequisitesResponse The audit credential prerequisites for GovCloud for the enabled providers. +// +// swagger:model GetGovCloudAuditCredentialPrerequisitesResponse +type GetGovCloudAuditCredentialPrerequisitesResponse struct { + + // The provider specific identifier of the account/subscription/project. + AccountID string `json:"accountId,omitempty"` + + // Provides the external id and policy JSON (this one encoded in base64) for AWS credential creation. + Aws *AwsCredentialPrerequisitesResponse `json:"aws,omitempty"` +} + +// Validate validates this get gov cloud audit credential prerequisites response +func (m *GetGovCloudAuditCredentialPrerequisitesResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAws(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetGovCloudAuditCredentialPrerequisitesResponse) validateAws(formats strfmt.Registry) error { + if swag.IsZero(m.Aws) { // not required + return nil + } + + if m.Aws != nil { + if err := m.Aws.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("aws") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("aws") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get gov cloud audit credential prerequisites response based on the context it is used +func (m *GetGovCloudAuditCredentialPrerequisitesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAws(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetGovCloudAuditCredentialPrerequisitesResponse) contextValidateAws(ctx context.Context, formats strfmt.Registry) error { + + if m.Aws != nil { + + if swag.IsZero(m.Aws) { // not required + return nil + } + + if err := m.Aws.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("aws") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("aws") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetGovCloudAuditCredentialPrerequisitesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetGovCloudAuditCredentialPrerequisitesResponse) UnmarshalBinary(b []byte) error { + var res GetGovCloudAuditCredentialPrerequisitesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/get_gov_cloud_credential_prerequisites_request.go b/cdp-sdk-go/gen/environments/models/get_gov_cloud_credential_prerequisites_request.go new file mode 100644 index 00000000..faf8596c --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/get_gov_cloud_credential_prerequisites_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GetGovCloudCredentialPrerequisitesRequest Request object for getting the credential prerequisites for GovCloud for the enabled providers. +// +// swagger:model GetGovCloudCredentialPrerequisitesRequest +type GetGovCloudCredentialPrerequisitesRequest struct { + + // The kind of cloud platform. As of now, the following cloud provider is accepted as the value of this field - AWS + // Required: true + CloudPlatform *string `json:"cloudPlatform"` +} + +// Validate validates this get gov cloud credential prerequisites request +func (m *GetGovCloudCredentialPrerequisitesRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCloudPlatform(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetGovCloudCredentialPrerequisitesRequest) validateCloudPlatform(formats strfmt.Registry) error { + + if err := validate.Required("cloudPlatform", "body", m.CloudPlatform); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this get gov cloud credential prerequisites request based on context it is used +func (m *GetGovCloudCredentialPrerequisitesRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetGovCloudCredentialPrerequisitesRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetGovCloudCredentialPrerequisitesRequest) UnmarshalBinary(b []byte) error { + var res GetGovCloudCredentialPrerequisitesRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/get_gov_cloud_credential_prerequisites_response.go b/cdp-sdk-go/gen/environments/models/get_gov_cloud_credential_prerequisites_response.go new file mode 100644 index 00000000..cfd72f99 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/get_gov_cloud_credential_prerequisites_response.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetGovCloudCredentialPrerequisitesResponse The credential prerequisites for GovCloud for the enabled providers. +// +// swagger:model GetGovCloudCredentialPrerequisitesResponse +type GetGovCloudCredentialPrerequisitesResponse struct { + + // The provider specific identifier of the account/subscription/project. + AccountID string `json:"accountId,omitempty"` + + // Provides the external id and policy JSON (this one encoded in base64) for AWS GovCloud credential creation. + Aws *AwsCredentialPrerequisitesResponse `json:"aws,omitempty"` +} + +// Validate validates this get gov cloud credential prerequisites response +func (m *GetGovCloudCredentialPrerequisitesResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAws(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetGovCloudCredentialPrerequisitesResponse) validateAws(formats strfmt.Registry) error { + if swag.IsZero(m.Aws) { // not required + return nil + } + + if m.Aws != nil { + if err := m.Aws.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("aws") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("aws") + } + return err + } + } + + return nil +} + +// ContextValidate validate this get gov cloud credential prerequisites response based on the context it is used +func (m *GetGovCloudCredentialPrerequisitesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAws(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetGovCloudCredentialPrerequisitesResponse) contextValidateAws(ctx context.Context, formats strfmt.Registry) error { + + if m.Aws != nil { + + if swag.IsZero(m.Aws) { // not required + return nil + } + + if err := m.Aws.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("aws") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("aws") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GetGovCloudCredentialPrerequisitesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetGovCloudCredentialPrerequisitesResponse) UnmarshalBinary(b []byte) error { + var res GetGovCloudCredentialPrerequisitesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/get_operation_request.go b/cdp-sdk-go/gen/environments/models/get_operation_request.go new file mode 100644 index 00000000..cda7ce77 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/get_operation_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GetOperationRequest Request object for tracking the latest (current/last) operation on the environment resource. +// +// swagger:model GetOperationRequest +type GetOperationRequest struct { + + // Name of the environment resource. + // Required: true + EnvironmentName *string `json:"environmentName"` +} + +// Validate validates this get operation request +func (m *GetOperationRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnvironmentName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetOperationRequest) validateEnvironmentName(formats strfmt.Registry) error { + + if err := validate.Required("environmentName", "body", m.EnvironmentName); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this get operation request based on context it is used +func (m *GetOperationRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetOperationRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetOperationRequest) UnmarshalBinary(b []byte) error { + var res GetOperationRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/get_operation_response.go b/cdp-sdk-go/gen/environments/models/get_operation_response.go new file mode 100644 index 00000000..bf6fdafd --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/get_operation_response.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GetOperationResponse Response object for tracking the latest (current/last) operation on the environment resource. +// +// swagger:model GetOperationResponse +type GetOperationResponse struct { + + // Identifier of the operation. + OperationID string `json:"operationId,omitempty"` + + // Status of the operation. + // Enum: [UNKNOWN RUNNING FAILED FINISHED CANCELLED] + OperationStatus string `json:"operationStatus,omitempty"` + + // Type of the operation. + OperationType string `json:"operationType,omitempty"` + + // Progress percentage of the operation. + Progress int32 `json:"progress,omitempty"` +} + +// Validate validates this get operation response +func (m *GetOperationResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperationStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var getOperationResponseTypeOperationStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["UNKNOWN","RUNNING","FAILED","FINISHED","CANCELLED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + getOperationResponseTypeOperationStatusPropEnum = append(getOperationResponseTypeOperationStatusPropEnum, v) + } +} + +const ( + + // GetOperationResponseOperationStatusUNKNOWN captures enum value "UNKNOWN" + GetOperationResponseOperationStatusUNKNOWN string = "UNKNOWN" + + // GetOperationResponseOperationStatusRUNNING captures enum value "RUNNING" + GetOperationResponseOperationStatusRUNNING string = "RUNNING" + + // GetOperationResponseOperationStatusFAILED captures enum value "FAILED" + GetOperationResponseOperationStatusFAILED string = "FAILED" + + // GetOperationResponseOperationStatusFINISHED captures enum value "FINISHED" + GetOperationResponseOperationStatusFINISHED string = "FINISHED" + + // GetOperationResponseOperationStatusCANCELLED captures enum value "CANCELLED" + GetOperationResponseOperationStatusCANCELLED string = "CANCELLED" +) + +// prop value enum +func (m *GetOperationResponse) validateOperationStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, getOperationResponseTypeOperationStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *GetOperationResponse) validateOperationStatus(formats strfmt.Registry) error { + if swag.IsZero(m.OperationStatus) { // not required + return nil + } + + // value enum + if err := m.validateOperationStatusEnum("operationStatus", "body", m.OperationStatus); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this get operation response based on context it is used +func (m *GetOperationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetOperationResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetOperationResponse) UnmarshalBinary(b []byte) error { + var res GetOperationResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/list_connected_data_services_request.go b/cdp-sdk-go/gen/environments/models/list_connected_data_services_request.go new file mode 100644 index 00000000..5082c688 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/list_connected_data_services_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ListConnectedDataServicesRequest Request object for listing connected Data Service(s) for a given environment. +// +// swagger:model ListConnectedDataServicesRequest +type ListConnectedDataServicesRequest struct { + + // Name or CRN of the environment. + // Required: true + Environment *string `json:"environment"` +} + +// Validate validates this list connected data services request +func (m *ListConnectedDataServicesRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnvironment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListConnectedDataServicesRequest) validateEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("environment", "body", m.Environment); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this list connected data services request based on context it is used +func (m *ListConnectedDataServicesRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ListConnectedDataServicesRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListConnectedDataServicesRequest) UnmarshalBinary(b []byte) error { + var res ListConnectedDataServicesRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/list_connected_data_services_response.go b/cdp-sdk-go/gen/environments/models/list_connected_data_services_response.go new file mode 100644 index 00000000..31244198 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/list_connected_data_services_response.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ListConnectedDataServicesResponse Response object for listing connected Data Service(s) for a given environment. +// +// swagger:model ListConnectedDataServicesResponse +type ListConnectedDataServicesResponse struct { + + // List of connected Data Service for the given environment. + // Required: true + Result []*ConnectedDataService `json:"result"` +} + +// Validate validates this list connected data services response +func (m *ListConnectedDataServicesResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateResult(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListConnectedDataServicesResponse) validateResult(formats strfmt.Registry) error { + + if err := validate.Required("result", "body", m.Result); err != nil { + return err + } + + for i := 0; i < len(m.Result); i++ { + if swag.IsZero(m.Result[i]) { // not required + continue + } + + if m.Result[i] != nil { + if err := m.Result[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("result" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("result" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this list connected data services response based on the context it is used +func (m *ListConnectedDataServicesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateResult(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListConnectedDataServicesResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Result); i++ { + + if m.Result[i] != nil { + + if swag.IsZero(m.Result[i]) { // not required + return nil + } + + if err := m.Result[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("result" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("result" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ListConnectedDataServicesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListConnectedDataServicesResponse) UnmarshalBinary(b []byte) error { + var res ListConnectedDataServicesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/network_azure_params.go b/cdp-sdk-go/gen/environments/models/network_azure_params.go index 8e504ac6..15da9cbc 100644 --- a/cdp-sdk-go/gen/environments/models/network_azure_params.go +++ b/cdp-sdk-go/gen/environments/models/network_azure_params.go @@ -19,15 +19,18 @@ import ( // swagger:model NetworkAzureParams type NetworkAzureParams struct { - // The ID of an existing private DNS zone used for the AKS. + // The full Azure resource ID of an existing Private DNS zone used for the AKS. AksPrivateDNSZoneID string `json:"aksPrivateDnsZoneId,omitempty"` - // The ID of an existing private DNS zone used for the database. + // The full Azure resource ID of the existing Private DNS Zone used for Flexible Server and Single Server Databases. DatabasePrivateDNSZoneID string `json:"databasePrivateDnsZoneId,omitempty"` // Whether the outbound load balancer was created for this environment. EnableOutboundLoadBalancer bool `json:"enableOutboundLoadBalancer,omitempty"` + // The subnets delegated for Flexible Server database. Accepts either the name or the full resource id. + FlexibleServerSubnetIds []string `json:"flexibleServerSubnetIds"` + // The id of the Azure VNet. // Required: true NetworkID *string `json:"networkId"` diff --git a/cdp-sdk-go/gen/environments/models/set_a_w_s_gov_cloud_audit_credential_request.go b/cdp-sdk-go/gen/environments/models/set_a_w_s_gov_cloud_audit_credential_request.go new file mode 100644 index 00000000..f8d6b1b1 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/set_a_w_s_gov_cloud_audit_credential_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SetAWSGovCloudAuditCredentialRequest Request object for a set AWS GovCloud audit credential request. +// +// swagger:model SetAWSGovCloudAuditCredentialRequest +type SetAWSGovCloudAuditCredentialRequest struct { + + // The ARN of the delegated access role. + // Required: true + RoleArn *string `json:"roleArn"` +} + +// Validate validates this set a w s gov cloud audit credential request +func (m *SetAWSGovCloudAuditCredentialRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRoleArn(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SetAWSGovCloudAuditCredentialRequest) validateRoleArn(formats strfmt.Registry) error { + + if err := validate.Required("roleArn", "body", m.RoleArn); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this set a w s gov cloud audit credential request based on context it is used +func (m *SetAWSGovCloudAuditCredentialRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SetAWSGovCloudAuditCredentialRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SetAWSGovCloudAuditCredentialRequest) UnmarshalBinary(b []byte) error { + var res SetAWSGovCloudAuditCredentialRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/set_a_w_s_gov_cloud_audit_credential_response.go b/cdp-sdk-go/gen/environments/models/set_a_w_s_gov_cloud_audit_credential_response.go new file mode 100644 index 00000000..c6f22dc6 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/set_a_w_s_gov_cloud_audit_credential_response.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SetAWSGovCloudAuditCredentialResponse Response object for a set AWS GovCloud audit credential request. +// +// swagger:model SetAWSGovCloudAuditCredentialResponse +type SetAWSGovCloudAuditCredentialResponse struct { + + // The credential object. + // Required: true + Credential *Credential `json:"credential"` +} + +// Validate validates this set a w s gov cloud audit credential response +func (m *SetAWSGovCloudAuditCredentialResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCredential(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SetAWSGovCloudAuditCredentialResponse) validateCredential(formats strfmt.Registry) error { + + if err := validate.Required("credential", "body", m.Credential); err != nil { + return err + } + + if m.Credential != nil { + if err := m.Credential.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("credential") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("credential") + } + return err + } + } + + return nil +} + +// ContextValidate validate this set a w s gov cloud audit credential response based on the context it is used +func (m *SetAWSGovCloudAuditCredentialResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCredential(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SetAWSGovCloudAuditCredentialResponse) contextValidateCredential(ctx context.Context, formats strfmt.Registry) error { + + if m.Credential != nil { + + if err := m.Credential.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("credential") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("credential") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SetAWSGovCloudAuditCredentialResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SetAWSGovCloudAuditCredentialResponse) UnmarshalBinary(b []byte) error { + var res SetAWSGovCloudAuditCredentialResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/set_g_c_p_audit_credential_request.go b/cdp-sdk-go/gen/environments/models/set_g_c_p_audit_credential_request.go new file mode 100644 index 00000000..3a1102ca --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/set_g_c_p_audit_credential_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SetGCPAuditCredentialRequest Request object for a set GCP audit credential request. +// +// swagger:model SetGCPAuditCredentialRequest +type SetGCPAuditCredentialRequest struct { + + // The JSON key for the service account. Please use the local path when using the CLI (e.g. file:///absolute/path/to/cred.json) to avoid exposing the keys in the command line history. + // Required: true + CredentialKey *string `json:"credentialKey"` +} + +// Validate validates this set g c p audit credential request +func (m *SetGCPAuditCredentialRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCredentialKey(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SetGCPAuditCredentialRequest) validateCredentialKey(formats strfmt.Registry) error { + + if err := validate.Required("credentialKey", "body", m.CredentialKey); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this set g c p audit credential request based on context it is used +func (m *SetGCPAuditCredentialRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SetGCPAuditCredentialRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SetGCPAuditCredentialRequest) UnmarshalBinary(b []byte) error { + var res SetGCPAuditCredentialRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/set_g_c_p_audit_credential_response.go b/cdp-sdk-go/gen/environments/models/set_g_c_p_audit_credential_response.go new file mode 100644 index 00000000..94637c95 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/set_g_c_p_audit_credential_response.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SetGCPAuditCredentialResponse Response object for a set GCP audit credential request. +// +// swagger:model SetGCPAuditCredentialResponse +type SetGCPAuditCredentialResponse struct { + + // The credential object. + // Required: true + Credential *Credential `json:"credential"` +} + +// Validate validates this set g c p audit credential response +func (m *SetGCPAuditCredentialResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCredential(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SetGCPAuditCredentialResponse) validateCredential(formats strfmt.Registry) error { + + if err := validate.Required("credential", "body", m.Credential); err != nil { + return err + } + + if m.Credential != nil { + if err := m.Credential.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("credential") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("credential") + } + return err + } + } + + return nil +} + +// ContextValidate validate this set g c p audit credential response based on the context it is used +func (m *SetGCPAuditCredentialResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCredential(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SetGCPAuditCredentialResponse) contextValidateCredential(ctx context.Context, formats strfmt.Registry) error { + + if m.Credential != nil { + + if err := m.Credential.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("credential") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("credential") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SetGCPAuditCredentialResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SetGCPAuditCredentialResponse) UnmarshalBinary(b []byte) error { + var res SetGCPAuditCredentialResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/update_azure_database_resources_request.go b/cdp-sdk-go/gen/environments/models/update_azure_database_resources_request.go new file mode 100644 index 00000000..0684f73a --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/update_azure_database_resources_request.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateAzureDatabaseResourcesRequest Request object for updating Azure Database resources. +// +// swagger:model UpdateAzureDatabaseResourcesRequest +type UpdateAzureDatabaseResourcesRequest struct { + + // The full Azure resource ID of the existing Private DNS Zone used for Flexible Server and Single Server Databases. + DatabasePrivateDNSZoneID string `json:"databasePrivateDnsZoneId,omitempty"` + + // The name or CRN of the environment. + // Required: true + Environment *string `json:"environment"` + + // The subnets delegated for Flexible Server database. Accepts either the name or the full resource id. + FlexibleServerSubnetIds []string `json:"flexibleServerSubnetIds"` +} + +// Validate validates this update azure database resources request +func (m *UpdateAzureDatabaseResourcesRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnvironment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAzureDatabaseResourcesRequest) validateEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("environment", "body", m.Environment); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update azure database resources request based on context it is used +func (m *UpdateAzureDatabaseResourcesRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateAzureDatabaseResourcesRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateAzureDatabaseResourcesRequest) UnmarshalBinary(b []byte) error { + var res UpdateAzureDatabaseResourcesRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/update_azure_database_resources_response.go b/cdp-sdk-go/gen/environments/models/update_azure_database_resources_response.go new file mode 100644 index 00000000..3cfdadfe --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/update_azure_database_resources_response.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateAzureDatabaseResourcesResponse Response object for a update Azure Database resources request. +// +// swagger:model UpdateAzureDatabaseResourcesResponse +type UpdateAzureDatabaseResourcesResponse struct { + + // Object containing details of database resources for Azure cloud. + AzureDatabaseResources *AzureDatabaseResources `json:"azureDatabaseResources,omitempty"` + + // The environment summary. + // Required: true + Environment *Environment `json:"environment"` +} + +// Validate validates this update azure database resources response +func (m *UpdateAzureDatabaseResourcesResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAzureDatabaseResources(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvironment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAzureDatabaseResourcesResponse) validateAzureDatabaseResources(formats strfmt.Registry) error { + if swag.IsZero(m.AzureDatabaseResources) { // not required + return nil + } + + if m.AzureDatabaseResources != nil { + if err := m.AzureDatabaseResources.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("azureDatabaseResources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("azureDatabaseResources") + } + return err + } + } + + return nil +} + +func (m *UpdateAzureDatabaseResourcesResponse) validateEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("environment", "body", m.Environment); err != nil { + return err + } + + if m.Environment != nil { + if err := m.Environment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environment") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update azure database resources response based on the context it is used +func (m *UpdateAzureDatabaseResourcesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAzureDatabaseResources(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEnvironment(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAzureDatabaseResourcesResponse) contextValidateAzureDatabaseResources(ctx context.Context, formats strfmt.Registry) error { + + if m.AzureDatabaseResources != nil { + + if swag.IsZero(m.AzureDatabaseResources) { // not required + return nil + } + + if err := m.AzureDatabaseResources.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("azureDatabaseResources") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("azureDatabaseResources") + } + return err + } + } + + return nil +} + +func (m *UpdateAzureDatabaseResourcesResponse) contextValidateEnvironment(ctx context.Context, formats strfmt.Registry) error { + + if m.Environment != nil { + + if err := m.Environment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environment") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateAzureDatabaseResourcesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateAzureDatabaseResourcesResponse) UnmarshalBinary(b []byte) error { + var res UpdateAzureDatabaseResourcesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/update_azure_image_terms_policy_request.go b/cdp-sdk-go/gen/environments/models/update_azure_image_terms_policy_request.go new file mode 100644 index 00000000..c1a002ec --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/update_azure_image_terms_policy_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateAzureImageTermsPolicyRequest Request object to enable or disable automatic acceptance of Azure Marketplace image terms. +// +// swagger:model UpdateAzureImageTermsPolicyRequest +type UpdateAzureImageTermsPolicyRequest struct { + + // Flag to enable or disable automatic acceptance of Azure Marketplace image terms. + // Required: true + Accepted *bool `json:"accepted"` +} + +// Validate validates this update azure image terms policy request +func (m *UpdateAzureImageTermsPolicyRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccepted(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAzureImageTermsPolicyRequest) validateAccepted(formats strfmt.Registry) error { + + if err := validate.Required("accepted", "body", m.Accepted); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update azure image terms policy request based on context it is used +func (m *UpdateAzureImageTermsPolicyRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateAzureImageTermsPolicyRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateAzureImageTermsPolicyRequest) UnmarshalBinary(b []byte) error { + var res UpdateAzureImageTermsPolicyRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/update_azure_image_terms_policy_response.go b/cdp-sdk-go/gen/environments/models/update_azure_image_terms_policy_response.go new file mode 100644 index 00000000..ff944b27 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/update_azure_image_terms_policy_response.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// UpdateAzureImageTermsPolicyResponse Response object to enable or disable automatic acceptance of Azure Marketplace image terms. +// +// swagger:model UpdateAzureImageTermsPolicyResponse +type UpdateAzureImageTermsPolicyResponse interface{} diff --git a/cdp-sdk-go/gen/environments/models/update_data_service_resources_request.go b/cdp-sdk-go/gen/environments/models/update_data_service_resources_request.go new file mode 100644 index 00000000..a8b784bf --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/update_data_service_resources_request.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateDataServiceResourcesRequest Update Data Services parameters request of the environment. +// +// swagger:model UpdateDataServiceResourcesRequest +type UpdateDataServiceResourcesRequest struct { + + // Data Services parameters request of the environment. + // Required: true + DataServices *DataServicesRequest `json:"dataServices"` + + // The name or CRN of the environment. + // Required: true + Environment *string `json:"environment"` +} + +// Validate validates this update data service resources request +func (m *UpdateDataServiceResourcesRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDataServices(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvironment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateDataServiceResourcesRequest) validateDataServices(formats strfmt.Registry) error { + + if err := validate.Required("dataServices", "body", m.DataServices); err != nil { + return err + } + + if m.DataServices != nil { + if err := m.DataServices.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dataServices") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dataServices") + } + return err + } + } + + return nil +} + +func (m *UpdateDataServiceResourcesRequest) validateEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("environment", "body", m.Environment); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update data service resources request based on the context it is used +func (m *UpdateDataServiceResourcesRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDataServices(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateDataServiceResourcesRequest) contextValidateDataServices(ctx context.Context, formats strfmt.Registry) error { + + if m.DataServices != nil { + + if err := m.DataServices.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dataServices") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dataServices") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateDataServiceResourcesRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateDataServiceResourcesRequest) UnmarshalBinary(b []byte) error { + var res UpdateDataServiceResourcesRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/update_data_service_resources_response.go b/cdp-sdk-go/gen/environments/models/update_data_service_resources_response.go new file mode 100644 index 00000000..32be5d24 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/update_data_service_resources_response.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateDataServiceResourcesResponse Response object for an update environment Data Service resource request. +// +// swagger:model UpdateDataServiceResourcesResponse +type UpdateDataServiceResourcesResponse struct { + + // The environment. + // Required: true + Environment *Environment `json:"environment"` +} + +// Validate validates this update data service resources response +func (m *UpdateDataServiceResourcesResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnvironment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateDataServiceResourcesResponse) validateEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("environment", "body", m.Environment); err != nil { + return err + } + + if m.Environment != nil { + if err := m.Environment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environment") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update data service resources response based on the context it is used +func (m *UpdateDataServiceResourcesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEnvironment(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateDataServiceResourcesResponse) contextValidateEnvironment(ctx context.Context, formats strfmt.Registry) error { + + if m.Environment != nil { + + if err := m.Environment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environment") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateDataServiceResourcesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateDataServiceResourcesResponse) UnmarshalBinary(b []byte) error { + var res UpdateDataServiceResourcesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/update_security_access_request.go b/cdp-sdk-go/gen/environments/models/update_security_access_request.go new file mode 100644 index 00000000..afe94edd --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/update_security_access_request.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateSecurityAccessRequest The request object for updating security access of the given environment. +// +// swagger:model UpdateSecurityAccessRequest +type UpdateSecurityAccessRequest struct { + + // Security group ID for non-gateway nodes. + // Required: true + DefaultSecurityGroupID *string `json:"defaultSecurityGroupId"` + + // The name or the CRN of the environment. + // Required: true + Environment *string `json:"environment"` + + // Security group ID where Knox-enabled hosts are placed. + // Required: true + GatewayNodeSecurityGroupID *string `json:"gatewayNodeSecurityGroupId"` +} + +// Validate validates this update security access request +func (m *UpdateSecurityAccessRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDefaultSecurityGroupID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEnvironment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGatewayNodeSecurityGroupID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSecurityAccessRequest) validateDefaultSecurityGroupID(formats strfmt.Registry) error { + + if err := validate.Required("defaultSecurityGroupId", "body", m.DefaultSecurityGroupID); err != nil { + return err + } + + return nil +} + +func (m *UpdateSecurityAccessRequest) validateEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("environment", "body", m.Environment); err != nil { + return err + } + + return nil +} + +func (m *UpdateSecurityAccessRequest) validateGatewayNodeSecurityGroupID(formats strfmt.Registry) error { + + if err := validate.Required("gatewayNodeSecurityGroupId", "body", m.GatewayNodeSecurityGroupID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update security access request based on context it is used +func (m *UpdateSecurityAccessRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSecurityAccessRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSecurityAccessRequest) UnmarshalBinary(b []byte) error { + var res UpdateSecurityAccessRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/update_security_access_response.go b/cdp-sdk-go/gen/environments/models/update_security_access_response.go new file mode 100644 index 00000000..3f7da0de --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/update_security_access_response.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateSecurityAccessResponse Response object for an update environment security access request. +// +// swagger:model UpdateSecurityAccessResponse +type UpdateSecurityAccessResponse struct { + + // The environment. + // Required: true + Environment *Environment `json:"environment"` +} + +// Validate validates this update security access response +func (m *UpdateSecurityAccessResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnvironment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSecurityAccessResponse) validateEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("environment", "body", m.Environment); err != nil { + return err + } + + if m.Environment != nil { + if err := m.Environment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environment") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update security access response based on the context it is used +func (m *UpdateSecurityAccessResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEnvironment(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSecurityAccessResponse) contextValidateEnvironment(ctx context.Context, formats strfmt.Registry) error { + + if m.Environment != nil { + + if err := m.Environment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environment") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSecurityAccessResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSecurityAccessResponse) UnmarshalBinary(b []byte) error { + var res UpdateSecurityAccessResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/update_ssh_key_request.go b/cdp-sdk-go/gen/environments/models/update_ssh_key_request.go new file mode 100644 index 00000000..ad6fd189 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/update_ssh_key_request.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateSSHKeyRequest The request object for updating the environment SSH key. +// +// swagger:model UpdateSshKeyRequest +type UpdateSSHKeyRequest struct { + + // The name or the CRN of the environment. + // Required: true + Environment *string `json:"environment"` + + // The ID of the existing SSH public key that is stored on the cloud provider side. Either this or a new public key has to be given. + ExistingPublicKeyID string `json:"existingPublicKeyId,omitempty"` + + // A new SSH public key that is stored locally. Either this or an existing public key ID has to be given. + NewPublicKey string `json:"newPublicKey,omitempty"` +} + +// Validate validates this update Ssh key request +func (m *UpdateSSHKeyRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnvironment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSSHKeyRequest) validateEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("environment", "body", m.Environment); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update Ssh key request based on context it is used +func (m *UpdateSSHKeyRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSSHKeyRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSSHKeyRequest) UnmarshalBinary(b []byte) error { + var res UpdateSSHKeyRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/update_ssh_key_response.go b/cdp-sdk-go/gen/environments/models/update_ssh_key_response.go new file mode 100644 index 00000000..bbb6e5e3 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/update_ssh_key_response.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateSSHKeyResponse Response object for an update environment SSH key request. +// +// swagger:model UpdateSshKeyResponse +type UpdateSSHKeyResponse struct { + + // The environment. + // Required: true + Environment *Environment `json:"environment"` +} + +// Validate validates this update Ssh key response +func (m *UpdateSSHKeyResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEnvironment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSSHKeyResponse) validateEnvironment(formats strfmt.Registry) error { + + if err := validate.Required("environment", "body", m.Environment); err != nil { + return err + } + + if m.Environment != nil { + if err := m.Environment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environment") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update Ssh key response based on the context it is used +func (m *UpdateSSHKeyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEnvironment(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSSHKeyResponse) contextValidateEnvironment(ctx context.Context, formats strfmt.Registry) error { + + if m.Environment != nil { + + if err := m.Environment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("environment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("environment") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSSHKeyResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSSHKeyResponse) UnmarshalBinary(b []byte) error { + var res UpdateSSHKeyResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/update_subnet_request.go b/cdp-sdk-go/gen/environments/models/update_subnet_request.go index 9e1ab9bd..6ab45b91 100644 --- a/cdp-sdk-go/gen/environments/models/update_subnet_request.go +++ b/cdp-sdk-go/gen/environments/models/update_subnet_request.go @@ -19,12 +19,14 @@ import ( // swagger:model UpdateSubnetRequest type UpdateSubnetRequest struct { + // The selected subnets to update for the given environment's endpoint access gateway. + EndpointAccessGatewaySubnetIds []string `json:"endpointAccessGatewaySubnetIds"` + // The name or the CRN of the environment. // Required: true Environment *string `json:"environment"` // The selected subnets to update the given environment to. - // Required: true SubnetIds []string `json:"subnetIds"` } @@ -36,10 +38,6 @@ func (m *UpdateSubnetRequest) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateSubnetIds(formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -55,15 +53,6 @@ func (m *UpdateSubnetRequest) validateEnvironment(formats strfmt.Registry) error return nil } -func (m *UpdateSubnetRequest) validateSubnetIds(formats strfmt.Registry) error { - - if err := validate.Required("subnetIds", "body", m.SubnetIds); err != nil { - return err - } - - return nil -} - // ContextValidate validates this update subnet request based on context it is used func (m *UpdateSubnetRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/cdp-sdk-go/gen/environments/models/upgrade_freeipa_request.go b/cdp-sdk-go/gen/environments/models/upgrade_freeipa_request.go index 94cffbb0..9127b25a 100644 --- a/cdp-sdk-go/gen/environments/models/upgrade_freeipa_request.go +++ b/cdp-sdk-go/gen/environments/models/upgrade_freeipa_request.go @@ -19,9 +19,15 @@ import ( // swagger:model UpgradeFreeipaRequest type UpgradeFreeipaRequest struct { + // Allows the upgrade to a subsequent major OS version in the series. + AllowMajorOsUpgrade bool `json:"allowMajorOsUpgrade,omitempty"` + // The name or CRN of the environment. // Required: true EnvironmentName *string `json:"environmentName"` + + // Target image ID for upgrade. + ImageID string `json:"imageId,omitempty"` } // Validate validates this upgrade freeipa request diff --git a/cdp-sdk-go/gen/environments/models/validate_aws_cloud_storage_request.go b/cdp-sdk-go/gen/environments/models/validate_aws_cloud_storage_request.go new file mode 100644 index 00000000..4e37cf90 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/validate_aws_cloud_storage_request.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ValidateAwsCloudStorageRequest Request object for AWS environment cloud storage validation. +// +// swagger:model ValidateAwsCloudStorageRequest +type ValidateAwsCloudStorageRequest struct { + + // The CRN of the credential. + // Required: true + CredentialCrn *string `json:"credentialCrn"` + + // AWS instance profile. + // Required: true + InstanceProfile *string `json:"instanceProfile"` + + // AWS S3 storage bucket location for logging. + // Required: true + StorageLocation *string `json:"storageLocation"` +} + +// Validate validates this validate aws cloud storage request +func (m *ValidateAwsCloudStorageRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCredentialCrn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstanceProfile(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ValidateAwsCloudStorageRequest) validateCredentialCrn(formats strfmt.Registry) error { + + if err := validate.Required("credentialCrn", "body", m.CredentialCrn); err != nil { + return err + } + + return nil +} + +func (m *ValidateAwsCloudStorageRequest) validateInstanceProfile(formats strfmt.Registry) error { + + if err := validate.Required("instanceProfile", "body", m.InstanceProfile); err != nil { + return err + } + + return nil +} + +func (m *ValidateAwsCloudStorageRequest) validateStorageLocation(formats strfmt.Registry) error { + + if err := validate.Required("storageLocation", "body", m.StorageLocation); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this validate aws cloud storage request based on context it is used +func (m *ValidateAwsCloudStorageRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ValidateAwsCloudStorageRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidateAwsCloudStorageRequest) UnmarshalBinary(b []byte) error { + var res ValidateAwsCloudStorageRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/validate_aws_cloud_storage_response.go b/cdp-sdk-go/gen/environments/models/validate_aws_cloud_storage_response.go new file mode 100644 index 00000000..016073fe --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/validate_aws_cloud_storage_response.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ValidateAwsCloudStorageResponse Response object for AWS environment cloud storage validation. +// +// swagger:model ValidateAwsCloudStorageResponse +type ValidateAwsCloudStorageResponse struct { + + // Error message if validation failed. + Error string `json:"error,omitempty"` + + // Validation result. Allowed values are "OK", "ACCESS_DENIED", "ERROR", "RESOURCE_NOT_FOUND". + Status string `json:"status,omitempty"` +} + +// Validate validates this validate aws cloud storage response +func (m *ValidateAwsCloudStorageResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this validate aws cloud storage response based on context it is used +func (m *ValidateAwsCloudStorageResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ValidateAwsCloudStorageResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidateAwsCloudStorageResponse) UnmarshalBinary(b []byte) error { + var res ValidateAwsCloudStorageResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/validate_azure_cloud_storage_request.go b/cdp-sdk-go/gen/environments/models/validate_azure_cloud_storage_request.go new file mode 100644 index 00000000..6329db1e --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/validate_azure_cloud_storage_request.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ValidateAzureCloudStorageRequest Request object for Azure environment cloud storage validation. +// +// swagger:model ValidateAzureCloudStorageRequest +type ValidateAzureCloudStorageRequest struct { + + // Azure account key. + AccountKey string `json:"accountKey,omitempty"` + + // Azure account name. + AccountName string `json:"accountName,omitempty"` + + // The CRN of the credential. + // Required: true + CredentialCrn *string `json:"credentialCrn"` + + // Azure managed identity. + ManagedIdentity string `json:"managedIdentity,omitempty"` + + // Azure secure flag. + Secure bool `json:"secure,omitempty"` + + // Azure storage location for logging. + // Required: true + StorageLocation *string `json:"storageLocation"` +} + +// Validate validates this validate azure cloud storage request +func (m *ValidateAzureCloudStorageRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCredentialCrn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ValidateAzureCloudStorageRequest) validateCredentialCrn(formats strfmt.Registry) error { + + if err := validate.Required("credentialCrn", "body", m.CredentialCrn); err != nil { + return err + } + + return nil +} + +func (m *ValidateAzureCloudStorageRequest) validateStorageLocation(formats strfmt.Registry) error { + + if err := validate.Required("storageLocation", "body", m.StorageLocation); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this validate azure cloud storage request based on context it is used +func (m *ValidateAzureCloudStorageRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ValidateAzureCloudStorageRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidateAzureCloudStorageRequest) UnmarshalBinary(b []byte) error { + var res ValidateAzureCloudStorageRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/environments/models/validate_azure_cloud_storage_response.go b/cdp-sdk-go/gen/environments/models/validate_azure_cloud_storage_response.go new file mode 100644 index 00000000..009007a3 --- /dev/null +++ b/cdp-sdk-go/gen/environments/models/validate_azure_cloud_storage_response.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ValidateAzureCloudStorageResponse Response object for Azure environment cloud storage validation. +// +// swagger:model ValidateAzureCloudStorageResponse +type ValidateAzureCloudStorageResponse struct { + + // Error message if validation failed. + Error string `json:"error,omitempty"` + + // Validation result. Allowed values are "OK", "ACCESS_DENIED", "ERROR", "RESOURCE_NOT_FOUND". + Status string `json:"status,omitempty"` +} + +// Validate validates this validate azure cloud storage response +func (m *ValidateAzureCloudStorageResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this validate azure cloud storage response based on context it is used +func (m *ValidateAzureCloudStorageResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ValidateAzureCloudStorageResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidateAzureCloudStorageResponse) UnmarshalBinary(b []byte) error { + var res ValidateAzureCloudStorageResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/iam/client/operations/get_default_identity_provider_parameters.go b/cdp-sdk-go/gen/iam/client/operations/get_default_identity_provider_parameters.go new file mode 100644 index 00000000..2ffe8174 --- /dev/null +++ b/cdp-sdk-go/gen/iam/client/operations/get_default_identity_provider_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/iam/models" +) + +// NewGetDefaultIdentityProviderParams creates a new GetDefaultIdentityProviderParams 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 NewGetDefaultIdentityProviderParams() *GetDefaultIdentityProviderParams { + return &GetDefaultIdentityProviderParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDefaultIdentityProviderParamsWithTimeout creates a new GetDefaultIdentityProviderParams object +// with the ability to set a timeout on a request. +func NewGetDefaultIdentityProviderParamsWithTimeout(timeout time.Duration) *GetDefaultIdentityProviderParams { + return &GetDefaultIdentityProviderParams{ + timeout: timeout, + } +} + +// NewGetDefaultIdentityProviderParamsWithContext creates a new GetDefaultIdentityProviderParams object +// with the ability to set a context for a request. +func NewGetDefaultIdentityProviderParamsWithContext(ctx context.Context) *GetDefaultIdentityProviderParams { + return &GetDefaultIdentityProviderParams{ + Context: ctx, + } +} + +// NewGetDefaultIdentityProviderParamsWithHTTPClient creates a new GetDefaultIdentityProviderParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDefaultIdentityProviderParamsWithHTTPClient(client *http.Client) *GetDefaultIdentityProviderParams { + return &GetDefaultIdentityProviderParams{ + HTTPClient: client, + } +} + +/* +GetDefaultIdentityProviderParams contains all the parameters to send to the API endpoint + + for the get default identity provider operation. + + Typically these are written to a http.Request. +*/ +type GetDefaultIdentityProviderParams struct { + + // Input. + Input models.GetDefaultIdentityProviderRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get default identity provider params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDefaultIdentityProviderParams) WithDefaults() *GetDefaultIdentityProviderParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get default identity provider params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDefaultIdentityProviderParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get default identity provider params +func (o *GetDefaultIdentityProviderParams) WithTimeout(timeout time.Duration) *GetDefaultIdentityProviderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get default identity provider params +func (o *GetDefaultIdentityProviderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get default identity provider params +func (o *GetDefaultIdentityProviderParams) WithContext(ctx context.Context) *GetDefaultIdentityProviderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get default identity provider params +func (o *GetDefaultIdentityProviderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get default identity provider params +func (o *GetDefaultIdentityProviderParams) WithHTTPClient(client *http.Client) *GetDefaultIdentityProviderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get default identity provider params +func (o *GetDefaultIdentityProviderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the get default identity provider params +func (o *GetDefaultIdentityProviderParams) WithInput(input models.GetDefaultIdentityProviderRequest) *GetDefaultIdentityProviderParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the get default identity provider params +func (o *GetDefaultIdentityProviderParams) SetInput(input models.GetDefaultIdentityProviderRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDefaultIdentityProviderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/iam/client/operations/get_default_identity_provider_responses.go b/cdp-sdk-go/gen/iam/client/operations/get_default_identity_provider_responses.go new file mode 100644 index 00000000..67aa1222 --- /dev/null +++ b/cdp-sdk-go/gen/iam/client/operations/get_default_identity_provider_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/iam/models" +) + +// GetDefaultIdentityProviderReader is a Reader for the GetDefaultIdentityProvider structure. +type GetDefaultIdentityProviderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDefaultIdentityProviderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDefaultIdentityProviderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetDefaultIdentityProviderDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetDefaultIdentityProviderOK creates a GetDefaultIdentityProviderOK with default headers values +func NewGetDefaultIdentityProviderOK() *GetDefaultIdentityProviderOK { + return &GetDefaultIdentityProviderOK{} +} + +/* +GetDefaultIdentityProviderOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type GetDefaultIdentityProviderOK struct { + Payload *models.GetDefaultIdentityProviderResponse +} + +// IsSuccess returns true when this get default identity provider o k response has a 2xx status code +func (o *GetDefaultIdentityProviderOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get default identity provider o k response has a 3xx status code +func (o *GetDefaultIdentityProviderOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get default identity provider o k response has a 4xx status code +func (o *GetDefaultIdentityProviderOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get default identity provider o k response has a 5xx status code +func (o *GetDefaultIdentityProviderOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get default identity provider o k response a status code equal to that given +func (o *GetDefaultIdentityProviderOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get default identity provider o k response +func (o *GetDefaultIdentityProviderOK) Code() int { + return 200 +} + +func (o *GetDefaultIdentityProviderOK) Error() string { + return fmt.Sprintf("[POST /iam/getDefaultIdentityProvider][%d] getDefaultIdentityProviderOK %+v", 200, o.Payload) +} + +func (o *GetDefaultIdentityProviderOK) String() string { + return fmt.Sprintf("[POST /iam/getDefaultIdentityProvider][%d] getDefaultIdentityProviderOK %+v", 200, o.Payload) +} + +func (o *GetDefaultIdentityProviderOK) GetPayload() *models.GetDefaultIdentityProviderResponse { + return o.Payload +} + +func (o *GetDefaultIdentityProviderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetDefaultIdentityProviderResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDefaultIdentityProviderDefault creates a GetDefaultIdentityProviderDefault with default headers values +func NewGetDefaultIdentityProviderDefault(code int) *GetDefaultIdentityProviderDefault { + return &GetDefaultIdentityProviderDefault{ + _statusCode: code, + } +} + +/* +GetDefaultIdentityProviderDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type GetDefaultIdentityProviderDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this get default identity provider default response has a 2xx status code +func (o *GetDefaultIdentityProviderDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get default identity provider default response has a 3xx status code +func (o *GetDefaultIdentityProviderDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get default identity provider default response has a 4xx status code +func (o *GetDefaultIdentityProviderDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get default identity provider default response has a 5xx status code +func (o *GetDefaultIdentityProviderDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get default identity provider default response a status code equal to that given +func (o *GetDefaultIdentityProviderDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the get default identity provider default response +func (o *GetDefaultIdentityProviderDefault) Code() int { + return o._statusCode +} + +func (o *GetDefaultIdentityProviderDefault) Error() string { + return fmt.Sprintf("[POST /iam/getDefaultIdentityProvider][%d] getDefaultIdentityProvider default %+v", o._statusCode, o.Payload) +} + +func (o *GetDefaultIdentityProviderDefault) String() string { + return fmt.Sprintf("[POST /iam/getDefaultIdentityProvider][%d] getDefaultIdentityProvider default %+v", o._statusCode, o.Payload) +} + +func (o *GetDefaultIdentityProviderDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetDefaultIdentityProviderDefault) 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/cdp-sdk-go/gen/iam/client/operations/operations_client.go b/cdp-sdk-go/gen/iam/client/operations/operations_client.go index 697ead89..7c11e69a 100644 --- a/cdp-sdk-go/gen/iam/client/operations/operations_client.go +++ b/cdp-sdk-go/gen/iam/client/operations/operations_client.go @@ -94,6 +94,8 @@ type ClientService interface { GetAccountMessages(params *GetAccountMessagesParams, opts ...ClientOption) (*GetAccountMessagesOK, error) + GetDefaultIdentityProvider(params *GetDefaultIdentityProviderParams, opts ...ClientOption) (*GetDefaultIdentityProviderOK, error) + GetUser(params *GetUserParams, opts ...ClientOption) (*GetUserOK, error) ListAccessKeys(params *ListAccessKeysParams, opts ...ClientOption) (*ListAccessKeysOK, error) @@ -144,6 +146,8 @@ type ClientService interface { SetAuthenticationPolicy(params *SetAuthenticationPolicyParams, opts ...ClientOption) (*SetAuthenticationPolicyOK, error) + SetDefaultIdentityProvider(params *SetDefaultIdentityProviderParams, opts ...ClientOption) (*SetDefaultIdentityProviderOK, error) + SetWorkloadPassword(params *SetWorkloadPasswordParams, opts ...ClientOption) (*SetWorkloadPasswordOK, error) SetWorkloadPasswordPolicy(params *SetWorkloadPasswordPolicyParams, opts ...ClientOption) (*SetWorkloadPasswordPolicyOK, error) @@ -1470,6 +1474,45 @@ func (a *Client) GetAccountMessages(params *GetAccountMessagesParams, opts ...Cl return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +GetDefaultIdentityProvider retrieves the c r n of the default identity provider + +Retrieves the CRN of the default identity provider used for CDP initiated login requests. +*/ +func (a *Client) GetDefaultIdentityProvider(params *GetDefaultIdentityProviderParams, opts ...ClientOption) (*GetDefaultIdentityProviderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDefaultIdentityProviderParams() + } + op := &runtime.ClientOperation{ + ID: "getDefaultIdentityProvider", + Method: "POST", + PathPattern: "/iam/getDefaultIdentityProvider", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetDefaultIdentityProviderReader{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.(*GetDefaultIdentityProviderOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetDefaultIdentityProviderDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* GetUser gets information on a user @@ -2409,7 +2452,7 @@ func (a *Client) SetAccountMessages(params *SetAccountMessagesParams, opts ...Cl /* SetAuthenticationPolicy sets the authentication policy for the account -Set the authentication policy for the account. Check each request parameter for its default values. Changes to the authentication policy only affect authentications that are done after the policy has been updated. +Set the authentication policy for the account. Any parameters not specified in the request will be cleared, and their default values will be used for authentication. Changes to the authentication policy only affect authentications that are done after the policy has been updated. */ func (a *Client) SetAuthenticationPolicy(params *SetAuthenticationPolicyParams, opts ...ClientOption) (*SetAuthenticationPolicyOK, error) { // TODO: Validate the params before sending @@ -2445,6 +2488,45 @@ func (a *Client) SetAuthenticationPolicy(params *SetAuthenticationPolicyParams, return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +SetDefaultIdentityProvider sets the default identity provider + +Sets the default identity provider used for CDP initiated login requests. +*/ +func (a *Client) SetDefaultIdentityProvider(params *SetDefaultIdentityProviderParams, opts ...ClientOption) (*SetDefaultIdentityProviderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSetDefaultIdentityProviderParams() + } + op := &runtime.ClientOperation{ + ID: "setDefaultIdentityProvider", + Method: "POST", + PathPattern: "/iam/setDefaultIdentityProvider", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &SetDefaultIdentityProviderReader{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.(*SetDefaultIdentityProviderOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*SetDefaultIdentityProviderDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* SetWorkloadPassword sets the workload password for an actor @@ -2838,7 +2920,7 @@ func (a *Client) UnassignUserRole(params *UnassignUserRoleParams, opts ...Client /* UnlockMachineUserInControlPlane unlocks machine user in the c d p control plane -Unlocks machine user in the CDP control plane. This operation is idempotent. Unlocking an active machine user will succeed and leave the machine user active. +Unlocks machine user in the CDP control plane. This operation is idempotent. Unlocking an active machine user will succeed and leave the machine user active. This operation is only supported on Cloudera for Government. */ func (a *Client) UnlockMachineUserInControlPlane(params *UnlockMachineUserInControlPlaneParams, opts ...ClientOption) (*UnlockMachineUserInControlPlaneOK, error) { // TODO: Validate the params before sending @@ -2877,7 +2959,7 @@ func (a *Client) UnlockMachineUserInControlPlane(params *UnlockMachineUserInCont /* UnlockUserInControlPlane unlocks user in the c d p control plane -Unlocks user in the CDP control plane. This operation is idempotent. Unlocking an active user will succeed and leave the user active. +Unlocks user in the CDP control plane. This operation is idempotent. Unlocking an active user will succeed and leave the user active. This operation is only supported on Cloudera for Government. */ func (a *Client) UnlockUserInControlPlane(params *UnlockUserInControlPlaneParams, opts ...ClientOption) (*UnlockUserInControlPlaneOK, error) { // TODO: Validate the params before sending diff --git a/cdp-sdk-go/gen/iam/client/operations/set_default_identity_provider_parameters.go b/cdp-sdk-go/gen/iam/client/operations/set_default_identity_provider_parameters.go new file mode 100644 index 00000000..f9641310 --- /dev/null +++ b/cdp-sdk-go/gen/iam/client/operations/set_default_identity_provider_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/iam/models" +) + +// NewSetDefaultIdentityProviderParams creates a new SetDefaultIdentityProviderParams 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 NewSetDefaultIdentityProviderParams() *SetDefaultIdentityProviderParams { + return &SetDefaultIdentityProviderParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewSetDefaultIdentityProviderParamsWithTimeout creates a new SetDefaultIdentityProviderParams object +// with the ability to set a timeout on a request. +func NewSetDefaultIdentityProviderParamsWithTimeout(timeout time.Duration) *SetDefaultIdentityProviderParams { + return &SetDefaultIdentityProviderParams{ + timeout: timeout, + } +} + +// NewSetDefaultIdentityProviderParamsWithContext creates a new SetDefaultIdentityProviderParams object +// with the ability to set a context for a request. +func NewSetDefaultIdentityProviderParamsWithContext(ctx context.Context) *SetDefaultIdentityProviderParams { + return &SetDefaultIdentityProviderParams{ + Context: ctx, + } +} + +// NewSetDefaultIdentityProviderParamsWithHTTPClient creates a new SetDefaultIdentityProviderParams object +// with the ability to set a custom HTTPClient for a request. +func NewSetDefaultIdentityProviderParamsWithHTTPClient(client *http.Client) *SetDefaultIdentityProviderParams { + return &SetDefaultIdentityProviderParams{ + HTTPClient: client, + } +} + +/* +SetDefaultIdentityProviderParams contains all the parameters to send to the API endpoint + + for the set default identity provider operation. + + Typically these are written to a http.Request. +*/ +type SetDefaultIdentityProviderParams struct { + + // Input. + Input *models.SetDefaultIdentityProviderRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the set default identity provider params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetDefaultIdentityProviderParams) WithDefaults() *SetDefaultIdentityProviderParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the set default identity provider params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *SetDefaultIdentityProviderParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the set default identity provider params +func (o *SetDefaultIdentityProviderParams) WithTimeout(timeout time.Duration) *SetDefaultIdentityProviderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the set default identity provider params +func (o *SetDefaultIdentityProviderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the set default identity provider params +func (o *SetDefaultIdentityProviderParams) WithContext(ctx context.Context) *SetDefaultIdentityProviderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the set default identity provider params +func (o *SetDefaultIdentityProviderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the set default identity provider params +func (o *SetDefaultIdentityProviderParams) WithHTTPClient(client *http.Client) *SetDefaultIdentityProviderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the set default identity provider params +func (o *SetDefaultIdentityProviderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the set default identity provider params +func (o *SetDefaultIdentityProviderParams) WithInput(input *models.SetDefaultIdentityProviderRequest) *SetDefaultIdentityProviderParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the set default identity provider params +func (o *SetDefaultIdentityProviderParams) SetInput(input *models.SetDefaultIdentityProviderRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *SetDefaultIdentityProviderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/iam/client/operations/set_default_identity_provider_responses.go b/cdp-sdk-go/gen/iam/client/operations/set_default_identity_provider_responses.go new file mode 100644 index 00000000..3e7ffaf6 --- /dev/null +++ b/cdp-sdk-go/gen/iam/client/operations/set_default_identity_provider_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/iam/models" +) + +// SetDefaultIdentityProviderReader is a Reader for the SetDefaultIdentityProvider structure. +type SetDefaultIdentityProviderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SetDefaultIdentityProviderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewSetDefaultIdentityProviderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewSetDefaultIdentityProviderDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewSetDefaultIdentityProviderOK creates a SetDefaultIdentityProviderOK with default headers values +func NewSetDefaultIdentityProviderOK() *SetDefaultIdentityProviderOK { + return &SetDefaultIdentityProviderOK{} +} + +/* +SetDefaultIdentityProviderOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type SetDefaultIdentityProviderOK struct { + Payload models.SetDefaultIdentityProviderResponse +} + +// IsSuccess returns true when this set default identity provider o k response has a 2xx status code +func (o *SetDefaultIdentityProviderOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this set default identity provider o k response has a 3xx status code +func (o *SetDefaultIdentityProviderOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this set default identity provider o k response has a 4xx status code +func (o *SetDefaultIdentityProviderOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this set default identity provider o k response has a 5xx status code +func (o *SetDefaultIdentityProviderOK) IsServerError() bool { + return false +} + +// IsCode returns true when this set default identity provider o k response a status code equal to that given +func (o *SetDefaultIdentityProviderOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the set default identity provider o k response +func (o *SetDefaultIdentityProviderOK) Code() int { + return 200 +} + +func (o *SetDefaultIdentityProviderOK) Error() string { + return fmt.Sprintf("[POST /iam/setDefaultIdentityProvider][%d] setDefaultIdentityProviderOK %+v", 200, o.Payload) +} + +func (o *SetDefaultIdentityProviderOK) String() string { + return fmt.Sprintf("[POST /iam/setDefaultIdentityProvider][%d] setDefaultIdentityProviderOK %+v", 200, o.Payload) +} + +func (o *SetDefaultIdentityProviderOK) GetPayload() models.SetDefaultIdentityProviderResponse { + return o.Payload +} + +func (o *SetDefaultIdentityProviderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewSetDefaultIdentityProviderDefault creates a SetDefaultIdentityProviderDefault with default headers values +func NewSetDefaultIdentityProviderDefault(code int) *SetDefaultIdentityProviderDefault { + return &SetDefaultIdentityProviderDefault{ + _statusCode: code, + } +} + +/* +SetDefaultIdentityProviderDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type SetDefaultIdentityProviderDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this set default identity provider default response has a 2xx status code +func (o *SetDefaultIdentityProviderDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this set default identity provider default response has a 3xx status code +func (o *SetDefaultIdentityProviderDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this set default identity provider default response has a 4xx status code +func (o *SetDefaultIdentityProviderDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this set default identity provider default response has a 5xx status code +func (o *SetDefaultIdentityProviderDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this set default identity provider default response a status code equal to that given +func (o *SetDefaultIdentityProviderDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the set default identity provider default response +func (o *SetDefaultIdentityProviderDefault) Code() int { + return o._statusCode +} + +func (o *SetDefaultIdentityProviderDefault) Error() string { + return fmt.Sprintf("[POST /iam/setDefaultIdentityProvider][%d] setDefaultIdentityProvider default %+v", o._statusCode, o.Payload) +} + +func (o *SetDefaultIdentityProviderDefault) String() string { + return fmt.Sprintf("[POST /iam/setDefaultIdentityProvider][%d] setDefaultIdentityProvider default %+v", o._statusCode, o.Payload) +} + +func (o *SetDefaultIdentityProviderDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *SetDefaultIdentityProviderDefault) 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/cdp-sdk-go/gen/iam/models/authentication_policy.go b/cdp-sdk-go/gen/iam/models/authentication_policy.go index 5973b43b..1d7bec42 100644 --- a/cdp-sdk-go/gen/iam/models/authentication_policy.go +++ b/cdp-sdk-go/gen/iam/models/authentication_policy.go @@ -23,6 +23,12 @@ type AuthenticationPolicy struct { // The inactivity duration, in seconds, of the access key, which would invalidate the access key due to no activity. The value of '0' indicates default inactivity duration (which is 1 hour normally and 15 minutes for Cloudera for Government). There's no access key invalidation from no activity if the value is greater or equal to expiration. AccessKeyInactivityDurationSec int32 `json:"accessKeyInactivityDurationSec,omitempty"` + // The list of IP addresses and/or CIDRs used for allowing client access to the UI and API services. Both the allowed list and the blocked list will be used to determine whether to grant or block the client's access. The blocked list takes precedence over the allowed list. When the list is empty or not set, client IP address will not be validated to be present in the allowed list. + ClientIPAddressesAllowed []string `json:"clientIpAddressesAllowed"` + + // The list of IP addresses and/or CIDRs used for blocking client access to the UI and API services. Both the allowed list and the blocked list will be used to determine whether to grant or block the client's access. The blocked list takes precedence over the allowed list. When the list is empty or not set, client IP address will not be validated to be absent from the blocked list. + ClientIPAddressesBlocked []string `json:"clientIpAddressesBlocked"` + // The expiration, in seconds, of the UI session token. The value of '0' indicates the system default expiration (which is 12 hours). SessionTokenExpirationSec int32 `json:"sessionTokenExpirationSec,omitempty"` diff --git a/cdp-sdk-go/gen/iam/models/delete_saml_provider_request.go b/cdp-sdk-go/gen/iam/models/delete_saml_provider_request.go index dbf2882b..b3675322 100644 --- a/cdp-sdk-go/gen/iam/models/delete_saml_provider_request.go +++ b/cdp-sdk-go/gen/iam/models/delete_saml_provider_request.go @@ -8,8 +8,10 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // DeleteSamlProviderRequest Request object for deleting SAML provider request. @@ -18,11 +20,30 @@ import ( type DeleteSamlProviderRequest struct { // The name or CRN of the SAML provider to delete. - SamlProviderName string `json:"samlProviderName,omitempty"` + // Required: true + SamlProviderName *string `json:"samlProviderName"` } // Validate validates this delete saml provider request func (m *DeleteSamlProviderRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSamlProviderName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeleteSamlProviderRequest) validateSamlProviderName(formats strfmt.Registry) error { + + if err := validate.Required("samlProviderName", "body", m.SamlProviderName); err != nil { + return err + } + return nil } diff --git a/cdp-sdk-go/gen/iam/models/describe_saml_provider_request.go b/cdp-sdk-go/gen/iam/models/describe_saml_provider_request.go index 0fb8da7e..ef833109 100644 --- a/cdp-sdk-go/gen/iam/models/describe_saml_provider_request.go +++ b/cdp-sdk-go/gen/iam/models/describe_saml_provider_request.go @@ -8,8 +8,10 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // DescribeSamlProviderRequest Request object for a describe SAML provider request. @@ -18,11 +20,30 @@ import ( type DescribeSamlProviderRequest struct { // The name or CRN of the SAML provider to describe. - SamlProviderName string `json:"samlProviderName,omitempty"` + // Required: true + SamlProviderName *string `json:"samlProviderName"` } // Validate validates this describe saml provider request func (m *DescribeSamlProviderRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSamlProviderName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DescribeSamlProviderRequest) validateSamlProviderName(formats strfmt.Registry) error { + + if err := validate.Required("samlProviderName", "body", m.SamlProviderName); err != nil { + return err + } + return nil } diff --git a/cdp-sdk-go/gen/iam/models/get_default_identity_provider_request.go b/cdp-sdk-go/gen/iam/models/get_default_identity_provider_request.go new file mode 100644 index 00000000..96eb1f0d --- /dev/null +++ b/cdp-sdk-go/gen/iam/models/get_default_identity_provider_request.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// GetDefaultIdentityProviderRequest Request object to get the default identity provider. +// +// swagger:model GetDefaultIdentityProviderRequest +type GetDefaultIdentityProviderRequest interface{} diff --git a/cdp-sdk-go/gen/iam/models/get_default_identity_provider_response.go b/cdp-sdk-go/gen/iam/models/get_default_identity_provider_response.go new file mode 100644 index 00000000..317bdce5 --- /dev/null +++ b/cdp-sdk-go/gen/iam/models/get_default_identity_provider_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GetDefaultIdentityProviderResponse Response object to get the default identity provider. +// +// swagger:model GetDefaultIdentityProviderResponse +type GetDefaultIdentityProviderResponse struct { + + // The CRN of the identity provider used for CDP initiated login requests. The CRN could be a user defined identity provider's CRN or one of the CDP built-ins (like Cloudera SSO). To retrieve more information about your own user-defined saml providers (or other provider types, not the default ones) call the relevant describeXXXProvider, e.g. for SAML providers call describeSamlProvider. + // Required: true + Crn *string `json:"crn"` +} + +// Validate validates this get default identity provider response +func (m *GetDefaultIdentityProviderResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCrn(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetDefaultIdentityProviderResponse) validateCrn(formats strfmt.Registry) error { + + if err := validate.Required("crn", "body", m.Crn); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this get default identity provider response based on context it is used +func (m *GetDefaultIdentityProviderResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetDefaultIdentityProviderResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetDefaultIdentityProviderResponse) UnmarshalBinary(b []byte) error { + var res GetDefaultIdentityProviderResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/iam/models/machine_user.go b/cdp-sdk-go/gen/iam/models/machine_user.go index 7fb9d8b4..5062db75 100644 --- a/cdp-sdk-go/gen/iam/models/machine_user.go +++ b/cdp-sdk-go/gen/iam/models/machine_user.go @@ -36,6 +36,9 @@ type MachineUser struct { // Required: true MachineUserName *string `json:"machineUserName"` + // The current status of the machine user. The possible status values are ACTIVE and CONTROL_PLANE_LOCKED_OUT. ACTIVE indicates that the machine user is active in CDP. An active machine user can authenticate to the CDP control plane and workload clusters. CONTROL_PLANE_LOCKED_OUT indicates that the machine user is locked out of the CDP control plane. The locked-out machine user can no longer authenticate to the control plane but can authenticate to the workload clusters. Note that more statuses could be added in the future. The statuses other than ACTIVE are only returned on Cloudera for Government. + Status string `json:"status,omitempty"` + // Information about the workload password for the machine user. WorkloadPasswordDetails *WorkloadPasswordDetails `json:"workloadPasswordDetails,omitempty"` diff --git a/cdp-sdk-go/gen/iam/models/set_authentication_policy_request.go b/cdp-sdk-go/gen/iam/models/set_authentication_policy_request.go index 93b8010e..15039ce4 100644 --- a/cdp-sdk-go/gen/iam/models/set_authentication_policy_request.go +++ b/cdp-sdk-go/gen/iam/models/set_authentication_policy_request.go @@ -27,6 +27,12 @@ type SetAuthenticationPolicyRequest struct { // Minimum: 0 AccessKeyInactivityDurationSec *int32 `json:"accessKeyInactivityDurationSec,omitempty"` + // The list of IP addresses and/or CIDRs used for allowing client access to the UI and API services. Duplicated values will be removed automatically. Both the allowed list and the blocked list will be used to determine whether to grant or block the client's access. The blocked list takes precedence over the allowed list. When the list is empty or not set, client IP address will not be validated to be present in the allowed list. + ClientIPAddressesAllowed []string `json:"clientIpAddressesAllowed"` + + // The list of IP addresses and/or CIDRs used for blocking client access to the UI and API services. Duplicated values will be removed automatically. Both the allowed list and the blocked list will be used to determine whether to grant or block the client's access. The blocked list takes precedence over the allowed list. When the list is empty or not set, client IP address will not be validated to be absent from the blocked list. + ClientIPAddressesBlocked []string `json:"clientIpAddressesBlocked"` + // The expiration, in seconds, of the UI session token. Set the value to '0' to use system default expiration (which is 12 hours for CDP). The value will be set to '0' if not provided. // Minimum: 0 SessionTokenExpirationSec *int32 `json:"sessionTokenExpirationSec,omitempty"` diff --git a/cdp-sdk-go/gen/iam/models/set_default_identity_provider_request.go b/cdp-sdk-go/gen/iam/models/set_default_identity_provider_request.go new file mode 100644 index 00000000..a324ad1d --- /dev/null +++ b/cdp-sdk-go/gen/iam/models/set_default_identity_provider_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SetDefaultIdentityProviderRequest Request object to set the default identity provider. +// +// swagger:model SetDefaultIdentityProviderRequest +type SetDefaultIdentityProviderRequest struct { + + // The name or CRN of the default identity provider. + // Required: true + NameOrCrn *string `json:"nameOrCrn"` +} + +// Validate validates this set default identity provider request +func (m *SetDefaultIdentityProviderRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNameOrCrn(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SetDefaultIdentityProviderRequest) validateNameOrCrn(formats strfmt.Registry) error { + + if err := validate.Required("nameOrCrn", "body", m.NameOrCrn); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this set default identity provider request based on context it is used +func (m *SetDefaultIdentityProviderRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SetDefaultIdentityProviderRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SetDefaultIdentityProviderRequest) UnmarshalBinary(b []byte) error { + var res SetDefaultIdentityProviderRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/iam/models/set_default_identity_provider_response.go b/cdp-sdk-go/gen/iam/models/set_default_identity_provider_response.go new file mode 100644 index 00000000..1a846372 --- /dev/null +++ b/cdp-sdk-go/gen/iam/models/set_default_identity_provider_response.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// SetDefaultIdentityProviderResponse Response object to set the default identity provider. +// +// swagger:model SetDefaultIdentityProviderResponse +type SetDefaultIdentityProviderResponse interface{} diff --git a/cdp-sdk-go/gen/iam/models/user.go b/cdp-sdk-go/gen/iam/models/user.go index d9ced3b5..a1481f23 100644 --- a/cdp-sdk-go/gen/iam/models/user.go +++ b/cdp-sdk-go/gen/iam/models/user.go @@ -56,6 +56,9 @@ type User struct { // Required: true LastName *string `json:"lastName"` + // The current status of the user. The possible status values are ACTIVE, CONTROL_PLANE_LOCKED_OUT, and DEACTIVATED. ACTIVE indicates that the user is active in CDP. An active user can authenticate to the CDP control plane and workload clusters. CONTROL_PLANE_LOCKED_OUT indicates that the user is locked out of the CDP control plane. The locked-out user can no longer authenticate to the control plane but can authenticate to the workload clusters. DEACTIVATED indicates that the user is deactivated in CDP. A deactivated user can neither authenticate to the control plane nor to the workload clusters. Note that more statuses could be added in the future. The statuses other than ACTIVE are only returned on Cloudera for Government. + Status string `json:"status,omitempty"` + // The stable, unique identifier of the user. // Required: true UserID *string `json:"userId"` diff --git a/cdp-sdk-go/gen/ml/client/operations/create_model_registry_parameters.go b/cdp-sdk-go/gen/ml/client/operations/create_model_registry_parameters.go new file mode 100644 index 00000000..6d8d7bce --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/create_model_registry_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// NewCreateModelRegistryParams creates a new CreateModelRegistryParams 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 NewCreateModelRegistryParams() *CreateModelRegistryParams { + return &CreateModelRegistryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateModelRegistryParamsWithTimeout creates a new CreateModelRegistryParams object +// with the ability to set a timeout on a request. +func NewCreateModelRegistryParamsWithTimeout(timeout time.Duration) *CreateModelRegistryParams { + return &CreateModelRegistryParams{ + timeout: timeout, + } +} + +// NewCreateModelRegistryParamsWithContext creates a new CreateModelRegistryParams object +// with the ability to set a context for a request. +func NewCreateModelRegistryParamsWithContext(ctx context.Context) *CreateModelRegistryParams { + return &CreateModelRegistryParams{ + Context: ctx, + } +} + +// NewCreateModelRegistryParamsWithHTTPClient creates a new CreateModelRegistryParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateModelRegistryParamsWithHTTPClient(client *http.Client) *CreateModelRegistryParams { + return &CreateModelRegistryParams{ + HTTPClient: client, + } +} + +/* +CreateModelRegistryParams contains all the parameters to send to the API endpoint + + for the create model registry operation. + + Typically these are written to a http.Request. +*/ +type CreateModelRegistryParams struct { + + // Input. + Input *models.CreateModelRegistryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create model registry params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateModelRegistryParams) WithDefaults() *CreateModelRegistryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create model registry params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateModelRegistryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create model registry params +func (o *CreateModelRegistryParams) WithTimeout(timeout time.Duration) *CreateModelRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create model registry params +func (o *CreateModelRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create model registry params +func (o *CreateModelRegistryParams) WithContext(ctx context.Context) *CreateModelRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create model registry params +func (o *CreateModelRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create model registry params +func (o *CreateModelRegistryParams) WithHTTPClient(client *http.Client) *CreateModelRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create model registry params +func (o *CreateModelRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the create model registry params +func (o *CreateModelRegistryParams) WithInput(input *models.CreateModelRegistryRequest) *CreateModelRegistryParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the create model registry params +func (o *CreateModelRegistryParams) SetInput(input *models.CreateModelRegistryRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateModelRegistryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/ml/client/operations/create_model_registry_responses.go b/cdp-sdk-go/gen/ml/client/operations/create_model_registry_responses.go new file mode 100644 index 00000000..28f530de --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/create_model_registry_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// CreateModelRegistryReader is a Reader for the CreateModelRegistry structure. +type CreateModelRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateModelRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateModelRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewCreateModelRegistryDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewCreateModelRegistryOK creates a CreateModelRegistryOK with default headers values +func NewCreateModelRegistryOK() *CreateModelRegistryOK { + return &CreateModelRegistryOK{} +} + +/* +CreateModelRegistryOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type CreateModelRegistryOK struct { + Payload models.CreateModelRegistryResponse +} + +// IsSuccess returns true when this create model registry o k response has a 2xx status code +func (o *CreateModelRegistryOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create model registry o k response has a 3xx status code +func (o *CreateModelRegistryOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create model registry o k response has a 4xx status code +func (o *CreateModelRegistryOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create model registry o k response has a 5xx status code +func (o *CreateModelRegistryOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create model registry o k response a status code equal to that given +func (o *CreateModelRegistryOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create model registry o k response +func (o *CreateModelRegistryOK) Code() int { + return 200 +} + +func (o *CreateModelRegistryOK) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/createModelRegistry][%d] createModelRegistryOK %+v", 200, o.Payload) +} + +func (o *CreateModelRegistryOK) String() string { + return fmt.Sprintf("[POST /api/v1/ml/createModelRegistry][%d] createModelRegistryOK %+v", 200, o.Payload) +} + +func (o *CreateModelRegistryOK) GetPayload() models.CreateModelRegistryResponse { + return o.Payload +} + +func (o *CreateModelRegistryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateModelRegistryDefault creates a CreateModelRegistryDefault with default headers values +func NewCreateModelRegistryDefault(code int) *CreateModelRegistryDefault { + return &CreateModelRegistryDefault{ + _statusCode: code, + } +} + +/* +CreateModelRegistryDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type CreateModelRegistryDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this create model registry default response has a 2xx status code +func (o *CreateModelRegistryDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this create model registry default response has a 3xx status code +func (o *CreateModelRegistryDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this create model registry default response has a 4xx status code +func (o *CreateModelRegistryDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this create model registry default response has a 5xx status code +func (o *CreateModelRegistryDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this create model registry default response a status code equal to that given +func (o *CreateModelRegistryDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the create model registry default response +func (o *CreateModelRegistryDefault) Code() int { + return o._statusCode +} + +func (o *CreateModelRegistryDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/createModelRegistry][%d] createModelRegistry default %+v", o._statusCode, o.Payload) +} + +func (o *CreateModelRegistryDefault) String() string { + return fmt.Sprintf("[POST /api/v1/ml/createModelRegistry][%d] createModelRegistry default %+v", o._statusCode, o.Payload) +} + +func (o *CreateModelRegistryDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *CreateModelRegistryDefault) 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/cdp-sdk-go/gen/ml/client/operations/delete_model_registry_parameters.go b/cdp-sdk-go/gen/ml/client/operations/delete_model_registry_parameters.go new file mode 100644 index 00000000..74210bb5 --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/delete_model_registry_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// NewDeleteModelRegistryParams creates a new DeleteModelRegistryParams 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 NewDeleteModelRegistryParams() *DeleteModelRegistryParams { + return &DeleteModelRegistryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteModelRegistryParamsWithTimeout creates a new DeleteModelRegistryParams object +// with the ability to set a timeout on a request. +func NewDeleteModelRegistryParamsWithTimeout(timeout time.Duration) *DeleteModelRegistryParams { + return &DeleteModelRegistryParams{ + timeout: timeout, + } +} + +// NewDeleteModelRegistryParamsWithContext creates a new DeleteModelRegistryParams object +// with the ability to set a context for a request. +func NewDeleteModelRegistryParamsWithContext(ctx context.Context) *DeleteModelRegistryParams { + return &DeleteModelRegistryParams{ + Context: ctx, + } +} + +// NewDeleteModelRegistryParamsWithHTTPClient creates a new DeleteModelRegistryParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteModelRegistryParamsWithHTTPClient(client *http.Client) *DeleteModelRegistryParams { + return &DeleteModelRegistryParams{ + HTTPClient: client, + } +} + +/* +DeleteModelRegistryParams contains all the parameters to send to the API endpoint + + for the delete model registry operation. + + Typically these are written to a http.Request. +*/ +type DeleteModelRegistryParams struct { + + // Input. + Input *models.DeleteModelRegistryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete model registry params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteModelRegistryParams) WithDefaults() *DeleteModelRegistryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete model registry params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteModelRegistryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete model registry params +func (o *DeleteModelRegistryParams) WithTimeout(timeout time.Duration) *DeleteModelRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete model registry params +func (o *DeleteModelRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete model registry params +func (o *DeleteModelRegistryParams) WithContext(ctx context.Context) *DeleteModelRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete model registry params +func (o *DeleteModelRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete model registry params +func (o *DeleteModelRegistryParams) WithHTTPClient(client *http.Client) *DeleteModelRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete model registry params +func (o *DeleteModelRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the delete model registry params +func (o *DeleteModelRegistryParams) WithInput(input *models.DeleteModelRegistryRequest) *DeleteModelRegistryParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the delete model registry params +func (o *DeleteModelRegistryParams) SetInput(input *models.DeleteModelRegistryRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteModelRegistryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/ml/client/operations/delete_model_registry_responses.go b/cdp-sdk-go/gen/ml/client/operations/delete_model_registry_responses.go new file mode 100644 index 00000000..97b66bd8 --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/delete_model_registry_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// DeleteModelRegistryReader is a Reader for the DeleteModelRegistry structure. +type DeleteModelRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteModelRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteModelRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDeleteModelRegistryDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDeleteModelRegistryOK creates a DeleteModelRegistryOK with default headers values +func NewDeleteModelRegistryOK() *DeleteModelRegistryOK { + return &DeleteModelRegistryOK{} +} + +/* +DeleteModelRegistryOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type DeleteModelRegistryOK struct { + Payload models.DeleteModelRegistryResponse +} + +// IsSuccess returns true when this delete model registry o k response has a 2xx status code +func (o *DeleteModelRegistryOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete model registry o k response has a 3xx status code +func (o *DeleteModelRegistryOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete model registry o k response has a 4xx status code +func (o *DeleteModelRegistryOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete model registry o k response has a 5xx status code +func (o *DeleteModelRegistryOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete model registry o k response a status code equal to that given +func (o *DeleteModelRegistryOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete model registry o k response +func (o *DeleteModelRegistryOK) Code() int { + return 200 +} + +func (o *DeleteModelRegistryOK) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/deleteModelRegistry][%d] deleteModelRegistryOK %+v", 200, o.Payload) +} + +func (o *DeleteModelRegistryOK) String() string { + return fmt.Sprintf("[POST /api/v1/ml/deleteModelRegistry][%d] deleteModelRegistryOK %+v", 200, o.Payload) +} + +func (o *DeleteModelRegistryOK) GetPayload() models.DeleteModelRegistryResponse { + return o.Payload +} + +func (o *DeleteModelRegistryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteModelRegistryDefault creates a DeleteModelRegistryDefault with default headers values +func NewDeleteModelRegistryDefault(code int) *DeleteModelRegistryDefault { + return &DeleteModelRegistryDefault{ + _statusCode: code, + } +} + +/* +DeleteModelRegistryDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type DeleteModelRegistryDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this delete model registry default response has a 2xx status code +func (o *DeleteModelRegistryDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this delete model registry default response has a 3xx status code +func (o *DeleteModelRegistryDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this delete model registry default response has a 4xx status code +func (o *DeleteModelRegistryDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this delete model registry default response has a 5xx status code +func (o *DeleteModelRegistryDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this delete model registry default response a status code equal to that given +func (o *DeleteModelRegistryDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the delete model registry default response +func (o *DeleteModelRegistryDefault) Code() int { + return o._statusCode +} + +func (o *DeleteModelRegistryDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/deleteModelRegistry][%d] deleteModelRegistry default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteModelRegistryDefault) String() string { + return fmt.Sprintf("[POST /api/v1/ml/deleteModelRegistry][%d] deleteModelRegistry default %+v", o._statusCode, o.Payload) +} + +func (o *DeleteModelRegistryDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *DeleteModelRegistryDefault) 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/cdp-sdk-go/gen/ml/client/operations/describe_model_registry_parameters.go b/cdp-sdk-go/gen/ml/client/operations/describe_model_registry_parameters.go new file mode 100644 index 00000000..aa04097f --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/describe_model_registry_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// NewDescribeModelRegistryParams creates a new DescribeModelRegistryParams 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 NewDescribeModelRegistryParams() *DescribeModelRegistryParams { + return &DescribeModelRegistryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDescribeModelRegistryParamsWithTimeout creates a new DescribeModelRegistryParams object +// with the ability to set a timeout on a request. +func NewDescribeModelRegistryParamsWithTimeout(timeout time.Duration) *DescribeModelRegistryParams { + return &DescribeModelRegistryParams{ + timeout: timeout, + } +} + +// NewDescribeModelRegistryParamsWithContext creates a new DescribeModelRegistryParams object +// with the ability to set a context for a request. +func NewDescribeModelRegistryParamsWithContext(ctx context.Context) *DescribeModelRegistryParams { + return &DescribeModelRegistryParams{ + Context: ctx, + } +} + +// NewDescribeModelRegistryParamsWithHTTPClient creates a new DescribeModelRegistryParams object +// with the ability to set a custom HTTPClient for a request. +func NewDescribeModelRegistryParamsWithHTTPClient(client *http.Client) *DescribeModelRegistryParams { + return &DescribeModelRegistryParams{ + HTTPClient: client, + } +} + +/* +DescribeModelRegistryParams contains all the parameters to send to the API endpoint + + for the describe model registry operation. + + Typically these are written to a http.Request. +*/ +type DescribeModelRegistryParams struct { + + // Input. + Input *models.DescribeModelRegistryRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the describe model registry params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DescribeModelRegistryParams) WithDefaults() *DescribeModelRegistryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the describe model registry params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DescribeModelRegistryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the describe model registry params +func (o *DescribeModelRegistryParams) WithTimeout(timeout time.Duration) *DescribeModelRegistryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the describe model registry params +func (o *DescribeModelRegistryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the describe model registry params +func (o *DescribeModelRegistryParams) WithContext(ctx context.Context) *DescribeModelRegistryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the describe model registry params +func (o *DescribeModelRegistryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the describe model registry params +func (o *DescribeModelRegistryParams) WithHTTPClient(client *http.Client) *DescribeModelRegistryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the describe model registry params +func (o *DescribeModelRegistryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the describe model registry params +func (o *DescribeModelRegistryParams) WithInput(input *models.DescribeModelRegistryRequest) *DescribeModelRegistryParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the describe model registry params +func (o *DescribeModelRegistryParams) SetInput(input *models.DescribeModelRegistryRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *DescribeModelRegistryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/ml/client/operations/describe_model_registry_responses.go b/cdp-sdk-go/gen/ml/client/operations/describe_model_registry_responses.go new file mode 100644 index 00000000..59af431a --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/describe_model_registry_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// DescribeModelRegistryReader is a Reader for the DescribeModelRegistry structure. +type DescribeModelRegistryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DescribeModelRegistryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDescribeModelRegistryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewDescribeModelRegistryDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewDescribeModelRegistryOK creates a DescribeModelRegistryOK with default headers values +func NewDescribeModelRegistryOK() *DescribeModelRegistryOK { + return &DescribeModelRegistryOK{} +} + +/* +DescribeModelRegistryOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type DescribeModelRegistryOK struct { + Payload *models.DescribeModelRegistryResponse +} + +// IsSuccess returns true when this describe model registry o k response has a 2xx status code +func (o *DescribeModelRegistryOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this describe model registry o k response has a 3xx status code +func (o *DescribeModelRegistryOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this describe model registry o k response has a 4xx status code +func (o *DescribeModelRegistryOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this describe model registry o k response has a 5xx status code +func (o *DescribeModelRegistryOK) IsServerError() bool { + return false +} + +// IsCode returns true when this describe model registry o k response a status code equal to that given +func (o *DescribeModelRegistryOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the describe model registry o k response +func (o *DescribeModelRegistryOK) Code() int { + return 200 +} + +func (o *DescribeModelRegistryOK) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/describeModelRegistry][%d] describeModelRegistryOK %+v", 200, o.Payload) +} + +func (o *DescribeModelRegistryOK) String() string { + return fmt.Sprintf("[POST /api/v1/ml/describeModelRegistry][%d] describeModelRegistryOK %+v", 200, o.Payload) +} + +func (o *DescribeModelRegistryOK) GetPayload() *models.DescribeModelRegistryResponse { + return o.Payload +} + +func (o *DescribeModelRegistryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DescribeModelRegistryResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDescribeModelRegistryDefault creates a DescribeModelRegistryDefault with default headers values +func NewDescribeModelRegistryDefault(code int) *DescribeModelRegistryDefault { + return &DescribeModelRegistryDefault{ + _statusCode: code, + } +} + +/* +DescribeModelRegistryDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type DescribeModelRegistryDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this describe model registry default response has a 2xx status code +func (o *DescribeModelRegistryDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this describe model registry default response has a 3xx status code +func (o *DescribeModelRegistryDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this describe model registry default response has a 4xx status code +func (o *DescribeModelRegistryDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this describe model registry default response has a 5xx status code +func (o *DescribeModelRegistryDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this describe model registry default response a status code equal to that given +func (o *DescribeModelRegistryDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the describe model registry default response +func (o *DescribeModelRegistryDefault) Code() int { + return o._statusCode +} + +func (o *DescribeModelRegistryDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/describeModelRegistry][%d] describeModelRegistry default %+v", o._statusCode, o.Payload) +} + +func (o *DescribeModelRegistryDefault) String() string { + return fmt.Sprintf("[POST /api/v1/ml/describeModelRegistry][%d] describeModelRegistry default %+v", o._statusCode, o.Payload) +} + +func (o *DescribeModelRegistryDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *DescribeModelRegistryDefault) 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/cdp-sdk-go/gen/ml/client/operations/get_model_registry_kubeconfig_parameters.go b/cdp-sdk-go/gen/ml/client/operations/get_model_registry_kubeconfig_parameters.go new file mode 100644 index 00000000..2c881891 --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/get_model_registry_kubeconfig_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// NewGetModelRegistryKubeconfigParams creates a new GetModelRegistryKubeconfigParams 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 NewGetModelRegistryKubeconfigParams() *GetModelRegistryKubeconfigParams { + return &GetModelRegistryKubeconfigParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetModelRegistryKubeconfigParamsWithTimeout creates a new GetModelRegistryKubeconfigParams object +// with the ability to set a timeout on a request. +func NewGetModelRegistryKubeconfigParamsWithTimeout(timeout time.Duration) *GetModelRegistryKubeconfigParams { + return &GetModelRegistryKubeconfigParams{ + timeout: timeout, + } +} + +// NewGetModelRegistryKubeconfigParamsWithContext creates a new GetModelRegistryKubeconfigParams object +// with the ability to set a context for a request. +func NewGetModelRegistryKubeconfigParamsWithContext(ctx context.Context) *GetModelRegistryKubeconfigParams { + return &GetModelRegistryKubeconfigParams{ + Context: ctx, + } +} + +// NewGetModelRegistryKubeconfigParamsWithHTTPClient creates a new GetModelRegistryKubeconfigParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetModelRegistryKubeconfigParamsWithHTTPClient(client *http.Client) *GetModelRegistryKubeconfigParams { + return &GetModelRegistryKubeconfigParams{ + HTTPClient: client, + } +} + +/* +GetModelRegistryKubeconfigParams contains all the parameters to send to the API endpoint + + for the get model registry kubeconfig operation. + + Typically these are written to a http.Request. +*/ +type GetModelRegistryKubeconfigParams struct { + + // Input. + Input *models.GetModelRegistryKubeconfigRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get model registry kubeconfig params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetModelRegistryKubeconfigParams) WithDefaults() *GetModelRegistryKubeconfigParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get model registry kubeconfig params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetModelRegistryKubeconfigParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get model registry kubeconfig params +func (o *GetModelRegistryKubeconfigParams) WithTimeout(timeout time.Duration) *GetModelRegistryKubeconfigParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get model registry kubeconfig params +func (o *GetModelRegistryKubeconfigParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get model registry kubeconfig params +func (o *GetModelRegistryKubeconfigParams) WithContext(ctx context.Context) *GetModelRegistryKubeconfigParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get model registry kubeconfig params +func (o *GetModelRegistryKubeconfigParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get model registry kubeconfig params +func (o *GetModelRegistryKubeconfigParams) WithHTTPClient(client *http.Client) *GetModelRegistryKubeconfigParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get model registry kubeconfig params +func (o *GetModelRegistryKubeconfigParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the get model registry kubeconfig params +func (o *GetModelRegistryKubeconfigParams) WithInput(input *models.GetModelRegistryKubeconfigRequest) *GetModelRegistryKubeconfigParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the get model registry kubeconfig params +func (o *GetModelRegistryKubeconfigParams) SetInput(input *models.GetModelRegistryKubeconfigRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *GetModelRegistryKubeconfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/ml/client/operations/get_model_registry_kubeconfig_responses.go b/cdp-sdk-go/gen/ml/client/operations/get_model_registry_kubeconfig_responses.go new file mode 100644 index 00000000..3aef4821 --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/get_model_registry_kubeconfig_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// GetModelRegistryKubeconfigReader is a Reader for the GetModelRegistryKubeconfig structure. +type GetModelRegistryKubeconfigReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetModelRegistryKubeconfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetModelRegistryKubeconfigOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGetModelRegistryKubeconfigDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGetModelRegistryKubeconfigOK creates a GetModelRegistryKubeconfigOK with default headers values +func NewGetModelRegistryKubeconfigOK() *GetModelRegistryKubeconfigOK { + return &GetModelRegistryKubeconfigOK{} +} + +/* +GetModelRegistryKubeconfigOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type GetModelRegistryKubeconfigOK struct { + Payload *models.GetModelRegistryKubeconfigResponse +} + +// IsSuccess returns true when this get model registry kubeconfig o k response has a 2xx status code +func (o *GetModelRegistryKubeconfigOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get model registry kubeconfig o k response has a 3xx status code +func (o *GetModelRegistryKubeconfigOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get model registry kubeconfig o k response has a 4xx status code +func (o *GetModelRegistryKubeconfigOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get model registry kubeconfig o k response has a 5xx status code +func (o *GetModelRegistryKubeconfigOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get model registry kubeconfig o k response a status code equal to that given +func (o *GetModelRegistryKubeconfigOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get model registry kubeconfig o k response +func (o *GetModelRegistryKubeconfigOK) Code() int { + return 200 +} + +func (o *GetModelRegistryKubeconfigOK) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/getModelRegistryKubeconfig][%d] getModelRegistryKubeconfigOK %+v", 200, o.Payload) +} + +func (o *GetModelRegistryKubeconfigOK) String() string { + return fmt.Sprintf("[POST /api/v1/ml/getModelRegistryKubeconfig][%d] getModelRegistryKubeconfigOK %+v", 200, o.Payload) +} + +func (o *GetModelRegistryKubeconfigOK) GetPayload() *models.GetModelRegistryKubeconfigResponse { + return o.Payload +} + +func (o *GetModelRegistryKubeconfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetModelRegistryKubeconfigResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetModelRegistryKubeconfigDefault creates a GetModelRegistryKubeconfigDefault with default headers values +func NewGetModelRegistryKubeconfigDefault(code int) *GetModelRegistryKubeconfigDefault { + return &GetModelRegistryKubeconfigDefault{ + _statusCode: code, + } +} + +/* +GetModelRegistryKubeconfigDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type GetModelRegistryKubeconfigDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this get model registry kubeconfig default response has a 2xx status code +func (o *GetModelRegistryKubeconfigDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this get model registry kubeconfig default response has a 3xx status code +func (o *GetModelRegistryKubeconfigDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this get model registry kubeconfig default response has a 4xx status code +func (o *GetModelRegistryKubeconfigDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this get model registry kubeconfig default response has a 5xx status code +func (o *GetModelRegistryKubeconfigDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this get model registry kubeconfig default response a status code equal to that given +func (o *GetModelRegistryKubeconfigDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the get model registry kubeconfig default response +func (o *GetModelRegistryKubeconfigDefault) Code() int { + return o._statusCode +} + +func (o *GetModelRegistryKubeconfigDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/getModelRegistryKubeconfig][%d] getModelRegistryKubeconfig default %+v", o._statusCode, o.Payload) +} + +func (o *GetModelRegistryKubeconfigDefault) String() string { + return fmt.Sprintf("[POST /api/v1/ml/getModelRegistryKubeconfig][%d] getModelRegistryKubeconfig default %+v", o._statusCode, o.Payload) +} + +func (o *GetModelRegistryKubeconfigDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *GetModelRegistryKubeconfigDefault) 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/cdp-sdk-go/gen/ml/client/operations/grant_model_registry_access_parameters.go b/cdp-sdk-go/gen/ml/client/operations/grant_model_registry_access_parameters.go new file mode 100644 index 00000000..c329fd6c --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/grant_model_registry_access_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// NewGrantModelRegistryAccessParams creates a new GrantModelRegistryAccessParams 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 NewGrantModelRegistryAccessParams() *GrantModelRegistryAccessParams { + return &GrantModelRegistryAccessParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGrantModelRegistryAccessParamsWithTimeout creates a new GrantModelRegistryAccessParams object +// with the ability to set a timeout on a request. +func NewGrantModelRegistryAccessParamsWithTimeout(timeout time.Duration) *GrantModelRegistryAccessParams { + return &GrantModelRegistryAccessParams{ + timeout: timeout, + } +} + +// NewGrantModelRegistryAccessParamsWithContext creates a new GrantModelRegistryAccessParams object +// with the ability to set a context for a request. +func NewGrantModelRegistryAccessParamsWithContext(ctx context.Context) *GrantModelRegistryAccessParams { + return &GrantModelRegistryAccessParams{ + Context: ctx, + } +} + +// NewGrantModelRegistryAccessParamsWithHTTPClient creates a new GrantModelRegistryAccessParams object +// with the ability to set a custom HTTPClient for a request. +func NewGrantModelRegistryAccessParamsWithHTTPClient(client *http.Client) *GrantModelRegistryAccessParams { + return &GrantModelRegistryAccessParams{ + HTTPClient: client, + } +} + +/* +GrantModelRegistryAccessParams contains all the parameters to send to the API endpoint + + for the grant model registry access operation. + + Typically these are written to a http.Request. +*/ +type GrantModelRegistryAccessParams struct { + + // Input. + Input *models.GrantModelRegistryAccessRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the grant model registry access params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GrantModelRegistryAccessParams) WithDefaults() *GrantModelRegistryAccessParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the grant model registry access params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GrantModelRegistryAccessParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the grant model registry access params +func (o *GrantModelRegistryAccessParams) WithTimeout(timeout time.Duration) *GrantModelRegistryAccessParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the grant model registry access params +func (o *GrantModelRegistryAccessParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the grant model registry access params +func (o *GrantModelRegistryAccessParams) WithContext(ctx context.Context) *GrantModelRegistryAccessParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the grant model registry access params +func (o *GrantModelRegistryAccessParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the grant model registry access params +func (o *GrantModelRegistryAccessParams) WithHTTPClient(client *http.Client) *GrantModelRegistryAccessParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the grant model registry access params +func (o *GrantModelRegistryAccessParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the grant model registry access params +func (o *GrantModelRegistryAccessParams) WithInput(input *models.GrantModelRegistryAccessRequest) *GrantModelRegistryAccessParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the grant model registry access params +func (o *GrantModelRegistryAccessParams) SetInput(input *models.GrantModelRegistryAccessRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *GrantModelRegistryAccessParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/ml/client/operations/grant_model_registry_access_responses.go b/cdp-sdk-go/gen/ml/client/operations/grant_model_registry_access_responses.go new file mode 100644 index 00000000..ef2cdebd --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/grant_model_registry_access_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// GrantModelRegistryAccessReader is a Reader for the GrantModelRegistryAccess structure. +type GrantModelRegistryAccessReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GrantModelRegistryAccessReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGrantModelRegistryAccessOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewGrantModelRegistryAccessDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewGrantModelRegistryAccessOK creates a GrantModelRegistryAccessOK with default headers values +func NewGrantModelRegistryAccessOK() *GrantModelRegistryAccessOK { + return &GrantModelRegistryAccessOK{} +} + +/* +GrantModelRegistryAccessOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type GrantModelRegistryAccessOK struct { + Payload *models.GrantModelRegistryAccessResponse +} + +// IsSuccess returns true when this grant model registry access o k response has a 2xx status code +func (o *GrantModelRegistryAccessOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this grant model registry access o k response has a 3xx status code +func (o *GrantModelRegistryAccessOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this grant model registry access o k response has a 4xx status code +func (o *GrantModelRegistryAccessOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this grant model registry access o k response has a 5xx status code +func (o *GrantModelRegistryAccessOK) IsServerError() bool { + return false +} + +// IsCode returns true when this grant model registry access o k response a status code equal to that given +func (o *GrantModelRegistryAccessOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the grant model registry access o k response +func (o *GrantModelRegistryAccessOK) Code() int { + return 200 +} + +func (o *GrantModelRegistryAccessOK) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/grantModelRegistryAccess][%d] grantModelRegistryAccessOK %+v", 200, o.Payload) +} + +func (o *GrantModelRegistryAccessOK) String() string { + return fmt.Sprintf("[POST /api/v1/ml/grantModelRegistryAccess][%d] grantModelRegistryAccessOK %+v", 200, o.Payload) +} + +func (o *GrantModelRegistryAccessOK) GetPayload() *models.GrantModelRegistryAccessResponse { + return o.Payload +} + +func (o *GrantModelRegistryAccessOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GrantModelRegistryAccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGrantModelRegistryAccessDefault creates a GrantModelRegistryAccessDefault with default headers values +func NewGrantModelRegistryAccessDefault(code int) *GrantModelRegistryAccessDefault { + return &GrantModelRegistryAccessDefault{ + _statusCode: code, + } +} + +/* +GrantModelRegistryAccessDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type GrantModelRegistryAccessDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this grant model registry access default response has a 2xx status code +func (o *GrantModelRegistryAccessDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this grant model registry access default response has a 3xx status code +func (o *GrantModelRegistryAccessDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this grant model registry access default response has a 4xx status code +func (o *GrantModelRegistryAccessDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this grant model registry access default response has a 5xx status code +func (o *GrantModelRegistryAccessDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this grant model registry access default response a status code equal to that given +func (o *GrantModelRegistryAccessDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the grant model registry access default response +func (o *GrantModelRegistryAccessDefault) Code() int { + return o._statusCode +} + +func (o *GrantModelRegistryAccessDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/grantModelRegistryAccess][%d] grantModelRegistryAccess default %+v", o._statusCode, o.Payload) +} + +func (o *GrantModelRegistryAccessDefault) String() string { + return fmt.Sprintf("[POST /api/v1/ml/grantModelRegistryAccess][%d] grantModelRegistryAccess default %+v", o._statusCode, o.Payload) +} + +func (o *GrantModelRegistryAccessDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *GrantModelRegistryAccessDefault) 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/cdp-sdk-go/gen/ml/client/operations/list_model_registries_parameters.go b/cdp-sdk-go/gen/ml/client/operations/list_model_registries_parameters.go new file mode 100644 index 00000000..36edd6c8 --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/list_model_registries_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// NewListModelRegistriesParams creates a new ListModelRegistriesParams 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 NewListModelRegistriesParams() *ListModelRegistriesParams { + return &ListModelRegistriesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListModelRegistriesParamsWithTimeout creates a new ListModelRegistriesParams object +// with the ability to set a timeout on a request. +func NewListModelRegistriesParamsWithTimeout(timeout time.Duration) *ListModelRegistriesParams { + return &ListModelRegistriesParams{ + timeout: timeout, + } +} + +// NewListModelRegistriesParamsWithContext creates a new ListModelRegistriesParams object +// with the ability to set a context for a request. +func NewListModelRegistriesParamsWithContext(ctx context.Context) *ListModelRegistriesParams { + return &ListModelRegistriesParams{ + Context: ctx, + } +} + +// NewListModelRegistriesParamsWithHTTPClient creates a new ListModelRegistriesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListModelRegistriesParamsWithHTTPClient(client *http.Client) *ListModelRegistriesParams { + return &ListModelRegistriesParams{ + HTTPClient: client, + } +} + +/* +ListModelRegistriesParams contains all the parameters to send to the API endpoint + + for the list model registries operation. + + Typically these are written to a http.Request. +*/ +type ListModelRegistriesParams struct { + + // Input. + Input models.ListModelRegistriesRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list model registries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListModelRegistriesParams) WithDefaults() *ListModelRegistriesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list model registries params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListModelRegistriesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list model registries params +func (o *ListModelRegistriesParams) WithTimeout(timeout time.Duration) *ListModelRegistriesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list model registries params +func (o *ListModelRegistriesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list model registries params +func (o *ListModelRegistriesParams) WithContext(ctx context.Context) *ListModelRegistriesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list model registries params +func (o *ListModelRegistriesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list model registries params +func (o *ListModelRegistriesParams) WithHTTPClient(client *http.Client) *ListModelRegistriesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list model registries params +func (o *ListModelRegistriesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the list model registries params +func (o *ListModelRegistriesParams) WithInput(input models.ListModelRegistriesRequest) *ListModelRegistriesParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the list model registries params +func (o *ListModelRegistriesParams) SetInput(input models.ListModelRegistriesRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *ListModelRegistriesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/ml/client/operations/list_model_registries_responses.go b/cdp-sdk-go/gen/ml/client/operations/list_model_registries_responses.go new file mode 100644 index 00000000..8a228b8e --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/list_model_registries_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// ListModelRegistriesReader is a Reader for the ListModelRegistries structure. +type ListModelRegistriesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListModelRegistriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListModelRegistriesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListModelRegistriesDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewListModelRegistriesOK creates a ListModelRegistriesOK with default headers values +func NewListModelRegistriesOK() *ListModelRegistriesOK { + return &ListModelRegistriesOK{} +} + +/* +ListModelRegistriesOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type ListModelRegistriesOK struct { + Payload *models.ListModelRegistriesResponse +} + +// IsSuccess returns true when this list model registries o k response has a 2xx status code +func (o *ListModelRegistriesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list model registries o k response has a 3xx status code +func (o *ListModelRegistriesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list model registries o k response has a 4xx status code +func (o *ListModelRegistriesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list model registries o k response has a 5xx status code +func (o *ListModelRegistriesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list model registries o k response a status code equal to that given +func (o *ListModelRegistriesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list model registries o k response +func (o *ListModelRegistriesOK) Code() int { + return 200 +} + +func (o *ListModelRegistriesOK) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/listModelRegistries][%d] listModelRegistriesOK %+v", 200, o.Payload) +} + +func (o *ListModelRegistriesOK) String() string { + return fmt.Sprintf("[POST /api/v1/ml/listModelRegistries][%d] listModelRegistriesOK %+v", 200, o.Payload) +} + +func (o *ListModelRegistriesOK) GetPayload() *models.ListModelRegistriesResponse { + return o.Payload +} + +func (o *ListModelRegistriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ListModelRegistriesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListModelRegistriesDefault creates a ListModelRegistriesDefault with default headers values +func NewListModelRegistriesDefault(code int) *ListModelRegistriesDefault { + return &ListModelRegistriesDefault{ + _statusCode: code, + } +} + +/* +ListModelRegistriesDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type ListModelRegistriesDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this list model registries default response has a 2xx status code +func (o *ListModelRegistriesDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this list model registries default response has a 3xx status code +func (o *ListModelRegistriesDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this list model registries default response has a 4xx status code +func (o *ListModelRegistriesDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this list model registries default response has a 5xx status code +func (o *ListModelRegistriesDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this list model registries default response a status code equal to that given +func (o *ListModelRegistriesDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the list model registries default response +func (o *ListModelRegistriesDefault) Code() int { + return o._statusCode +} + +func (o *ListModelRegistriesDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/listModelRegistries][%d] listModelRegistries default %+v", o._statusCode, o.Payload) +} + +func (o *ListModelRegistriesDefault) String() string { + return fmt.Sprintf("[POST /api/v1/ml/listModelRegistries][%d] listModelRegistries default %+v", o._statusCode, o.Payload) +} + +func (o *ListModelRegistriesDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ListModelRegistriesDefault) 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/cdp-sdk-go/gen/ml/client/operations/list_model_registry_access_parameters.go b/cdp-sdk-go/gen/ml/client/operations/list_model_registry_access_parameters.go new file mode 100644 index 00000000..d7b5d354 --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/list_model_registry_access_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// NewListModelRegistryAccessParams creates a new ListModelRegistryAccessParams 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 NewListModelRegistryAccessParams() *ListModelRegistryAccessParams { + return &ListModelRegistryAccessParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListModelRegistryAccessParamsWithTimeout creates a new ListModelRegistryAccessParams object +// with the ability to set a timeout on a request. +func NewListModelRegistryAccessParamsWithTimeout(timeout time.Duration) *ListModelRegistryAccessParams { + return &ListModelRegistryAccessParams{ + timeout: timeout, + } +} + +// NewListModelRegistryAccessParamsWithContext creates a new ListModelRegistryAccessParams object +// with the ability to set a context for a request. +func NewListModelRegistryAccessParamsWithContext(ctx context.Context) *ListModelRegistryAccessParams { + return &ListModelRegistryAccessParams{ + Context: ctx, + } +} + +// NewListModelRegistryAccessParamsWithHTTPClient creates a new ListModelRegistryAccessParams object +// with the ability to set a custom HTTPClient for a request. +func NewListModelRegistryAccessParamsWithHTTPClient(client *http.Client) *ListModelRegistryAccessParams { + return &ListModelRegistryAccessParams{ + HTTPClient: client, + } +} + +/* +ListModelRegistryAccessParams contains all the parameters to send to the API endpoint + + for the list model registry access operation. + + Typically these are written to a http.Request. +*/ +type ListModelRegistryAccessParams struct { + + // Input. + Input *models.ListModelRegistryAccessRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list model registry access params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListModelRegistryAccessParams) WithDefaults() *ListModelRegistryAccessParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list model registry access params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListModelRegistryAccessParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list model registry access params +func (o *ListModelRegistryAccessParams) WithTimeout(timeout time.Duration) *ListModelRegistryAccessParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list model registry access params +func (o *ListModelRegistryAccessParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list model registry access params +func (o *ListModelRegistryAccessParams) WithContext(ctx context.Context) *ListModelRegistryAccessParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list model registry access params +func (o *ListModelRegistryAccessParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list model registry access params +func (o *ListModelRegistryAccessParams) WithHTTPClient(client *http.Client) *ListModelRegistryAccessParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list model registry access params +func (o *ListModelRegistryAccessParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the list model registry access params +func (o *ListModelRegistryAccessParams) WithInput(input *models.ListModelRegistryAccessRequest) *ListModelRegistryAccessParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the list model registry access params +func (o *ListModelRegistryAccessParams) SetInput(input *models.ListModelRegistryAccessRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *ListModelRegistryAccessParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/ml/client/operations/list_model_registry_access_responses.go b/cdp-sdk-go/gen/ml/client/operations/list_model_registry_access_responses.go new file mode 100644 index 00000000..c584d607 --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/list_model_registry_access_responses.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// ListModelRegistryAccessReader is a Reader for the ListModelRegistryAccess structure. +type ListModelRegistryAccessReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListModelRegistryAccessReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListModelRegistryAccessOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListModelRegistryAccessDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewListModelRegistryAccessOK creates a ListModelRegistryAccessOK with default headers values +func NewListModelRegistryAccessOK() *ListModelRegistryAccessOK { + return &ListModelRegistryAccessOK{} +} + +/* +ListModelRegistryAccessOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type ListModelRegistryAccessOK struct { + Payload *models.ListModelRegistryAccessResponse +} + +// IsSuccess returns true when this list model registry access o k response has a 2xx status code +func (o *ListModelRegistryAccessOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list model registry access o k response has a 3xx status code +func (o *ListModelRegistryAccessOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list model registry access o k response has a 4xx status code +func (o *ListModelRegistryAccessOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list model registry access o k response has a 5xx status code +func (o *ListModelRegistryAccessOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list model registry access o k response a status code equal to that given +func (o *ListModelRegistryAccessOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list model registry access o k response +func (o *ListModelRegistryAccessOK) Code() int { + return 200 +} + +func (o *ListModelRegistryAccessOK) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/listModelRegistryAccess][%d] listModelRegistryAccessOK %+v", 200, o.Payload) +} + +func (o *ListModelRegistryAccessOK) String() string { + return fmt.Sprintf("[POST /api/v1/ml/listModelRegistryAccess][%d] listModelRegistryAccessOK %+v", 200, o.Payload) +} + +func (o *ListModelRegistryAccessOK) GetPayload() *models.ListModelRegistryAccessResponse { + return o.Payload +} + +func (o *ListModelRegistryAccessOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ListModelRegistryAccessResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListModelRegistryAccessDefault creates a ListModelRegistryAccessDefault with default headers values +func NewListModelRegistryAccessDefault(code int) *ListModelRegistryAccessDefault { + return &ListModelRegistryAccessDefault{ + _statusCode: code, + } +} + +/* +ListModelRegistryAccessDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type ListModelRegistryAccessDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this list model registry access default response has a 2xx status code +func (o *ListModelRegistryAccessDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this list model registry access default response has a 3xx status code +func (o *ListModelRegistryAccessDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this list model registry access default response has a 4xx status code +func (o *ListModelRegistryAccessDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this list model registry access default response has a 5xx status code +func (o *ListModelRegistryAccessDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this list model registry access default response a status code equal to that given +func (o *ListModelRegistryAccessDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the list model registry access default response +func (o *ListModelRegistryAccessDefault) Code() int { + return o._statusCode +} + +func (o *ListModelRegistryAccessDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/listModelRegistryAccess][%d] listModelRegistryAccess default %+v", o._statusCode, o.Payload) +} + +func (o *ListModelRegistryAccessDefault) String() string { + return fmt.Sprintf("[POST /api/v1/ml/listModelRegistryAccess][%d] listModelRegistryAccess default %+v", o._statusCode, o.Payload) +} + +func (o *ListModelRegistryAccessDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *ListModelRegistryAccessDefault) 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/cdp-sdk-go/gen/ml/client/operations/operations_client.go b/cdp-sdk-go/gen/ml/client/operations/operations_client.go index 1d912117..3054f89c 100644 --- a/cdp-sdk-go/gen/ml/client/operations/operations_client.go +++ b/cdp-sdk-go/gen/ml/client/operations/operations_client.go @@ -30,14 +30,20 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { BackupWorkspace(params *BackupWorkspaceParams, opts ...ClientOption) (*BackupWorkspaceOK, error) + CreateModelRegistry(params *CreateModelRegistryParams, opts ...ClientOption) (*CreateModelRegistryOK, error) + CreateWorkspace(params *CreateWorkspaceParams, opts ...ClientOption) (*CreateWorkspaceOK, error) DeleteBackup(params *DeleteBackupParams, opts ...ClientOption) (*DeleteBackupOK, error) DeleteInstanceGroup(params *DeleteInstanceGroupParams, opts ...ClientOption) (*DeleteInstanceGroupOK, error) + DeleteModelRegistry(params *DeleteModelRegistryParams, opts ...ClientOption) (*DeleteModelRegistryOK, error) + DeleteWorkspace(params *DeleteWorkspaceParams, opts ...ClientOption) (*DeleteWorkspaceOK, error) + DescribeModelRegistry(params *DescribeModelRegistryParams, opts ...ClientOption) (*DescribeModelRegistryOK, error) + DescribeWorkspace(params *DescribeWorkspaceParams, opts ...ClientOption) (*DescribeWorkspaceOK, error) GetAuditEvents(params *GetAuditEventsParams, opts ...ClientOption) (*GetAuditEventsOK, error) @@ -48,8 +54,16 @@ type ClientService interface { GetLogs(params *GetLogsParams, opts ...ClientOption) (*GetLogsOK, error) + GetModelRegistryKubeconfig(params *GetModelRegistryKubeconfigParams, opts ...ClientOption) (*GetModelRegistryKubeconfigOK, error) + + GrantModelRegistryAccess(params *GrantModelRegistryAccessParams, opts ...ClientOption) (*GrantModelRegistryAccessOK, error) + GrantWorkspaceAccess(params *GrantWorkspaceAccessParams, opts ...ClientOption) (*GrantWorkspaceAccessOK, error) + ListModelRegistries(params *ListModelRegistriesParams, opts ...ClientOption) (*ListModelRegistriesOK, error) + + ListModelRegistryAccess(params *ListModelRegistryAccessParams, opts ...ClientOption) (*ListModelRegistryAccessOK, error) + ListWorkspaceAccess(params *ListWorkspaceAccessParams, opts ...ClientOption) (*ListWorkspaceAccessOK, error) ListWorkspaceBackups(params *ListWorkspaceBackupsParams, opts ...ClientOption) (*ListWorkspaceBackupsOK, error) @@ -62,12 +76,16 @@ type ClientService interface { ModifyWorkspaceLoadBalancer(params *ModifyWorkspaceLoadBalancerParams, opts ...ClientOption) (*ModifyWorkspaceLoadBalancerOK, error) + RefreshModelRegistryConfigmap(params *RefreshModelRegistryConfigmapParams, opts ...ClientOption) (*RefreshModelRegistryConfigmapOK, error) + RequestWorkflowCancellation(params *RequestWorkflowCancellationParams, opts ...ClientOption) (*RequestWorkflowCancellationOK, error) RestoreWorkspace(params *RestoreWorkspaceParams, opts ...ClientOption) (*RestoreWorkspaceOK, error) ResumeWorkspace(params *ResumeWorkspaceParams, opts ...ClientOption) (*ResumeWorkspaceOK, error) + RevokeModelRegistryAccess(params *RevokeModelRegistryAccessParams, opts ...ClientOption) (*RevokeModelRegistryAccessOK, error) + RevokeWorkspaceAccess(params *RevokeWorkspaceAccessParams, opts ...ClientOption) (*RevokeWorkspaceAccessOK, error) SuspendWorkspace(params *SuspendWorkspaceParams, opts ...ClientOption) (*SuspendWorkspaceOK, error) @@ -116,6 +134,45 @@ func (a *Client) BackupWorkspace(params *BackupWorkspaceParams, opts ...ClientOp return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +CreateModelRegistry creates a new model registry + +Create a new model registry by creating a new workspace and install model registry on it. +*/ +func (a *Client) CreateModelRegistry(params *CreateModelRegistryParams, opts ...ClientOption) (*CreateModelRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateModelRegistryParams() + } + op := &runtime.ClientOperation{ + ID: "createModelRegistry", + Method: "POST", + PathPattern: "/api/v1/ml/createModelRegistry", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &CreateModelRegistryReader{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.(*CreateModelRegistryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*CreateModelRegistryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* CreateWorkspace creates a cloudera machine learning workspace @@ -233,6 +290,45 @@ func (a *Client) DeleteInstanceGroup(params *DeleteInstanceGroupParams, opts ... return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +DeleteModelRegistry deletes a model registry + +Delete a model registry. +*/ +func (a *Client) DeleteModelRegistry(params *DeleteModelRegistryParams, opts ...ClientOption) (*DeleteModelRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteModelRegistryParams() + } + op := &runtime.ClientOperation{ + ID: "deleteModelRegistry", + Method: "POST", + PathPattern: "/api/v1/ml/deleteModelRegistry", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteModelRegistryReader{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.(*DeleteModelRegistryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DeleteModelRegistryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* DeleteWorkspace deletes cloudera machine learning workspace @@ -272,6 +368,45 @@ func (a *Client) DeleteWorkspace(params *DeleteWorkspaceParams, opts ...ClientOp return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +DescribeModelRegistry describes cloudera machine learning model registry + +Describes a Cloudera Machine Learning Model Registry. +*/ +func (a *Client) DescribeModelRegistry(params *DescribeModelRegistryParams, opts ...ClientOption) (*DescribeModelRegistryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDescribeModelRegistryParams() + } + op := &runtime.ClientOperation{ + ID: "describeModelRegistry", + Method: "POST", + PathPattern: "/api/v1/ml/describeModelRegistry", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DescribeModelRegistryReader{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.(*DescribeModelRegistryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*DescribeModelRegistryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* DescribeWorkspace describes cloudera machine learning workspace @@ -467,6 +602,84 @@ func (a *Client) GetLogs(params *GetLogsParams, opts ...ClientOption) (*GetLogsO return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +GetModelRegistryKubeconfig gets model registry kubeconfig returns kube config for model registry + +Gets the Kubeconfig of the model registry cluster. +*/ +func (a *Client) GetModelRegistryKubeconfig(params *GetModelRegistryKubeconfigParams, opts ...ClientOption) (*GetModelRegistryKubeconfigOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetModelRegistryKubeconfigParams() + } + op := &runtime.ClientOperation{ + ID: "getModelRegistryKubeconfig", + Method: "POST", + PathPattern: "/api/v1/ml/getModelRegistryKubeconfig", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetModelRegistryKubeconfigReader{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.(*GetModelRegistryKubeconfigOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GetModelRegistryKubeconfigDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +GrantModelRegistryAccess grants model registry access cloudera machine learning model registry + +Grants an AWS user to perform Kubernetes operations on a Cloudera Machine Learning model registry via EKS. +*/ +func (a *Client) GrantModelRegistryAccess(params *GrantModelRegistryAccessParams, opts ...ClientOption) (*GrantModelRegistryAccessOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGrantModelRegistryAccessParams() + } + op := &runtime.ClientOperation{ + ID: "grantModelRegistryAccess", + Method: "POST", + PathPattern: "/api/v1/ml/grantModelRegistryAccess", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GrantModelRegistryAccessReader{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.(*GrantModelRegistryAccessOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*GrantModelRegistryAccessDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* GrantWorkspaceAccess grants workspace access cloudera machine learning workspace @@ -506,6 +719,84 @@ func (a *Client) GrantWorkspaceAccess(params *GrantWorkspaceAccessParams, opts . return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ListModelRegistries lists all model registries + +List all model registries. +*/ +func (a *Client) ListModelRegistries(params *ListModelRegistriesParams, opts ...ClientOption) (*ListModelRegistriesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListModelRegistriesParams() + } + op := &runtime.ClientOperation{ + ID: "listModelRegistries", + Method: "POST", + PathPattern: "/api/v1/ml/listModelRegistries", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListModelRegistriesReader{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.(*ListModelRegistriesOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListModelRegistriesDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +ListModelRegistryAccess lists workspace access cloudera machine learning model registry + +Lists users that can perform Kubernetes operations on a Cloudera Machine Learning model registry via EKS. +*/ +func (a *Client) ListModelRegistryAccess(params *ListModelRegistryAccessParams, opts ...ClientOption) (*ListModelRegistryAccessOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListModelRegistryAccessParams() + } + op := &runtime.ClientOperation{ + ID: "listModelRegistryAccess", + Method: "POST", + PathPattern: "/api/v1/ml/listModelRegistryAccess", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ListModelRegistryAccessReader{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.(*ListModelRegistryAccessOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListModelRegistryAccessDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* ListWorkspaceAccess lists workspace access cloudera machine learning workspace @@ -740,6 +1031,45 @@ func (a *Client) ModifyWorkspaceLoadBalancer(params *ModifyWorkspaceLoadBalancer return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +RefreshModelRegistryConfigmap refreshes the model registry configmap of the workspace + +Refreshes the model registry configmap of the workspace from the control plane. +*/ +func (a *Client) RefreshModelRegistryConfigmap(params *RefreshModelRegistryConfigmapParams, opts ...ClientOption) (*RefreshModelRegistryConfigmapOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRefreshModelRegistryConfigmapParams() + } + op := &runtime.ClientOperation{ + ID: "refreshModelRegistryConfigmap", + Method: "POST", + PathPattern: "/api/v1/ml/refreshModelRegistryConfigmap", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &RefreshModelRegistryConfigmapReader{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.(*RefreshModelRegistryConfigmapOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*RefreshModelRegistryConfigmapDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* RequestWorkflowCancellation requests a workflow cancellation @@ -857,6 +1187,45 @@ func (a *Client) ResumeWorkspace(params *ResumeWorkspaceParams, opts ...ClientOp return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +RevokeModelRegistryAccess revokes model registry access cloudera machine learning model registry + +Revokes an AWS user to perform Kubernetes operations on a Cloudera Machine Learning model registry via EKS. +*/ +func (a *Client) RevokeModelRegistryAccess(params *RevokeModelRegistryAccessParams, opts ...ClientOption) (*RevokeModelRegistryAccessOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRevokeModelRegistryAccessParams() + } + op := &runtime.ClientOperation{ + ID: "revokeModelRegistryAccess", + Method: "POST", + PathPattern: "/api/v1/ml/revokeModelRegistryAccess", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &RevokeModelRegistryAccessReader{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.(*RevokeModelRegistryAccessOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*RevokeModelRegistryAccessDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* RevokeWorkspaceAccess revokes workspace access cloudera machine learning workspace diff --git a/cdp-sdk-go/gen/ml/client/operations/refresh_model_registry_configmap_parameters.go b/cdp-sdk-go/gen/ml/client/operations/refresh_model_registry_configmap_parameters.go new file mode 100644 index 00000000..70b667e4 --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/refresh_model_registry_configmap_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// NewRefreshModelRegistryConfigmapParams creates a new RefreshModelRegistryConfigmapParams 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 NewRefreshModelRegistryConfigmapParams() *RefreshModelRegistryConfigmapParams { + return &RefreshModelRegistryConfigmapParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRefreshModelRegistryConfigmapParamsWithTimeout creates a new RefreshModelRegistryConfigmapParams object +// with the ability to set a timeout on a request. +func NewRefreshModelRegistryConfigmapParamsWithTimeout(timeout time.Duration) *RefreshModelRegistryConfigmapParams { + return &RefreshModelRegistryConfigmapParams{ + timeout: timeout, + } +} + +// NewRefreshModelRegistryConfigmapParamsWithContext creates a new RefreshModelRegistryConfigmapParams object +// with the ability to set a context for a request. +func NewRefreshModelRegistryConfigmapParamsWithContext(ctx context.Context) *RefreshModelRegistryConfigmapParams { + return &RefreshModelRegistryConfigmapParams{ + Context: ctx, + } +} + +// NewRefreshModelRegistryConfigmapParamsWithHTTPClient creates a new RefreshModelRegistryConfigmapParams object +// with the ability to set a custom HTTPClient for a request. +func NewRefreshModelRegistryConfigmapParamsWithHTTPClient(client *http.Client) *RefreshModelRegistryConfigmapParams { + return &RefreshModelRegistryConfigmapParams{ + HTTPClient: client, + } +} + +/* +RefreshModelRegistryConfigmapParams contains all the parameters to send to the API endpoint + + for the refresh model registry configmap operation. + + Typically these are written to a http.Request. +*/ +type RefreshModelRegistryConfigmapParams struct { + + // Input. + Input *models.RefreshModelRegistryConfigmapRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the refresh model registry configmap params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RefreshModelRegistryConfigmapParams) WithDefaults() *RefreshModelRegistryConfigmapParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the refresh model registry configmap params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RefreshModelRegistryConfigmapParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the refresh model registry configmap params +func (o *RefreshModelRegistryConfigmapParams) WithTimeout(timeout time.Duration) *RefreshModelRegistryConfigmapParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the refresh model registry configmap params +func (o *RefreshModelRegistryConfigmapParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the refresh model registry configmap params +func (o *RefreshModelRegistryConfigmapParams) WithContext(ctx context.Context) *RefreshModelRegistryConfigmapParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the refresh model registry configmap params +func (o *RefreshModelRegistryConfigmapParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the refresh model registry configmap params +func (o *RefreshModelRegistryConfigmapParams) WithHTTPClient(client *http.Client) *RefreshModelRegistryConfigmapParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the refresh model registry configmap params +func (o *RefreshModelRegistryConfigmapParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the refresh model registry configmap params +func (o *RefreshModelRegistryConfigmapParams) WithInput(input *models.RefreshModelRegistryConfigmapRequest) *RefreshModelRegistryConfigmapParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the refresh model registry configmap params +func (o *RefreshModelRegistryConfigmapParams) SetInput(input *models.RefreshModelRegistryConfigmapRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *RefreshModelRegistryConfigmapParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/ml/client/operations/refresh_model_registry_configmap_responses.go b/cdp-sdk-go/gen/ml/client/operations/refresh_model_registry_configmap_responses.go new file mode 100644 index 00000000..f231f4ff --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/refresh_model_registry_configmap_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// RefreshModelRegistryConfigmapReader is a Reader for the RefreshModelRegistryConfigmap structure. +type RefreshModelRegistryConfigmapReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RefreshModelRegistryConfigmapReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRefreshModelRegistryConfigmapOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewRefreshModelRegistryConfigmapDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewRefreshModelRegistryConfigmapOK creates a RefreshModelRegistryConfigmapOK with default headers values +func NewRefreshModelRegistryConfigmapOK() *RefreshModelRegistryConfigmapOK { + return &RefreshModelRegistryConfigmapOK{} +} + +/* +RefreshModelRegistryConfigmapOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type RefreshModelRegistryConfigmapOK struct { + Payload models.RefreshModelRegistryConfigmapResponse +} + +// IsSuccess returns true when this refresh model registry configmap o k response has a 2xx status code +func (o *RefreshModelRegistryConfigmapOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this refresh model registry configmap o k response has a 3xx status code +func (o *RefreshModelRegistryConfigmapOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this refresh model registry configmap o k response has a 4xx status code +func (o *RefreshModelRegistryConfigmapOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this refresh model registry configmap o k response has a 5xx status code +func (o *RefreshModelRegistryConfigmapOK) IsServerError() bool { + return false +} + +// IsCode returns true when this refresh model registry configmap o k response a status code equal to that given +func (o *RefreshModelRegistryConfigmapOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the refresh model registry configmap o k response +func (o *RefreshModelRegistryConfigmapOK) Code() int { + return 200 +} + +func (o *RefreshModelRegistryConfigmapOK) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/refreshModelRegistryConfigmap][%d] refreshModelRegistryConfigmapOK %+v", 200, o.Payload) +} + +func (o *RefreshModelRegistryConfigmapOK) String() string { + return fmt.Sprintf("[POST /api/v1/ml/refreshModelRegistryConfigmap][%d] refreshModelRegistryConfigmapOK %+v", 200, o.Payload) +} + +func (o *RefreshModelRegistryConfigmapOK) GetPayload() models.RefreshModelRegistryConfigmapResponse { + return o.Payload +} + +func (o *RefreshModelRegistryConfigmapOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRefreshModelRegistryConfigmapDefault creates a RefreshModelRegistryConfigmapDefault with default headers values +func NewRefreshModelRegistryConfigmapDefault(code int) *RefreshModelRegistryConfigmapDefault { + return &RefreshModelRegistryConfigmapDefault{ + _statusCode: code, + } +} + +/* +RefreshModelRegistryConfigmapDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type RefreshModelRegistryConfigmapDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this refresh model registry configmap default response has a 2xx status code +func (o *RefreshModelRegistryConfigmapDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this refresh model registry configmap default response has a 3xx status code +func (o *RefreshModelRegistryConfigmapDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this refresh model registry configmap default response has a 4xx status code +func (o *RefreshModelRegistryConfigmapDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this refresh model registry configmap default response has a 5xx status code +func (o *RefreshModelRegistryConfigmapDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this refresh model registry configmap default response a status code equal to that given +func (o *RefreshModelRegistryConfigmapDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the refresh model registry configmap default response +func (o *RefreshModelRegistryConfigmapDefault) Code() int { + return o._statusCode +} + +func (o *RefreshModelRegistryConfigmapDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/refreshModelRegistryConfigmap][%d] refreshModelRegistryConfigmap default %+v", o._statusCode, o.Payload) +} + +func (o *RefreshModelRegistryConfigmapDefault) String() string { + return fmt.Sprintf("[POST /api/v1/ml/refreshModelRegistryConfigmap][%d] refreshModelRegistryConfigmap default %+v", o._statusCode, o.Payload) +} + +func (o *RefreshModelRegistryConfigmapDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *RefreshModelRegistryConfigmapDefault) 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/cdp-sdk-go/gen/ml/client/operations/revoke_model_registry_access_parameters.go b/cdp-sdk-go/gen/ml/client/operations/revoke_model_registry_access_parameters.go new file mode 100644 index 00000000..68436ed6 --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/revoke_model_registry_access_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// NewRevokeModelRegistryAccessParams creates a new RevokeModelRegistryAccessParams 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 NewRevokeModelRegistryAccessParams() *RevokeModelRegistryAccessParams { + return &RevokeModelRegistryAccessParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRevokeModelRegistryAccessParamsWithTimeout creates a new RevokeModelRegistryAccessParams object +// with the ability to set a timeout on a request. +func NewRevokeModelRegistryAccessParamsWithTimeout(timeout time.Duration) *RevokeModelRegistryAccessParams { + return &RevokeModelRegistryAccessParams{ + timeout: timeout, + } +} + +// NewRevokeModelRegistryAccessParamsWithContext creates a new RevokeModelRegistryAccessParams object +// with the ability to set a context for a request. +func NewRevokeModelRegistryAccessParamsWithContext(ctx context.Context) *RevokeModelRegistryAccessParams { + return &RevokeModelRegistryAccessParams{ + Context: ctx, + } +} + +// NewRevokeModelRegistryAccessParamsWithHTTPClient creates a new RevokeModelRegistryAccessParams object +// with the ability to set a custom HTTPClient for a request. +func NewRevokeModelRegistryAccessParamsWithHTTPClient(client *http.Client) *RevokeModelRegistryAccessParams { + return &RevokeModelRegistryAccessParams{ + HTTPClient: client, + } +} + +/* +RevokeModelRegistryAccessParams contains all the parameters to send to the API endpoint + + for the revoke model registry access operation. + + Typically these are written to a http.Request. +*/ +type RevokeModelRegistryAccessParams struct { + + // Input. + Input *models.RevokeModelRegistryAccessRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the revoke model registry access params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevokeModelRegistryAccessParams) WithDefaults() *RevokeModelRegistryAccessParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the revoke model registry access params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RevokeModelRegistryAccessParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the revoke model registry access params +func (o *RevokeModelRegistryAccessParams) WithTimeout(timeout time.Duration) *RevokeModelRegistryAccessParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the revoke model registry access params +func (o *RevokeModelRegistryAccessParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the revoke model registry access params +func (o *RevokeModelRegistryAccessParams) WithContext(ctx context.Context) *RevokeModelRegistryAccessParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the revoke model registry access params +func (o *RevokeModelRegistryAccessParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the revoke model registry access params +func (o *RevokeModelRegistryAccessParams) WithHTTPClient(client *http.Client) *RevokeModelRegistryAccessParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the revoke model registry access params +func (o *RevokeModelRegistryAccessParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInput adds the input to the revoke model registry access params +func (o *RevokeModelRegistryAccessParams) WithInput(input *models.RevokeModelRegistryAccessRequest) *RevokeModelRegistryAccessParams { + o.SetInput(input) + return o +} + +// SetInput adds the input to the revoke model registry access params +func (o *RevokeModelRegistryAccessParams) SetInput(input *models.RevokeModelRegistryAccessRequest) { + o.Input = input +} + +// WriteToRequest writes these params to a swagger request +func (o *RevokeModelRegistryAccessParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Input != nil { + if err := r.SetBodyParam(o.Input); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/cdp-sdk-go/gen/ml/client/operations/revoke_model_registry_access_responses.go b/cdp-sdk-go/gen/ml/client/operations/revoke_model_registry_access_responses.go new file mode 100644 index 00000000..b7cc60bc --- /dev/null +++ b/cdp-sdk-go/gen/ml/client/operations/revoke_model_registry_access_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// 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/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/ml/models" +) + +// RevokeModelRegistryAccessReader is a Reader for the RevokeModelRegistryAccess structure. +type RevokeModelRegistryAccessReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RevokeModelRegistryAccessReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRevokeModelRegistryAccessOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewRevokeModelRegistryAccessDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewRevokeModelRegistryAccessOK creates a RevokeModelRegistryAccessOK with default headers values +func NewRevokeModelRegistryAccessOK() *RevokeModelRegistryAccessOK { + return &RevokeModelRegistryAccessOK{} +} + +/* +RevokeModelRegistryAccessOK describes a response with status code 200, with default header values. + +Expected response to a valid request. +*/ +type RevokeModelRegistryAccessOK struct { + Payload models.RevokeModelRegistryAccessResponse +} + +// IsSuccess returns true when this revoke model registry access o k response has a 2xx status code +func (o *RevokeModelRegistryAccessOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this revoke model registry access o k response has a 3xx status code +func (o *RevokeModelRegistryAccessOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this revoke model registry access o k response has a 4xx status code +func (o *RevokeModelRegistryAccessOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this revoke model registry access o k response has a 5xx status code +func (o *RevokeModelRegistryAccessOK) IsServerError() bool { + return false +} + +// IsCode returns true when this revoke model registry access o k response a status code equal to that given +func (o *RevokeModelRegistryAccessOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the revoke model registry access o k response +func (o *RevokeModelRegistryAccessOK) Code() int { + return 200 +} + +func (o *RevokeModelRegistryAccessOK) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/revokeModelRegistryAccess][%d] revokeModelRegistryAccessOK %+v", 200, o.Payload) +} + +func (o *RevokeModelRegistryAccessOK) String() string { + return fmt.Sprintf("[POST /api/v1/ml/revokeModelRegistryAccess][%d] revokeModelRegistryAccessOK %+v", 200, o.Payload) +} + +func (o *RevokeModelRegistryAccessOK) GetPayload() models.RevokeModelRegistryAccessResponse { + return o.Payload +} + +func (o *RevokeModelRegistryAccessOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRevokeModelRegistryAccessDefault creates a RevokeModelRegistryAccessDefault with default headers values +func NewRevokeModelRegistryAccessDefault(code int) *RevokeModelRegistryAccessDefault { + return &RevokeModelRegistryAccessDefault{ + _statusCode: code, + } +} + +/* +RevokeModelRegistryAccessDefault describes a response with status code -1, with default header values. + +The default response on an error. +*/ +type RevokeModelRegistryAccessDefault struct { + _statusCode int + + Payload *models.Error +} + +// IsSuccess returns true when this revoke model registry access default response has a 2xx status code +func (o *RevokeModelRegistryAccessDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this revoke model registry access default response has a 3xx status code +func (o *RevokeModelRegistryAccessDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this revoke model registry access default response has a 4xx status code +func (o *RevokeModelRegistryAccessDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this revoke model registry access default response has a 5xx status code +func (o *RevokeModelRegistryAccessDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this revoke model registry access default response a status code equal to that given +func (o *RevokeModelRegistryAccessDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the revoke model registry access default response +func (o *RevokeModelRegistryAccessDefault) Code() int { + return o._statusCode +} + +func (o *RevokeModelRegistryAccessDefault) Error() string { + return fmt.Sprintf("[POST /api/v1/ml/revokeModelRegistryAccess][%d] revokeModelRegistryAccess default %+v", o._statusCode, o.Payload) +} + +func (o *RevokeModelRegistryAccessDefault) String() string { + return fmt.Sprintf("[POST /api/v1/ml/revokeModelRegistryAccess][%d] revokeModelRegistryAccess default %+v", o._statusCode, o.Payload) +} + +func (o *RevokeModelRegistryAccessDefault) GetPayload() *models.Error { + return o.Payload +} + +func (o *RevokeModelRegistryAccessDefault) 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/cdp-sdk-go/gen/ml/models/create_model_registry_request.go b/cdp-sdk-go/gen/ml/models/create_model_registry_request.go new file mode 100644 index 00000000..19c6cc3d --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/create_model_registry_request.go @@ -0,0 +1,251 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CreateModelRegistryRequest Request object for creating model registry. +// +// swagger:model CreateModelRegistryRequest +type CreateModelRegistryRequest struct { + + // Deprecated. The create workspace request on which model registry helm chart is deployed. + CreateWorkspacePayload *CreateWorkspaceRequest `json:"createWorkspacePayload,omitempty"` + + // The creator of model registry. + CreatorCrn string `json:"creatorCrn,omitempty"` + + // The environment CRN of model registry. + EnvironmentCrn string `json:"environmentCrn,omitempty"` + + // The environment for the model registry to create. + EnvironmentName string `json:"environmentName,omitempty"` + + // The namespace of the model registry. + Namespace string `json:"namespace,omitempty"` + + // Outbound Types provided for the cluster. + OutboundTypes []OutboundTypes `json:"outboundTypes"` + + // Whether to create a private cluster. + PrivateCluster bool `json:"privateCluster,omitempty"` + + // The request for Kubernetes cluster provision. Required in public cloud. + ProvisionK8sRequest *ModelRegistryProvisionK8sRequest `json:"provisionK8sRequest,omitempty"` + + // The S3 access key of Ozone. + S3AccessKey string `json:"s3AccessKey,omitempty"` + + // The s3Bucket of Ozone. + S3Bucket string `json:"s3Bucket,omitempty"` + + // The endpoint of Ozone. + S3Endpoint string `json:"s3Endpoint,omitempty"` + + // The S3 secret key of Ozone. + S3SecretKey string `json:"s3SecretKey,omitempty"` + + // Skip pre-flight validations if requested. + SkipValidation bool `json:"skipValidation,omitempty"` + + // The list of subnets used for the load balancer that CML creates. + SubnetsForLoadBalancers []string `json:"subnetsForLoadBalancers"` + + // The boolean flag to request a public load balancer. By default, a private load balancer is used. + UsePublicLoadBalancer bool `json:"usePublicLoadBalancer,omitempty"` +} + +// Validate validates this create model registry request +func (m *CreateModelRegistryRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreateWorkspacePayload(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOutboundTypes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProvisionK8sRequest(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateModelRegistryRequest) validateCreateWorkspacePayload(formats strfmt.Registry) error { + if swag.IsZero(m.CreateWorkspacePayload) { // not required + return nil + } + + if m.CreateWorkspacePayload != nil { + if err := m.CreateWorkspacePayload.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("createWorkspacePayload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("createWorkspacePayload") + } + return err + } + } + + return nil +} + +func (m *CreateModelRegistryRequest) validateOutboundTypes(formats strfmt.Registry) error { + if swag.IsZero(m.OutboundTypes) { // not required + return nil + } + + for i := 0; i < len(m.OutboundTypes); i++ { + + if err := m.OutboundTypes[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("outboundTypes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("outboundTypes" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *CreateModelRegistryRequest) validateProvisionK8sRequest(formats strfmt.Registry) error { + if swag.IsZero(m.ProvisionK8sRequest) { // not required + return nil + } + + if m.ProvisionK8sRequest != nil { + if err := m.ProvisionK8sRequest.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("provisionK8sRequest") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("provisionK8sRequest") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create model registry request based on the context it is used +func (m *CreateModelRegistryRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreateWorkspacePayload(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOutboundTypes(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProvisionK8sRequest(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateModelRegistryRequest) contextValidateCreateWorkspacePayload(ctx context.Context, formats strfmt.Registry) error { + + if m.CreateWorkspacePayload != nil { + + if swag.IsZero(m.CreateWorkspacePayload) { // not required + return nil + } + + if err := m.CreateWorkspacePayload.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("createWorkspacePayload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("createWorkspacePayload") + } + return err + } + } + + return nil +} + +func (m *CreateModelRegistryRequest) contextValidateOutboundTypes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.OutboundTypes); i++ { + + if swag.IsZero(m.OutboundTypes[i]) { // not required + return nil + } + + if err := m.OutboundTypes[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("outboundTypes" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("outboundTypes" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *CreateModelRegistryRequest) contextValidateProvisionK8sRequest(ctx context.Context, formats strfmt.Registry) error { + + if m.ProvisionK8sRequest != nil { + + if swag.IsZero(m.ProvisionK8sRequest) { // not required + return nil + } + + if err := m.ProvisionK8sRequest.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("provisionK8sRequest") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("provisionK8sRequest") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateModelRegistryRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateModelRegistryRequest) UnmarshalBinary(b []byte) error { + var res CreateModelRegistryRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/create_model_registry_response.go b/cdp-sdk-go/gen/ml/models/create_model_registry_response.go new file mode 100644 index 00000000..a95e0bf2 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/create_model_registry_response.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// CreateModelRegistryResponse Response for creating model registry request. +// +// swagger:model CreateModelRegistryResponse +type CreateModelRegistryResponse interface{} diff --git a/cdp-sdk-go/gen/ml/models/delete_model_registry_request.go b/cdp-sdk-go/gen/ml/models/delete_model_registry_request.go new file mode 100644 index 00000000..45527082 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/delete_model_registry_request.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DeleteModelRegistryRequest Request for deleting model registry. +// +// swagger:model DeleteModelRegistryRequest +type DeleteModelRegistryRequest struct { + + // Force delete a model registry workspace even if errors occur during deletion. Force delete removes the guarantee that resources in your cloud account will be cleaned up. By default, force is set to false. + Force bool `json:"force,omitempty"` + + // Deprecated, please use modelRegistryCrn. The environment CRN of the model registry. + ID string `json:"id,omitempty"` + + // CRN of the model registry to be deleted. + ModelRegistryCrn string `json:"modelRegistryCrn,omitempty"` + + // Deprecated. The workspace CRN of the model registry (Public cloud only). + WorkspaceCrn string `json:"workspaceCrn,omitempty"` +} + +// Validate validates this delete model registry request +func (m *DeleteModelRegistryRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this delete model registry request based on context it is used +func (m *DeleteModelRegistryRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeleteModelRegistryRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeleteModelRegistryRequest) UnmarshalBinary(b []byte) error { + var res DeleteModelRegistryRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/delete_model_registry_response.go b/cdp-sdk-go/gen/ml/models/delete_model_registry_response.go new file mode 100644 index 00000000..b4f77828 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/delete_model_registry_response.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// DeleteModelRegistryResponse Delete model registry response. +// +// swagger:model DeleteModelRegistryResponse +type DeleteModelRegistryResponse interface{} diff --git a/cdp-sdk-go/gen/ml/models/describe_model_registry_request.go b/cdp-sdk-go/gen/ml/models/describe_model_registry_request.go new file mode 100644 index 00000000..62484446 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/describe_model_registry_request.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DescribeModelRegistryRequest Request object for the DescribeModelRegistry method. +// +// swagger:model DescribeModelRegistryRequest +type DescribeModelRegistryRequest struct { + + // The CRN of the Model Registry to describe. + // Required: true + ModelRegistryCrn *string `json:"modelRegistryCrn"` +} + +// Validate validates this describe model registry request +func (m *DescribeModelRegistryRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateModelRegistryCrn(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DescribeModelRegistryRequest) validateModelRegistryCrn(formats strfmt.Registry) error { + + if err := validate.Required("modelRegistryCrn", "body", m.ModelRegistryCrn); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this describe model registry request based on context it is used +func (m *DescribeModelRegistryRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DescribeModelRegistryRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DescribeModelRegistryRequest) UnmarshalBinary(b []byte) error { + var res DescribeModelRegistryRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/describe_model_registry_response.go b/cdp-sdk-go/gen/ml/models/describe_model_registry_response.go new file mode 100644 index 00000000..e0cca3b9 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/describe_model_registry_response.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DescribeModelRegistryResponse Response object for the DescribeModelRegistry method. +// +// swagger:model DescribeModelRegistryResponse +type DescribeModelRegistryResponse struct { + + // The workspace. + // Required: true + ModelRegistry *ModelRegistry `json:"modelRegistry"` +} + +// Validate validates this describe model registry response +func (m *DescribeModelRegistryResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateModelRegistry(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DescribeModelRegistryResponse) validateModelRegistry(formats strfmt.Registry) error { + + if err := validate.Required("modelRegistry", "body", m.ModelRegistry); err != nil { + return err + } + + if m.ModelRegistry != nil { + if err := m.ModelRegistry.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelRegistry") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelRegistry") + } + return err + } + } + + return nil +} + +// ContextValidate validate this describe model registry response based on the context it is used +func (m *DescribeModelRegistryResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateModelRegistry(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DescribeModelRegistryResponse) contextValidateModelRegistry(ctx context.Context, formats strfmt.Registry) error { + + if m.ModelRegistry != nil { + + if err := m.ModelRegistry.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelRegistry") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelRegistry") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DescribeModelRegistryResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DescribeModelRegistryResponse) UnmarshalBinary(b []byte) error { + var res DescribeModelRegistryResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/get_audit_events_request.go b/cdp-sdk-go/gen/ml/models/get_audit_events_request.go index a6a984ed..bd9d00a8 100644 --- a/cdp-sdk-go/gen/ml/models/get_audit_events_request.go +++ b/cdp-sdk-go/gen/ml/models/get_audit_events_request.go @@ -8,10 +8,8 @@ package models import ( "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/go-openapi/validate" ) // GetAuditEventsRequest GetAuditEventsRequest to get all audit events for a given workspace crn. @@ -19,31 +17,15 @@ import ( // swagger:model GetAuditEventsRequest type GetAuditEventsRequest struct { - // Workspace crn for which audit events to be fetched. - // Required: true - WorkspaceCrn *string `json:"workspaceCrn"` + // Resource crn for which audit events to be fetched. Resource can be workspace or model registry. + ResourceCrn string `json:"resourceCrn,omitempty"` + + // Deprecated, please begin to use Resource crn, as this will soon be unsupported. + WorkspaceCrn string `json:"workspaceCrn,omitempty"` } // Validate validates this get audit events request func (m *GetAuditEventsRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateWorkspaceCrn(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GetAuditEventsRequest) validateWorkspaceCrn(formats strfmt.Registry) error { - - if err := validate.Required("workspaceCrn", "body", m.WorkspaceCrn); err != nil { - return err - } - return nil } diff --git a/cdp-sdk-go/gen/ml/models/get_logs_request.go b/cdp-sdk-go/gen/ml/models/get_logs_request.go index b516cadc..c04e7ee1 100644 --- a/cdp-sdk-go/gen/ml/models/get_logs_request.go +++ b/cdp-sdk-go/gen/ml/models/get_logs_request.go @@ -14,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// GetLogsRequest GetLogsRequestfor getting logs for a request ID. +// GetLogsRequest GetLogsRequest for getting logs for a request ID. // // swagger:model GetLogsRequest type GetLogsRequest struct { @@ -32,9 +32,8 @@ type GetLogsRequest struct { // Required: true RequestID *string `json:"requestID"` - // WorkspaceCrn the requestID belongs to. - // Required: true - WorkspaceCrn *string `json:"workspaceCrn"` + // Deprecated. Please begin to use resourceCrn, as this will soon be unsupported + WorkspaceCrn string `json:"workspaceCrn,omitempty"` } // Validate validates this get logs request @@ -45,10 +44,6 @@ func (m *GetLogsRequest) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateWorkspaceCrn(formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -64,15 +59,6 @@ func (m *GetLogsRequest) validateRequestID(formats strfmt.Registry) error { return nil } -func (m *GetLogsRequest) validateWorkspaceCrn(formats strfmt.Registry) error { - - if err := validate.Required("workspaceCrn", "body", m.WorkspaceCrn); err != nil { - return err - } - - return nil -} - // ContextValidate validates this get logs request based on context it is used func (m *GetLogsRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/cdp-sdk-go/gen/ml/models/get_model_registry_kubeconfig_request.go b/cdp-sdk-go/gen/ml/models/get_model_registry_kubeconfig_request.go new file mode 100644 index 00000000..b319f189 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/get_model_registry_kubeconfig_request.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetModelRegistryKubeconfigRequest Request object for GetModelRegistryKubeconfig. +// +// swagger:model GetModelRegistryKubeconfigRequest +type GetModelRegistryKubeconfigRequest struct { + + // CRN of the Model Registry + ModelRegistryCrn string `json:"modelRegistryCrn,omitempty"` +} + +// Validate validates this get model registry kubeconfig request +func (m *GetModelRegistryKubeconfigRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get model registry kubeconfig request based on context it is used +func (m *GetModelRegistryKubeconfigRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetModelRegistryKubeconfigRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetModelRegistryKubeconfigRequest) UnmarshalBinary(b []byte) error { + var res GetModelRegistryKubeconfigRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/get_model_registry_kubeconfig_response.go b/cdp-sdk-go/gen/ml/models/get_model_registry_kubeconfig_response.go new file mode 100644 index 00000000..4e126c54 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/get_model_registry_kubeconfig_response.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetModelRegistryKubeconfigResponse GetModelRegistryKubeconfigResponse response provides model registry kube config. +// +// swagger:model GetModelRegistryKubeconfigResponse +type GetModelRegistryKubeconfigResponse struct { + + // KubeConfig of the model registry cluster + KubeConfig string `json:"kubeConfig,omitempty"` +} + +// Validate validates this get model registry kubeconfig response +func (m *GetModelRegistryKubeconfigResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this get model registry kubeconfig response based on context it is used +func (m *GetModelRegistryKubeconfigResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetModelRegistryKubeconfigResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetModelRegistryKubeconfigResponse) UnmarshalBinary(b []byte) error { + var res GetModelRegistryKubeconfigResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/grant_model_registry_access_request.go b/cdp-sdk-go/gen/ml/models/grant_model_registry_access_request.go new file mode 100644 index 00000000..452370c4 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/grant_model_registry_access_request.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GrantModelRegistryAccessRequest Request object for the GrantModelRegistryAccess method. +// +// swagger:model GrantModelRegistryAccessRequest +type GrantModelRegistryAccessRequest struct { + + // The cloud provider user id, such as ARN, which will be granted access to the model registry's Kubernetes cluster. + Identifier string `json:"identifier,omitempty"` + + // The CRN of the Model Registry to grant access to. + ResourceCrn string `json:"resourceCrn,omitempty"` +} + +// Validate validates this grant model registry access request +func (m *GrantModelRegistryAccessRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this grant model registry access request based on context it is used +func (m *GrantModelRegistryAccessRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GrantModelRegistryAccessRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GrantModelRegistryAccessRequest) UnmarshalBinary(b []byte) error { + var res GrantModelRegistryAccessRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/grant_model_registry_access_response.go b/cdp-sdk-go/gen/ml/models/grant_model_registry_access_response.go new file mode 100644 index 00000000..955bd1a3 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/grant_model_registry_access_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GrantModelRegistryAccessResponse Response object for the GrantModelRegistryAccess method. +// +// swagger:model GrantModelRegistryAccessResponse +type GrantModelRegistryAccessResponse struct { + + // The Kubernetes config file + // Required: true + Kubeconfig *string `json:"kubeconfig"` +} + +// Validate validates this grant model registry access response +func (m *GrantModelRegistryAccessResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateKubeconfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GrantModelRegistryAccessResponse) validateKubeconfig(formats strfmt.Registry) error { + + if err := validate.Required("kubeconfig", "body", m.Kubeconfig); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this grant model registry access response based on context it is used +func (m *GrantModelRegistryAccessResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GrantModelRegistryAccessResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GrantModelRegistryAccessResponse) UnmarshalBinary(b []byte) error { + var res GrantModelRegistryAccessResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/list_model_registries_request.go b/cdp-sdk-go/gen/ml/models/list_model_registries_request.go new file mode 100644 index 00000000..52f26b5d --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/list_model_registries_request.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// ListModelRegistriesRequest Request object for deleting model registry. +// +// swagger:model ListModelRegistriesRequest +type ListModelRegistriesRequest interface{} diff --git a/cdp-sdk-go/gen/ml/models/list_model_registries_response.go b/cdp-sdk-go/gen/ml/models/list_model_registries_response.go new file mode 100644 index 00000000..a046c0a1 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/list_model_registries_response.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ListModelRegistriesResponse List of all available model registries. +// +// swagger:model ListModelRegistriesResponse +type ListModelRegistriesResponse struct { + + // The list of model registry. + ModelRegistries []*ModelRegistry `json:"modelRegistries"` +} + +// Validate validates this list model registries response +func (m *ListModelRegistriesResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateModelRegistries(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListModelRegistriesResponse) validateModelRegistries(formats strfmt.Registry) error { + if swag.IsZero(m.ModelRegistries) { // not required + return nil + } + + for i := 0; i < len(m.ModelRegistries); i++ { + if swag.IsZero(m.ModelRegistries[i]) { // not required + continue + } + + if m.ModelRegistries[i] != nil { + if err := m.ModelRegistries[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelRegistries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelRegistries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this list model registries response based on the context it is used +func (m *ListModelRegistriesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateModelRegistries(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListModelRegistriesResponse) contextValidateModelRegistries(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ModelRegistries); i++ { + + if m.ModelRegistries[i] != nil { + + if swag.IsZero(m.ModelRegistries[i]) { // not required + return nil + } + + if err := m.ModelRegistries[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelRegistries" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelRegistries" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ListModelRegistriesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListModelRegistriesResponse) UnmarshalBinary(b []byte) error { + var res ListModelRegistriesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/list_model_registry_access_request.go b/cdp-sdk-go/gen/ml/models/list_model_registry_access_request.go new file mode 100644 index 00000000..841390cf --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/list_model_registry_access_request.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ListModelRegistryAccessRequest Request object for the ListModelRegistryAccess method. +// +// swagger:model ListModelRegistryAccessRequest +type ListModelRegistryAccessRequest struct { + + // The CRN of the Model Registry to list access. + ResourceCrn string `json:"resourceCrn,omitempty"` +} + +// Validate validates this list model registry access request +func (m *ListModelRegistryAccessRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this list model registry access request based on context it is used +func (m *ListModelRegistryAccessRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ListModelRegistryAccessRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListModelRegistryAccessRequest) UnmarshalBinary(b []byte) error { + var res ListModelRegistryAccessRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/list_model_registry_access_response.go b/cdp-sdk-go/gen/ml/models/list_model_registry_access_response.go new file mode 100644 index 00000000..2e70641b --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/list_model_registry_access_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ListModelRegistryAccessResponse Response object for the ListModelRegistryAccess method. +// +// swagger:model ListModelRegistryAccessResponse +type ListModelRegistryAccessResponse struct { + + // The list of users that have access. + // Required: true + Users []string `json:"users"` +} + +// Validate validates this list model registry access response +func (m *ListModelRegistryAccessResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUsers(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListModelRegistryAccessResponse) validateUsers(formats strfmt.Registry) error { + + if err := validate.Required("users", "body", m.Users); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this list model registry access response based on context it is used +func (m *ListModelRegistryAccessResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ListModelRegistryAccessResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListModelRegistryAccessResponse) UnmarshalBinary(b []byte) error { + var res ListModelRegistryAccessResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/model_registry.go b/cdp-sdk-go/gen/ml/models/model_registry.go new file mode 100644 index 00000000..2921a36f --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/model_registry.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ModelRegistry Model registry object +// +// swagger:model ModelRegistry +type ModelRegistry struct { + + // The creation time of model registry. + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // The creator of model registry. + Creator string `json:"creator,omitempty"` + + // ModelRegistry CRN. + Crn string `json:"crn,omitempty"` + + // The environment CRN of model registry. + EnvironmentCrn string `json:"environmentCrn,omitempty"` + + // Environment name. + EnvironmentName string `json:"environmentName,omitempty"` + + // The id of model registry. + ID int64 `json:"id,omitempty"` + + // The machine user CRN of the model registry. + MachineUserCrn string `json:"machineUserCrn,omitempty"` + + // The namespace of model registry. + Namespace string `json:"namespace,omitempty"` + + // The s3 bucket of model registry. + S3Bucket string `json:"s3Bucket,omitempty"` + + // The Ozone endpoint of model registry. + S3Endpoint string `json:"s3Endpoint,omitempty"` + + // The service name of model registry. + ServiceName string `json:"serviceName,omitempty"` + + // The status of model registry. + Status string `json:"status,omitempty"` + + // Deprecated. WorkSpace CRN. This field is no longer used. + WorkspaceCrn string `json:"workspaceCrn,omitempty"` + + // Deprecated, please refer to serviceName. Workspace name. + WorkspaceName string `json:"workspaceName,omitempty"` +} + +// Validate validates this model registry +func (m *ModelRegistry) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelRegistry) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this model registry based on context it is used +func (m *ModelRegistry) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ModelRegistry) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelRegistry) UnmarshalBinary(b []byte) error { + var res ModelRegistry + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/model_registry_provision_k8s_request.go b/cdp-sdk-go/gen/ml/models/model_registry_provision_k8s_request.go new file mode 100644 index 00000000..2b27edfa --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/model_registry_provision_k8s_request.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ModelRegistryProvisionK8sRequest Request object for provisioning model registry. +// +// swagger:model ModelRegistryProvisionK8sRequest +type ModelRegistryProvisionK8sRequest struct { + + // The overlay network for an AWS Kubernetes cluster's CNI. + Network *OverlayNetwork `json:"network,omitempty"` + + // Tags to add to the cloud provider resources created. This is in addition to any tags added by Cloudera. + Tags []*ProvisionTag `json:"tags"` +} + +// Validate validates this model registry provision k8s request +func (m *ModelRegistryProvisionK8sRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNetwork(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelRegistryProvisionK8sRequest) validateNetwork(formats strfmt.Registry) error { + if swag.IsZero(m.Network) { // not required + return nil + } + + if m.Network != nil { + if err := m.Network.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("network") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("network") + } + return err + } + } + + return nil +} + +func (m *ModelRegistryProvisionK8sRequest) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this model registry provision k8s request based on the context it is used +func (m *ModelRegistryProvisionK8sRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNetwork(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ModelRegistryProvisionK8sRequest) contextValidateNetwork(ctx context.Context, formats strfmt.Registry) error { + + if m.Network != nil { + + if swag.IsZero(m.Network) { // not required + return nil + } + + if err := m.Network.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("network") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("network") + } + return err + } + } + + return nil +} + +func (m *ModelRegistryProvisionK8sRequest) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + + if swag.IsZero(m.Tags[i]) { // not required + return nil + } + + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ModelRegistryProvisionK8sRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ModelRegistryProvisionK8sRequest) UnmarshalBinary(b []byte) error { + var res ModelRegistryProvisionK8sRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/refresh_model_registry_configmap_request.go b/cdp-sdk-go/gen/ml/models/refresh_model_registry_configmap_request.go new file mode 100644 index 00000000..43d30b25 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/refresh_model_registry_configmap_request.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RefreshModelRegistryConfigmapRequest Request for refreshing workspace's model registry configmap. +// +// swagger:model RefreshModelRegistryConfigmapRequest +type RefreshModelRegistryConfigmapRequest struct { + + // Workspace CRN. + WorkspaceCrn string `json:"workspaceCrn,omitempty"` +} + +// Validate validates this refresh model registry configmap request +func (m *RefreshModelRegistryConfigmapRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this refresh model registry configmap request based on context it is used +func (m *RefreshModelRegistryConfigmapRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RefreshModelRegistryConfigmapRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RefreshModelRegistryConfigmapRequest) UnmarshalBinary(b []byte) error { + var res RefreshModelRegistryConfigmapRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/refresh_model_registry_configmap_response.go b/cdp-sdk-go/gen/ml/models/refresh_model_registry_configmap_response.go new file mode 100644 index 00000000..ac2b12e3 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/refresh_model_registry_configmap_response.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// RefreshModelRegistryConfigmapResponse Response for refreshing workspace's model registry configmap. +// +// swagger:model RefreshModelRegistryConfigmapResponse +type RefreshModelRegistryConfigmapResponse interface{} diff --git a/cdp-sdk-go/gen/ml/models/revoke_model_registry_access_request.go b/cdp-sdk-go/gen/ml/models/revoke_model_registry_access_request.go new file mode 100644 index 00000000..affb5bce --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/revoke_model_registry_access_request.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RevokeModelRegistryAccessRequest Request object for the RevokeModelRegistry method. +// +// swagger:model RevokeModelRegistryAccessRequest +type RevokeModelRegistryAccessRequest struct { + + // The cloud provider user id, such as ARN, which will be granted access to the model registry's Kubernetes cluster. + Identifier string `json:"identifier,omitempty"` + + // The CRN of the Model Registry to grant access to. + ResourceCrn string `json:"resourceCrn,omitempty"` +} + +// Validate validates this revoke model registry access request +func (m *RevokeModelRegistryAccessRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this revoke model registry access request based on context it is used +func (m *RevokeModelRegistryAccessRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RevokeModelRegistryAccessRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RevokeModelRegistryAccessRequest) UnmarshalBinary(b []byte) error { + var res RevokeModelRegistryAccessRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/cdp-sdk-go/gen/ml/models/revoke_model_registry_access_response.go b/cdp-sdk-go/gen/ml/models/revoke_model_registry_access_response.go new file mode 100644 index 00000000..4f7b5a30 --- /dev/null +++ b/cdp-sdk-go/gen/ml/models/revoke_model_registry_access_response.go @@ -0,0 +1,11 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// RevokeModelRegistryAccessResponse Response object for the RevokeModelRegistryAccess method. +// +// swagger:model RevokeModelRegistryAccessResponse +type RevokeModelRegistryAccessResponse interface{} diff --git a/cdp-sdk-go/gen/ml/models/workspace.go b/cdp-sdk-go/gen/ml/models/workspace.go index f8b7d38d..76c64847 100644 --- a/cdp-sdk-go/gen/ml/models/workspace.go +++ b/cdp-sdk-go/gen/ml/models/workspace.go @@ -96,6 +96,9 @@ type Workspace struct { // The value to indicate if the cluster is private or not. IsPrivate bool `json:"isPrivate,omitempty"` + // The value to indicate if the workspace is restored one or not + IsRestored bool `json:"isRestored,omitempty"` + // The Kubernetes cluster name. // Required: true K8sClusterName *string `json:"k8sClusterName"` diff --git a/cdp-sdk-go/gen/ml/models/workspace_summary.go b/cdp-sdk-go/gen/ml/models/workspace_summary.go index 898bc37a..f17d7d7a 100644 --- a/cdp-sdk-go/gen/ml/models/workspace_summary.go +++ b/cdp-sdk-go/gen/ml/models/workspace_summary.go @@ -79,6 +79,9 @@ type WorkspaceSummary struct { // The value to indicate if the cluster is private or not. IsPrivate bool `json:"isPrivate,omitempty"` + // The value to indicate if the workspace is restored one or not + IsRestored bool `json:"isRestored,omitempty"` + // The Kubernetes cluster name. // Required: true K8sClusterName *string `json:"k8sClusterName"` diff --git a/cdp-sdk-go/resources/swagger/datahub.yaml b/cdp-sdk-go/resources/swagger/datahub.yaml index 2ce2f288..d17f439e 100644 --- a/cdp-sdk-go/resources/swagger/datahub.yaml +++ b/cdp-sdk-go/resources/swagger/datahub.yaml @@ -6,7 +6,7 @@ x-form-factors: public x-cdp-releases: PUBLIC x-audit: true info: - version: 0.9.91 (BETA) + version: 0.9.103 (BETA) title: Cloudera Data hub Service license: name: Apache 2.0 @@ -147,6 +147,27 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/datahub/createAWSGovCloudCluster: + post: + summary: Creates an AWS Data Hub cluster for GovCloud. + description: Creates an AWS Data Hub cluster for GovCloud. + operationId: createAWSGovCloudCluster + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/CreateAWSGovCloudClusterRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/CreateAWSGovCloudClusterResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/datahub/createAzureCluster: post: summary: Creates an Azure workload cluster. @@ -1098,7 +1119,7 @@ paths: /api/v1/datahub/startClusterVerticalScaling: post: summary: Initiates the vertical scaling on Data Hub cluster. - description: Initiates the vertical scaling on Data Hub cluster. + description: Initiates the vertical scaling on Data Hub cluster. You have the option to either specify one of 'deleteDisks', 'modifyDisks' or 'addDisks' or 'instanceTemplate' as parameter. operationId: startClusterVerticalScaling x-mutating: true parameters: @@ -1158,6 +1179,28 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/datahub/describeDatabaseServer: + post: + summary: Gets external database server details. + x-no-compatibility-guarantee: true + description: Gets external database server details for Data Hub cluster by cluster CRN + operationId: describeDatabaseServer + x-mutating: false + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/DescribeDatabaseServerRequest' + responses: + 200: + description: Database server details for the requested resource. + schema: + $ref: '#/definitions/DescribeDatabaseServerResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/datahub/setCatalog: post: summary: Sets a catalog for a DataHub. @@ -1200,6 +1243,50 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/datahub/getOperation: + post: + summary: Get the latest (in progress or finished) operation for the datahub cluster. + description: Get the latest (in progress or finished) operation for the datahub cluster. + operationId: getOperation + x-mutating: false + x-no-compatibility-guarantee: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/GetOperationRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/GetOperationResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/datahub/getVmTypes: + post: + summary: Creates a recommendation that advises virtual machine types for the given cluster template based on the given properties. + description: Creates a recommendation that advises virtual machine types for the given cluster template based on the given properties. + operationId: getVmTypes + x-mutating: false + x-no-compatibility-guarantee: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/GetVmTypesRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/GetVmTypesResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/datahub/startInstances: post: summary: Starts instances of a particular host group in the Data Hub cluster. @@ -1299,9 +1386,6 @@ definitions: ImageRequest: type: object description: The details of the image used for cluster instances. - required: - - id - - catalogName properties: id: type: string @@ -1309,6 +1393,9 @@ definitions: catalogName: type: string description: The image catalog name. + os: + type: string + description: The OS of the image used for cluster instances. ImageDetails: type: object description: The details of the image used for cluster instances. @@ -1319,6 +1406,9 @@ definitions: id: type: string description: The ID of the image used for cluster instances. This is internally generated by the cloud provider to uniquely identify the image. + os: + type: string + description: The OS of the image used for cluster instances. catalogUrl: type: string description: The image catalog URL. @@ -1369,6 +1459,9 @@ definitions: environmentCrn: type: string description: The CRN of the environment. + environmentName: + type: string + description: The name of the environment. credentialCrn: type: string description: The CRN of the credential. @@ -1387,6 +1480,10 @@ definitions: endpoints: $ref: '#/definitions/Endpoints' description: The exposed service api endpoints. + multiAz: + default: false + type: boolean + description: Flag that toggles the multi availability zone for the given datahub cluster when you are not sure what subnet IDs can be used. This way the subnet IDs will be used what the environment suggests. ClusterExtension: type: object description: Cluster extensions for Data Hub cluster. @@ -1438,7 +1535,6 @@ definitions: required: - datahub - group - - instanceTemplate properties: datahub: type: string @@ -1449,6 +1545,9 @@ definitions: instanceTemplate: description: Instance template that specifies the core information for the vertical scale. $ref: '#/definitions/InstanceTemplate' + diskOptions: + description: Disk options for vertical scaling. Available options are - add, remove, or modify. + $ref: '#/definitions/DiskOptions' StartClusterVerticalScalingResponse: type: object description: The response object for Data Hub cluster vertical scaling. @@ -1463,6 +1562,27 @@ definitions: instanceType: type: string description: The type of the instance. + DiskOptions: + type: object + description: Attached disk configuration(s). + properties: + modifyDisks: + description: Modifies all the disks attached to all instances in a group. + $ref: '#/definitions/ModifyDisks' + ModifyDisks: + type: object + description: Attached volume configuration. + required: + - volumeType + - size + properties: + volumeType: + type: string + description: Type of disks to modify on all the instances in a group. + size: + type: integer + format: int32 + description: Size of disks to modify on all the instances in a group in GB. Instance: type: object description: Object which holds some details of an instance for the given cluster. @@ -1626,6 +1746,9 @@ definitions: environmentCrn: type: string description: The CRN of the environment. + environmentName: + type: string + description: The name of the environment. cloudPlatform: type: string description: The name of the cloud platform. @@ -2529,6 +2652,74 @@ definitions: cluster: $ref: '#/definitions/Cluster' description: The cluster. + CreateAWSGovCloudClusterRequest: + type: object + description: Request object for creating AWS Data Hub cluster request on GovCloud. + properties: + clusterName: + type: string + description: The name of the cluster. This name must be unique, must have between 5 and 40 characters, and must contain only lowercase letters, numbers, and hyphens. Names are case-sensitive. + minLength: 5 + maxLength: 40 + clusterDefinition: + type: string + description: The name or CRN of the cluster definition to use for cluster creation. + environment: + type: string + description: Name or CRN of the environment to use when creating the cluster. The environment must be an AWS GovCloud environment. + clusterTemplate: + type: string + description: Name or CRN of the cluster template to use for cluster creation. + instanceGroups: + type: array + items: + $ref: '#/definitions/InstanceGroupRequest' + description: Instance group details. + subnetId: + type: string + description: The subnet ID. + image: + $ref: '#/definitions/ImageRequest' + description: The image to be used for cluster creation. + tags: + type: array + description: Tags to be added to Data Hub related resources. + items: + $ref: '#/definitions/DatahubResourceTagRequest' + requestTemplate: + type: string + description: JSON template to use for cluster creation. This is different from the cluster template and would be removed in the future. + datahubDatabase: + $ref: '#/definitions/DatahubDatabaseType' + description: 'Database type for datahub. Currently supported values: NONE, NON_HA, HA' + subnetIds: + type: array + items: + type: string + description: List of subnet IDs in case of multi availability zone setup. + multiAz: + type: boolean + description: Flag that toggles the multi availability zone for the given Data Hub cluster when you are not sure what subnet IDs can be used. This way the subnet IDs will be used what the environment suggests. + clusterExtension: + $ref: '#/definitions/ClusterExtension' + description: Cluster extensions for the given Data Hub cluster. + x-no-compatibility-guarantee: true + enableLoadBalancer: + type: boolean + description: Flag that decides whether to provision a load-balancer to front various service endpoints for the given datahub. This will typically be used for HA cluster shapes. + javaVersion: + type: integer + format: int32 + description: Configure the major version of Java on the cluster. + CreateAWSGovCloudClusterResponse: + type: object + description: Response object for create AWS cluster request on GovCloud. + required: + - cluster + properties: + cluster: + $ref: '#/definitions/Cluster' + description: The cluster. CreateAzureClusterRequest: type: object description: Request object for create Azure cluster request. @@ -2572,6 +2763,10 @@ definitions: datahubDatabase: $ref: '#/definitions/DatahubDatabaseType' description: 'Database type for datahub. Currently supported values: NONE, NON_HA, HA' + multiAz: + default: false + type: boolean + description: Flag that toggles the multi availability zone feature for the given datahub cluster when unsure what subnet IDs can be used. When true, the subnet IDs suggested by the environment will be used. loadBalancerSku: description: The SKU for the datahub load balancer. Allowed values are "BASIC", "STANDARD", or "NONE". $ref: '#/definitions/DatahubLoadBalancerSkuType' @@ -2582,6 +2777,12 @@ definitions: enableLoadBalancer: type: boolean description: Flag that decides whether to provision a load-balancer to front various service endpoints for the given datahub. This will typically be used for HA cluster shapes. + databaseType: + type: string + description: The type of the azure database. FLEXIBLE_SERVER is the next generation managed PostgreSQL service in Azure that provides maximum flexibility over your database, built-in cost-optimizations. SINGLE_SERVER is a fully managed database service with minimal requirements for customizations of the database. + enum: + - FLEXIBLE_SERVER + - SINGLE_SERVER javaVersion: type: integer format: int32 @@ -4049,6 +4250,78 @@ definitions: description: Array of log descriptors. (useful for diagnostics collection filtering) items: $ref: '#/definitions/DatahubVmLogResponse' + GetVmTypesRequest: + x-no-compatibility-guarantee: true + type: object + description: Request object for fetching the available virtual machine types based on the given parameters. + required: + - clusterTemplate + - credential + - region + properties: + clusterTemplate: + type: string + description: The name of the given cluster template. + credential: + type: string + description: The name or CRN of the credential that is required to access the cloud provider. + region: + type: string + description: The region where we should look for the supported VM types. + availabilityZone: + type: string + description: The selected availability zone. + clusterDefinitionName: + type: string + description: The name of the cluster definition. + GetVmTypesResponse: + x-no-compatibility-guarantee: true + type: object + description: Response object from the VM type fetch operation. + properties: + vmTypes: + description: The supported VM types based on the given parameters. + type: array + items: + type: string + GetOperationRequest: + type: object + x-no-compatibility-guarantee: true + description: Request object for tracking the latest (current/last) operation on the datahub resource. + required: + - crn + properties: + crn: + type: string + description: CRN of the datahub resource. + operationId: + type: string + description: Filter by operation id. + x-no-compatibility-guarantee: true + GetOperationResponse: + type: object + x-no-compatibility-guarantee: true + description: Response object for tracking the latest (current/last) operation on the datahub resource. + properties: + operationId: + type: string + description: Identifier of the operation. + operationType: + type: string + description: Type of the operation. + operationStatus: + type: string + description: Status of the operation. + enum: + - UNKNOWN + - RUNNING + - FAILED + - FINISHED + - CANCELLED + progress: + type: integer + format: int32 + description: Progress percentage of the operation. RotateAutoTlsCertificatesRequest: type: object description: Request object to rotate autotls certificates on datahub's hosts, deprecated. @@ -4194,6 +4467,10 @@ definitions: description: The database engine major version to upgrade to. enum: - VERSION_11 + - VERSION_14 + force: + type: boolean + description: Start the database upgrade flow even if the source and target versions are the same. Can be used to reinitiate an upgrade after a failure. StartDatabaseUpgradeResponse: type: object description: Response object to Data Hub database upgrade. @@ -4201,8 +4478,91 @@ definitions: targetVersion: type: string description: The database engine major version to upgrade to. + DescribeDatabaseServerRequest: + x-no-compatibility-guarantee: true + type: object + description: Request object for obtaining Database Server details. + properties: + clusterCrn: + description: CRN of the Data Hub cluster + type: string + DescribeDatabaseServerResponse: + x-no-compatibility-guarantee: true + type: object + description: Response object for obtaining Database Server details. + properties: + crn: + type: string + description: CRN of the database server + name: + type: string + description: Name of the database server + description: + type: string + description: Description of the database server + environmentCrn: + type: string + description: CRN of the environment of the database server + host: + type: string + description: Host of the database server + port: + type: integer + format: int32 + description: Port of the database server + databaseVendor: + type: string + description: Name of the database vendor (MYSQL, POSTGRES, ...) + databaseVendorDisplayName: + type: string + description: Display name of the database vendor (MySQL, PostgreSQL, ...) + creationDate: + type: string + format: date-time + description: Creation date of the database server + resourceStatus: + type: string + description: Ownership status of the database server enum: - - VERSION_11 + - UNKNOWN + - SERVICE_MANAGED + - USER_MANAGED + status: + type: string + description: Status of the database server stack + enum: + - REQUESTED + - CREATE_IN_PROGRESS + - AVAILABLE + - UPDATE_IN_PROGRESS + - UPDATE_REQUESTED + - UPDATE_FAILED + - CREATE_FAILED + - ENABLE_SECURITY_FAILED + - DELETE_REQUESTED + - PRE_DELETE_IN_PROGRESS + - DELETE_IN_PROGRESS + - DELETE_FAILED + - DELETE_COMPLETED + - STOPPED + - STOP_REQUESTED + - START_REQUESTED + - STOP_IN_PROGRESS + - START_IN_PROGRESS + - START_FAILED + - STOP_FAILED + - WAIT_FOR_SYNC + - MAINTENANCE_MODE_ENABLED + - UNKNOWN + statusReason: + type: string + description: Additional status information about the database server stack + clusterCrn: + type: string + description: CRN of the cluster of the database server + sslConfig: + description: SSL configuration of the database server + $ref: '#/definitions/DatabaseServerSslConfig' SetCatalogRequest: type: object description: The request object to set catalog for a DataHub. @@ -4219,6 +4579,30 @@ definitions: SetCatalogResponse: type: object description: The response object to set catalog for a DataHub request. + DatabaseServerSslConfig: + x-no-compatibility-guarantee: true + description: SSL configuration for the database server + type: object + properties: + sslCertificates: + type: array + description: Set of SSL certificates for the actual database server + uniqueItems: true + items: + type: string + sslCertificateType: + type: string + description: SSL certificate type + enum: + - CLOUD_PROVIDER_OWNED + - BRING_YOUR_OWN + - NONE + sslMode: + type: string + description: SSL enforcement mode for the actual database server + enum: + - ENABLED + - DISABLED SyncComponentVersionsFromCmRequest: type: object description: Datahub sync CM component versions request. diff --git a/cdp-sdk-go/resources/swagger/datalake.yaml b/cdp-sdk-go/resources/swagger/datalake.yaml index 4135ea92..267d00d7 100644 --- a/cdp-sdk-go/resources/swagger/datalake.yaml +++ b/cdp-sdk-go/resources/swagger/datalake.yaml @@ -6,7 +6,7 @@ x-form-factors: public x-cdp-releases: PUBLIC x-audit: true info: - version: 0.9.91 (BETA) + version: 0.9.103 (BETA) title: Cloudera Datalake Service license: name: Apache 2.0 @@ -61,6 +61,27 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/datalake/createAWSGovCloudDatalake: + post: + summary: Creates a Data Lake on AWS GovCloud. + description: Creates a Data Lake on AWS GovCloud. + operationId: createAWSGovCloudDatalake + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/CreateAWSGovCloudDatalakeRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/CreateAWSGovCloudDatalakeResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/datalake/createAzureDatalake: post: summary: Creates an Azure datalake. @@ -169,7 +190,7 @@ paths: /api/v1/datalake/startDatalakeVerticalScaling: post: summary: Initiates the vertical scaling on Data Lake. - description: Initiates the vertical scaling on Data Lake. + description: Initiates the vertical scaling on Data Lake. You have the option to specify 'modifyDisks' or 'instanceTemplate' as parameter. operationId: startDatalakeVerticalScaling x-mutating: true parameters: @@ -737,6 +758,69 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/datalake/describeDatabaseServer: + post: + summary: Gets external database server details. + description: Gets external database server details for Data Lake by cluster CRN + operationId: describeDatabaseServer + x-mutating: false + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/DescribeDatabaseServerRequest' + responses: + 200: + description: Database server details for the requested resource. + schema: + $ref: '#/definitions/DescribeDatabaseServerResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/datalake/validateAwsCloudStorage: + post: + summary: Validates AWS cloud storage. + description: Validates AWS cloud storage for Data Lake. + operationId: validateAwsCloudStorage + x-mutating: false + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/ValidateAwsCloudStorageRequest' + responses: + 200: + description: AWS cloud storage validation result for Data Lake. + schema: + $ref: '#/definitions/ValidateAwsCloudStorageResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/datalake/validateAzureCloudStorage: + post: + summary: Validates Azure cloud storage. + description: Validates Azure cloud storage for Data Lake. + operationId: validateAzureCloudStorage + x-mutating: false + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/ValidateAzureCloudStorageRequest' + responses: + 200: + description: Azure cloud storage validation result for Data Lake. + schema: + $ref: '#/definitions/ValidateAzureCloudStorageResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/datalake/resizeDatalake: post: summary: Resizes the given datalake to the given target size. Currently, the only valid use of this is for resizing a light duty datalake to a medium duty datalake. @@ -758,6 +842,27 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/datalake/scaleHorizontally: + post: + summary: Horizontally scale the Data Lake nodes, to add additional compute nodes to the cluster. + description: Horizontally scale the target host group in the Data Lake cluster. The possible option for the instance group are raz_scale_out, hms_scale_out, kafka_scale_out, solr_scale_out, storage_scale_out + operationId: scaleHorizontally + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/ScaleHorizontallyRequest' + responses: + 200: + description: Successful response to a valid Data Lake horizontal scaling request. + schema: + $ref: '#/definitions/ScaleHorizontallyResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/datalake/recoverDatalake: post: summary: Recover data lake to the original version after a failed upgrade. @@ -953,7 +1058,6 @@ definitions: required: - datalake - group - - instanceTemplate properties: datalake: type: string @@ -964,6 +1068,9 @@ definitions: instanceTemplate: description: Instance template that specifies the core information for the vertical scale. $ref: '#/definitions/InstanceTemplate' + diskOptions: + description: Disk options for vertical scaling - modify disks. + $ref: '#/definitions/DiskOptions' StartDatalakeVerticalScalingResponse: type: object description: The response object for Data Lake vertical scaling. @@ -978,6 +1085,27 @@ definitions: instanceType: type: string description: The type of the instance. + DiskOptions: + type: object + description: Attached disk configuration(s). + properties: + modifyDisks: + description: Modifies all the disks attached to all instances in a group. + $ref: '#/definitions/ModifyDisks' + ModifyDisks: + type: object + description: Attached volume configuration. + required: + - volumeType + - size + properties: + volumeType: + type: string + description: Type of disks to modify to on all the instances in a group. + size: + type: integer + format: int32 + description: Size of disks to modify to on all the instances in a group in GB. DatalakeDetails: type: object description: Details about a datalake @@ -1399,6 +1527,69 @@ definitions: datalake: $ref: '#/definitions/Datalake' description: The datalake. + CreateAWSGovCloudDatalakeRequest: + type: object + description: Request object for createing AWS Data Lake request on GovCloud. + required: + - datalakeName + - environmentName + - cloudProviderConfiguration + properties: + datalakeName: + type: string + description: The Data Lake name. This name must be unique, must have between 5 and 100 characters, and must contain only lowercase letters, numbers and hyphens. Names are case-sensitive. + minLength: 5 + maxLength: 100 + environmentName: + type: string + description: The environment name or CRN. + cloudProviderConfiguration: + $ref: '#/definitions/AWSConfigurationRequest' + description: AWS configuration. + scale: + description: The scale of the datalake. Allowed values are "LIGHT_DUTY" or "MEDIUM_DUTY_HA". Defaults to "LIGHT_DUTY" if not set. + $ref: '#/definitions/DatalakeScaleType' + x-no-compatibility-guarantee: true + tags: + type: array + description: Tags to be added to Data Lake related resources. + items: + $ref: '#/definitions/DatalakeResourceTagRequest' + runtime: + type: string + description: Cloudera Runtime version. + image: + $ref: '#/definitions/ImageRequest' + description: The image to use for the datalake. This must not be set if the runtime parameter is provided. + enableRangerRaz: + type: boolean + description: Whether to enable Ranger RAZ for the datalake. Defaults to not being enabled. + multiAz: + type: boolean + description: Controls if the datalake is deployed in a multi-availability zone way. + recipes: + type: array + items: + $ref: '#/definitions/InstanceGroupRecipeRequest' + description: Additional recipes that will be attached on the datalake instances (by instance groups, most common ones are like 'master' or 'idbroker'). + customInstanceGroups: + type: array + items: + $ref: '#/definitions/SdxInstanceGroupRequest' + description: Configure custom properties on an instance group level. + javaVersion: + type: integer + format: int32 + description: Configure the major version of Java on the cluster. + CreateAWSGovCloudDatalakeResponse: + type: object + description: Response object for creating AWS Data Lake request on GovCloud. + required: + - datalake + properties: + datalake: + $ref: '#/definitions/Datalake' + description: The Data Lake. CreateAzureDatalakeRequest: type: object description: Request object for create Azure datalake request. @@ -1439,6 +1630,12 @@ definitions: enableRangerRaz: type: boolean description: Whether to enable Ranger RAZ for the datalake. Defaults to not being enabled. + databaseType: + type: string + description: The type of the azure database. FLEXIBLE_SERVER is the next generation managed PostgreSQL service in Azure that provides maximum flexibility over your database, built-in cost-optimizations. SINGLE_SERVER is a fully managed database service with minimal requirements for customizations of the database. + enum: + - FLEXIBLE_SERVER + - SINGLE_SERVER recipes: type: array items: @@ -1453,6 +1650,10 @@ definitions: type: integer format: int32 description: Configure the major version of Java on the cluster. + multiAz: + type: boolean + default: false + description: Creates CDP datalake distributed across multiple availability zones in an Azure region. CreateAzureDatalakeResponse: type: object description: Response object for create Azure datalake request. @@ -1528,6 +1729,7 @@ definitions: enum: - LIGHT_DUTY - MEDIUM_DUTY_HA + - ENTERPRISE DatalakeLoadBalancerSkuType: type: string description: Represents the Azure load balancer SKU type. The current default is BASIC. To disable the load balancer, use type NONE. @@ -2411,6 +2613,10 @@ definitions: description: The database engine major version to upgrade to. enum: - VERSION_11 + - VERSION_14 + force: + type: boolean + description: Start the database upgrade flow even if the source and target versions are the same. Can be used to reinitiate an upgrade after a failure. StartDatabaseUpgradeResponse: type: object description: Response object to Data Lake database upgrade. @@ -2418,8 +2624,6 @@ definitions: targetVersion: type: string description: The database engine major version to upgrade to. - enum: - - VERSION_11 DatalakeVmLogRequest: type: object description: Log descriptor, contains a path and label pair. Used for diagnostics collections. @@ -2716,19 +2920,220 @@ definitions: type: object description: Response object for renew certificate request, deprecated. x-deprecated: true + DescribeDatabaseServerRequest: + type: object + description: Request object for obtaining Database Server details. + properties: + clusterCrn: + description: Stack CRN of the Data Lake + type: string + DescribeDatabaseServerResponse: + type: object + description: Response object for obtaining Database Server details. + properties: + crn: + type: string + description: CRN of the database server + name: + type: string + description: Name of the database server + description: + type: string + description: Description of the database server + environmentCrn: + type: string + description: CRN of the environment of the database server + host: + type: string + description: Host of the database server + port: + type: integer + format: int32 + description: Port of the database server + databaseVendor: + type: string + description: Name of the database vendor (MYSQL, POSTGRES, ...) + databaseVendorDisplayName: + type: string + description: Display name of the database vendor (MySQL, PostgreSQL, ...) + creationDate: + type: string + format: date-time + description: Creation date of the database server + resourceStatus: + type: string + description: Ownership status of the database server + enum: + - UNKNOWN + - SERVICE_MANAGED + - USER_MANAGED + status: + type: string + description: Status of the database server stack + enum: + - REQUESTED + - CREATE_IN_PROGRESS + - AVAILABLE + - UPDATE_IN_PROGRESS + - UPDATE_REQUESTED + - UPDATE_FAILED + - CREATE_FAILED + - ENABLE_SECURITY_FAILED + - DELETE_REQUESTED + - PRE_DELETE_IN_PROGRESS + - DELETE_IN_PROGRESS + - DELETE_FAILED + - DELETE_COMPLETED + - STOPPED + - STOP_REQUESTED + - START_REQUESTED + - STOP_IN_PROGRESS + - START_IN_PROGRESS + - START_FAILED + - STOP_FAILED + - WAIT_FOR_SYNC + - MAINTENANCE_MODE_ENABLED + - UNKNOWN + statusReason: + type: string + description: Additional status information about the database server stack + clusterCrn: + type: string + description: CRN of the cluster of the database server + sslConfig: + description: SSL configuration of the database server + $ref: '#/definitions/DatabaseServerSslConfig' + DatabaseServerSslConfig: + description: SSL configuration for the database server + type: object + properties: + sslCertificates: + type: array + description: Set of SSL certificates for the actual database server + uniqueItems: true + items: + type: string + sslCertificateType: + type: string + description: SSL certificate type + enum: + - CLOUD_PROVIDER_OWNED + - BRING_YOUR_OWN + - NONE + sslMode: + type: string + description: SSL enforcement mode for the actual database server + enum: + - ENABLED + - DISABLED ImageRequest: - description: The image request for the datalake. This must not be set if the runtime parameter is provided. The image ID parameter is required if this is present, but the image catalog name is optional, defaulting to 'cdp-default' if not present. + description: The image request for the datalake. When the 'runtime' parameter is set, only the 'os' parameter can be provided. Otherwise, you can use 'catalog name' and/or 'id' for selecting an image. type: object - required: - - id properties: id: type: string description: The image ID from the catalog. The corresponding image will be used for the created cluster machines. catalogName: type: string - description: The name of the custom image catalog to use. + description: The name of the custom image catalog to use, defaulting to 'cdp-default' if not present. default: cdp-default + os: + type: string + description: The OS of the image used for cluster instances. + ValidateAwsCloudStorageRequest: + type: object + description: Request object for AWS cloud storage validation. + required: + - clusterName + - dataAccessRole + - rangerAuditRole + - credentialCrn + - blueprintName + - storageLocation + - instanceProfile + properties: + clusterName: + description: Datalake cluster name. + type: string + dataAccessRole: + description: Data access role. + type: string + rangerAuditRole: + description: Ranger audit role. + type: string + credentialCrn: + description: Credential CRN. + type: string + blueprintName: + description: Name of the blueprint. + type: string + storageLocation: + description: AWS S3 storage bucket base location. + type: string + instanceProfile: + description: AWS instance profile. + type: string + ValidateAwsCloudStorageResponse: + type: object + description: AWS cloud storage validation response. + properties: + status: + description: Validation result. Allowed values are "OK", "ACCESS_DENIED", "ERROR", "RESOURCE_NOT_FOUND". + type: string + error: + description: Error message if validation failed. + type: string + ValidateAzureCloudStorageRequest: + type: object + description: Request object for Azure cloud storage validation. + required: + - clusterName + - dataAccessRole + - rangerAuditRole + - credentialCrn + - blueprintName + - storageLocation + properties: + clusterName: + description: Datalake cluster name. + type: string + dataAccessRole: + description: Data access role. + type: string + rangerAuditRole: + description: Ranger audit role. + type: string + credentialCrn: + description: Credential CRN. + type: string + blueprintName: + description: Name of the blueprint. + type: string + storageLocation: + description: Azure storage base location. + type: string + managedIdentity: + description: Azure managed identity. + type: string + accountKey: + description: Azure account key. + type: string + accountName: + description: Azure account name. + type: string + secure: + description: Azure secure flag. + type: boolean + ValidateAzureCloudStorageResponse: + type: object + description: Azure cloud storage validation response. + properties: + status: + description: Validation result. Allowed values are "OK", "ACCESS_DENIED", "ERROR", "RESOURCE_NOT_FOUND". + type: string + error: + description: Error message if validation failed. + type: string ResizeDatalakeRequest: type: object description: Datalake resize request. @@ -2744,6 +3149,11 @@ definitions: description: The target size for the datalake. enum: - MEDIUM_DUTY_HA + - ENTERPRISE + multiAz: + type: boolean + default: false + description: Whether to deploy a new datalake in a multi-availability zone way. ResizeDatalakeResponse: type: object description: Datalake resize response. @@ -2769,6 +3179,39 @@ definitions: cloudbreakVersion: type: string description: The Cloudbreak version used to create the data lake. + ScaleHorizontallyRequest: + type: object + description: Data lake horizontal scaling request. + required: + - datalakeName + - instanceGroupName + - instanceGroupDesiredCount + properties: + datalakeName: + type: string + description: the name of the Data Lake + instanceGroupName: + type: string + description: The target host group name to be scaled. + enum: + - solr_scale_out + - hms_scale_out + - raz_scale_out + - kafka_scale_out + - storage_scale_out + instanceGroupDesiredCount: + type: integer + format: int32 + minimum: 0 + maximum: 40 + description: The target number of the scaling operation. If the desired count is less than the actual node count the scaling action will be a downscale operation. + ScaleHorizontallyResponse: + type: object + description: Data Lake horizontal scaling response + properties: + datalakeName: + type: string + description: The name of the datalake. ReplaceRecipesRequest: type: object description: The request for replacing recipes. diff --git a/cdp-sdk-go/resources/swagger/dw.yaml b/cdp-sdk-go/resources/swagger/dw.yaml index 97bc27b6..f43a196e 100644 --- a/cdp-sdk-go/resources/swagger/dw.yaml +++ b/cdp-sdk-go/resources/swagger/dw.yaml @@ -4,7 +4,7 @@ x-products: CDP x-form-factors: public,private x-cdp-releases: PUBLIC info: - version: 0.9.91 (BETA) + version: 0.9.103 (BETA) title: Cloudera Data Warehouse [EXPERIMENTAL] license: name: Apache 2.0 @@ -238,6 +238,28 @@ paths: schema: $ref: '#/definitions/Error' x-mutating: true + /api/v1/dw/listEvents: + post: + x-form-factors: public,private + x-mutating: false + summary: Get the list of events. + description: 'Get the list of events for the given Operation or a specific Service (Cluster, Database Catalog, Virtual Warehouse, or Data Visualization App). Events can belong to a particular Operation which might span across multiple Services. This happens if the given operation affects one or more Services e.g.: restore-cluster. It is also possible to return the events only for a given Service, in this case it is enough to pass the Id of a Service (e.g.: env-sq7hfv, warehouse-1696571829-pps2, compute-1696571962-8dd8, impala-1696572085-cn44).' + operationId: listEvents + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/ListEventsRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/ListEventsResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/dw/updateSshKey: post: x-form-factors: public @@ -307,6 +329,119 @@ paths: schema: $ref: '#/definitions/Error' x-mutating: true + /api/v1/dw/suspendCluster: + post: + x-no-compatibility-guarantee: true + x-mutating: true + x-form-factors: public + summary: Suspend Cloudera Data Warehouse cluster. + description: Suspend Cloudera Data Warehouse cluster. Supported only on Azure. Suspend cluster requires a "Running" Azure CDW, trying to suspend a cluster already in "Stopped" or "Error" state is not supported. Every Virtual Warehouse and Database Catalog which belongs to that CDW must be stopped first. This operation will stop the AKS cluster for this CDW instance, however leaves other cloud resources in "Running" state, including the Postgres database. + operationId: suspendCluster + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/SuspendClusterRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/SuspendClusterResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/dw/resumeCluster: + post: + x-no-compatibility-guarantee: true + x-mutating: true + x-form-factors: public + summary: Resume Cloudera Data Warehouse cluster. + description: Resume Cloudera Data Warehouse cluster. Supported only on Azure. Resume cluster will start a stopped CDW cluster. Resuming a cluster in "Running" or "Error" state is not supported. Resume will start the AKS instance which belongs to this CDW. + operationId: resumeCluster + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/ResumeClusterRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/ResumeClusterResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/dw/createAwsCluster: + post: + x-no-compatibility-guarantee: true + x-mutating: true + summary: Create an AWS cluster in the Cloudera Data Warehouse. + description: Create an AWS cluster in the Cloudera Data Warehouse environment with the provided settings. + operationId: createAwsCluster + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/CreateAwsClusterRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/CreateAwsClusterResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/dw/createAzureCluster: + post: + x-no-compatibility-guarantee: true + x-mutating: true + summary: Create an Azure cluster in the Cloudera Data Warehouse. + description: Create an Azure cluster in the Cloudera Data Warehouse environment with the provided settings. + operationId: createAzureCluster + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/CreateAzureClusterRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/CreateAzureClusterResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/dw/createPrivateCluster: + post: + x-form-factors: private + x-no-compatibility-guarantee: true + x-mutating: true + summary: Create a a Private Cloud cluster in the Cloudera Data Warehouse. + description: Create a Private Cloud cluster in the Cloudera Data Warehouse environment with the provided settings. + operationId: createPrivateCluster + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/CreatePrivateClusterRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/CreatePrivateClusterResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/dw/deleteCluster: post: x-no-compatibility-guarantee: true @@ -350,6 +485,70 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/dw/updateAwsCluster: + post: + x-mutating: true + summary: Updates an AWS cluster in the Cloudera Data Warehouse. + description: Update an AWS cluster in the Cloudera Data Warehouse with the provided settings. + operationId: updateAwsCluster + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/UpdateAwsClusterRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/UpdateAwsClusterResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/dw/updateAzureCluster: + post: + x-mutating: true + summary: Updates an Azure cluster in the Cloudera Data Warehouse. + description: Update an Azure cluster in the Cloudera Data Warehouse with the provided settings. + operationId: updateAzureCluster + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/UpdateAzureClusterRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/UpdateAzureClusterResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/dw/updatePrivateCluster: + post: + x-form-factors: private + x-mutating: true + summary: Updates a Private Cloud (PvC) cluster in the Cloudera Data Warehouse. + description: Update a Private Cloud cluster (PvC) in the Cloudera Data Warehouse with the provided settings. + operationId: updatePrivateCluster + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/UpdatePrivateClusterRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/UpdatePrivateClusterResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/dw/upgradeCluster: post: x-mutating: true @@ -565,8 +764,9 @@ paths: /api/v1/dw/createDbc: post: x-no-compatibility-guarantee: true + x-deprecated: true summary: Create a Database Catalog. - description: Create a Database Catalog. + description: 'DEPRECATED: Create a Database Catalog. The Database Catalog creation is deprecated and will be removed in subsequent releases. The Default Database Catalog is getting created during the cluster activation (create-cluster).' operationId: createDbc parameters: - name: input @@ -1748,6 +1948,42 @@ definitions: cluster: description: The cluster. $ref: '#/definitions/ClusterSummaryResponse' + SuspendClusterRequest: + x-no-compatibility-guarantee: true + type: object + description: Request object for suspend cluster method. + required: + - clusterId + properties: + clusterId: + type: string + description: The ID of the cluster to suspend. + ResumeClusterRequest: + x-no-compatibility-guarantee: true + type: object + description: Request object for resume cluster method. + required: + - clusterId + properties: + clusterId: + type: string + description: The ID of the cluster to resume. + SuspendClusterResponse: + x-no-compatibility-guarantee: true + type: object + description: The response object for the suspendCluster method. + properties: + clusterId: + type: string + description: The ID of the cluster to describe. + ResumeClusterResponse: + x-no-compatibility-guarantee: true + type: object + description: The response object for the resumeCluster method. + properties: + clusterId: + type: string + description: The ID of the cluster to describe. DescribeKubeconfigRequest: type: object description: Request object for the describeKubeconfig method. @@ -1783,12 +2019,12 @@ definitions: properties: default: type: array - description: Default value for the compute instance type usage. + description: Default value for the compute instance type usage. This setting is Cluster-wide. items: type: string allowed: type: array - description: Allowed values for the instance type. + description: Allowed values for the instance type. This setting is Cluster-wide. items: type: string DescribeServerSettingRequest: @@ -1865,6 +2101,56 @@ definitions: enabled: type: boolean description: The state of the setting. + ListEventsRequest: + x-form-factors: public,private + type: object + description: Request object for the listEvents method. + properties: + operationId: + type: string + description: Filter events based on the operation ID. Either operation ID or service ID is required. + serviceId: + type: string + description: Filter events based on the service ID. It can be Cluster ID, Database Catalog ID, Virtual Warehouse ID or Data Visualization App ID. + limit: + type: integer + format: int32 + description: Limit the number of returned rows. If not specified then the recent 20 events will be returned. The maximum is 100. + ascending: + type: boolean + default: false + description: Provide the result in ascending order, default is descending. + ListEventsResponse: + x-form-factors: public,private + type: object + description: Response object for the listEvents method. + properties: + events: + type: array + description: List of the events. + items: + $ref: '#/definitions/Event' + Event: + x-form-factors: public,private + type: object + description: Represents a Event. + properties: + operationId: + type: string + description: The ID of the operation to which the event belongs. + serviceId: + type: string + description: The ID of the service to which the event belongs. + event: + type: string + description: The name of the event. + message: + type: string + description: Detailed message. + timestamp: + type: string + format: date-time + description: The timestamp of the event. UpdateSshKeyRequest: type: object description: Request object for the updateSshKey method. @@ -1939,6 +2225,16 @@ definitions: default: false x-form-factors: public x-entitlement: CDW_STORAGE_ROLES + reservedComputeNodes: + x-entitlement: CDW_CLUSTER_OVERPROVISIONER + type: integer + format: int32 + description: Set additional number of nodes to reserve for executors and coordinators to use during autoscaling. Adding more reserved nodes increases your cloud costs. + reservedSharedServicesNodes: + x-entitlement: CDW_CLUSTER_OVERPROVISIONER + type: integer + format: int32 + description: Set additional number of nodes to reserve for other services in the cluster. Adding more reserved nodes increases your cloud costs. customRegistryOptions: description: Options for custom ACR/ECR/Docker registries. $ref: '#/definitions/CustomRegistryOptions' @@ -1957,6 +2253,231 @@ definitions: customSubdomain: type: string description: Custom environment subdomain. Overrides the environment subdomain using a customized domain either in the old subdomain format like ENV_ID.dw or the new format like dw-ENV_NAME. + resourcePool: + type: string + description: The Resource Pool of the cluster. + x-form-factors: private + CreateAwsClusterRequest: + type: object + description: Request object for the createAwsCluster method. + required: + - environmentCrn + properties: + environmentCrn: + type: string + description: The CRN of the environment for the cluster to create. + useOverlayNetwork: + type: boolean + description: Using an overlay network will save IP addresses in the VPC by using a private IP address range for Pods in the cluster. + databaseBackupRetentionPeriod: + type: integer + format: int32 + default: 30 + description: PostgreSQL server backup retention days. + whitelistK8sClusterAccessIpCIDRs: + type: array + items: + type: string + description: List of IP address CIDRs to whitelist for kubernetes cluster access. + whitelistWorkloadAccessIpCIDRs: + type: array + items: + type: string + description: List of IP address CIDRs to whitelist for workload access. + usePrivateLoadBalancer: + type: boolean + description: Set up load balancer with private IP address. In AWS it is created in private subnets. In Azure an internal load balancer gets created. Make sure there is connectivity between your client network and the network (VPC/VNet) where CDW environment is deployed. + usePublicWorkerNode: + type: boolean + description: Set up worker node with public IP address. In AWS it is created in public subnets. + enablePrivateEKS: + type: boolean + description: Use this option to set up AWS EKS cluster in private only mode with restricted access only from internal/peered networks. Ensure you have ccmv2 setup functional to achieve this integration. + default: false + enableStorageRoles: + type: boolean + description: Enable Storage Roles + default: false + x-form-factors: public + x-entitlement: CDW_STORAGE_ROLES + reservedComputeNodes: + x-entitlement: CDW_CLUSTER_OVERPROVISIONER + type: integer + format: int32 + description: Set additional number of nodes to reserve for executors and coordinators to use during autoscaling. Adding more reserved nodes increases your cloud costs. + reservedSharedServicesNodes: + x-entitlement: CDW_CLUSTER_OVERPROVISIONER + type: integer + format: int32 + description: Set additional number of nodes to reserve for other services in the cluster. Adding more reserved nodes increases your cloud costs. + customRegistryOptions: + description: Options for custom ACR/ECR/Docker registries. + $ref: '#/definitions/CustomRegistryOptions' + customSubdomain: + type: string + description: Custom environment subdomain. Overrides the environment subdomain using a customized domain either in the old subdomain format like ENV_ID.dw or the new format like dw-ENV_NAME. + workerSubnetIds: + type: array + description: IDs of AWS subnets where the cluster worker nodes should be deployed. + items: + type: string + lbSubnetIds: + type: array + description: IDs of AWS subnets where the cluster load balancer should be deployed. + items: + type: string + customAmiId: + type: string + description: Custom AMI ID. + nodeRoleCDWManagedPolicyArn: + type: string + description: Managed Policy Arn to be attached to the Node Instance Role. + enableSpotInstances: + type: boolean + description: Whether to enable Spot instances for Virtual warehouses. It cannot be updated later. Defaults to false. + default: false + reducedPermissionMode: + type: boolean + description: Use this option to activate the environment with fewer than half of the standard required IAM permissions on your AWS cross-account IAM role. + computeInstanceTypes: + type: array + items: + type: string + description: AWS compute instance types that the environment is restricted to use. This affects the creation of virtual warehouses where this restriction will apply. Select an instance type that meets your computing, memory, networking, or storage needs. As of now, only a single instance type can be listed. Use describe-allowed-instance-types to see currently possible values. + additionalInstanceTypes: + type: array + items: + type: string + description: Additional (fallback) instance types listed in their priority order. They will be used instead of the primary compute instance type in case it is unavailable. You cannot include any instance type that was already indicated in computeInstanceTypes. Use describe-allowed-instance-types to see currently supported values and also the default value when nothing is provided for the computeInstanceTypes. + CreateAzureClusterRequest: + type: object + description: Request object for the createAzureCluster method. + required: + - environmentCrn + - userAssignedManagedIdentity + properties: + environmentCrn: + type: string + description: The CRN of the environment for the cluster to create. + userAssignedManagedIdentity: + type: string + description: Resource ID of the managed identity used by AKS. It is a mandatory parameter for Azure cluster creation. + subnetId: + type: string + description: ID of Azure subnet where the cluster should be deployed. It is a mandatory parameter for Azure cluster creation. + kubenet: + type: boolean + description: With kubenet, nodes get an IP address from the Azure virtual network subnet. Pods receive an IP address from a logically different address space to the Azure virtual network subnet of the nodes. + databaseBackupRetentionPeriod: + type: integer + format: int32 + default: 30 + description: PostgreSQL server backup retention days. + whitelistK8sClusterAccessIpCIDRs: + type: array + items: + type: string + description: List of IP address CIDRs to whitelist for kubernetes cluster access. + whitelistWorkloadAccessIpCIDRs: + type: array + items: + type: string + description: List of IP address CIDRs to whitelist for workload access. + usePrivateLoadBalancer: + type: boolean + description: Set up load balancer with private IP address. An internal load balancer gets created. Make sure there is connectivity between your client network and the network VNet where CDW environment is deployed. + enableStorageRoles: + type: boolean + description: Enable Storage Roles + default: false + x-form-factors: public + x-entitlement: CDW_STORAGE_ROLES + reservedComputeNodes: + x-entitlement: CDW_CLUSTER_OVERPROVISIONER + type: integer + format: int32 + description: Set additional number of nodes to reserve for executors and coordinators to use during autoscaling. Adding more reserved nodes increases your cloud costs. + reservedSharedServicesNodes: + x-entitlement: CDW_CLUSTER_OVERPROVISIONER + type: integer + format: int32 + description: Set additional number of nodes to reserve for other services in the cluster. Adding more reserved nodes increases your cloud costs. + customRegistryOptions: + description: Options for custom ACR/ECR/Docker registries. + $ref: '#/definitions/CustomRegistryOptions' + customSubdomain: + type: string + description: Custom environment subdomain. Overrides the environment subdomain using a customized domain either in the old subdomain format like ENV_ID.dw or the new format like dw-ENV_NAME. + enableAZ: + type: boolean + description: Enables Azure Availability Zones for the cluster deployment. + enableSpotInstances: + type: boolean + description: Whether to enable spot instances for Virtual warehouses. It cannot be updated later. Defaults to false. + default: false + computeInstanceTypes: + type: array + items: + type: string + description: Azure compute instance types that the environment is restricted to use. This affects the creation of virtual warehouses where this restriction will apply. Select an instance type that meets your computing, memory, networking, or storage needs. As of now, only a single instance type can be listed. Use describe-allowed-instance-types to see currently possible values and the default value used for the case it is not provided. + logAnalyticsWorkspaceId: + type: string + description: Enable monitoring of Azure Kubernetes Service (AKS) cluster. Workspace ID for Azure log analytics. + outboundType: + type: string + description: Network outbound type. This setting controls the egress traffic for cluster nodes in Azure Kubernetes Service. Please refer to the following AKS documentation on the Azure portal. https://learn.microsoft.com/en-us/azure/aks/egress-outboundtype, https://learn.microsoft.com/en-us/azure/aks/nat-gateway + enum: + - LoadBalancer + - UserAssignedNATGateway + - UserDefinedRouting + enablePrivateSQL: + type: boolean + description: Enables private SQL for the cluster deployment. + default: false + privateDNSZoneAKS: + type: string + description: Private DNS zone AKS resource ID. + enablePrivateAks: + type: boolean + description: Enable Azure Private AKS mode. Note that this feature is currently unstable due to critical networking issues within the Azure Software Definition Layer (SDN). This problem prevents the deployment of necessary components and results in unpredictable behavior and instability, impacting operations such as environment activation, VW creation, modification, and start/stop operations. While we work towards a resolution with Microsoft, estimated within the next 6-9 months, we recommend utilizing alternative methods like enabling public endpoints or virtual network peering for accessing your Azure Cluster. + default: false + aksVNetIntegrationSubnetName: + type: string + description: Enable AKS VNet Azure Virtual Network (VNet) integration by specifying the delegated subnet name. An Azure Kubernetes Service (AKS) cluster configured with API Server VNet Integration projects the API server endpoint directly into a delegated subnet in the VNet where AKS is deployed. API Server VNet Integration enables network communication between the API server and the cluster nodes without requiring a private link or tunnel. + CreatePrivateClusterRequest: + x-form-factors: private + type: object + description: Request object for the createPrivateCluster method. + required: + - environmentCrn + - delegationUsername + - delegationPassword + properties: + environmentCrn: + type: string + description: The CRN of the environment for the cluster to create. + delegationUsername: + type: string + description: Name of delegation user. This user is used between Hue - Impala to create a session, as Hue should not pass the user credentials, instead Hue authenticates with the delegation user, then this user will impersonate the logged in user. This means that the Delegation User and Password should be able to authenticate through LDAP. + delegationPassword: + type: string + description: Password of delegation user. + securityContextConstraintName: + type: string + description: The name of the Hive Security Context Constraint. + storageClass: + type: string + description: The storage class for the Local Storage Operator. + dbHue: + type: string + description: The name of the HUE database. Not required for embedded databases. + resourcePool: + type: string + description: The Resource Pool of the cluster. + dedicatedExecutorNodes: + type: boolean + description: Enable to use dedicated nodes exclusively for executors and coordinators, and improve performance. You can enable this only if you reserved nodes while adding a CDP Private Cloud containerized ECS cluster. When disabled, non-compute pods such as MetaStore and Data Visualization can also use the reserved nodes. + default: false BackupClusterRequest: type: object description: Request object for the backupCluster method. @@ -1973,6 +2494,9 @@ definitions: clusterId: type: string description: The ID of the cluster. + operationId: + type: string + description: The ID of the backup operation. timestamp: type: string format: date-time @@ -2004,15 +2528,26 @@ definitions: properties: clusterId: type: string - description: The the ID of the cluster. + description: The ID of the cluster. operationId: type: string - description: The the ID of the restore operation. + description: The ID of the restore operation. + action: + type: string + description: 'The cluster action. Possible actions: Create, Skip' + message: + type: string + description: The description of the cluster action. dbcRestorePlans: type: array description: Information about the restore-plan of the DbCatalogs. items: $ref: '#/definitions/RestoreClusterEntityPlan' + hueRestorePlans: + type: array + description: Information about the restore-plan of Hue. + items: + $ref: '#/definitions/RestoreClusterEntityPlan' hiveRestorePlans: type: array description: Information about the restore-plan of the Hive Virtual Warehouses. @@ -2067,21 +2602,15 @@ definitions: description: Password for custom registry access (required only for Docker type). disableImageVerification: type: boolean - description: Disable image verification. - AwsActivationOptions: - type: object - description: Options for activating an AWS environment. - properties: - privateSubnetIds: - type: array - description: IDs of private AWS subnets where the cluster should be deployed. - items: - type: string - publicSubnetIds: - type: array - description: IDs of public AWS subnets where the cluster should be deployed. - items: - type: string + description: Disable image verification. + AwsActivationOptions: + type: object + description: Options for activating an AWS environment. + properties: + enablePrivateEKS: + type: boolean + description: Use this option to set up AWS EKS cluster in private only mode with restricted access only from internal/peered networks. Ensure you have ccmv2 setup functional to achieve this integration. + default: false workerSubnetIds: type: array description: IDs of AWS subnets where the cluster worker nodes should be deployed. @@ -2124,7 +2653,7 @@ definitions: description: Resource ID of the managed identity used by AKS. It is a mandatory parameter for Azure cluster creation. subnetId: type: string - description: ID of Azure subnet where the cluster should be deployed. + description: ID of Azure subnet where the cluster should be deployed. It is a mandatory parameter for Azure cluster creation. enableAZ: type: boolean description: Enables Azure Availability Zones for the cluster deployment. @@ -2156,11 +2685,15 @@ definitions: description: Private DNS zone AKS resource ID. enablePrivateAks: type: boolean - description: Enable Azure Private AKS mode. + description: Enable Azure Private AKS mode. Note that this feature is currently unstable due to critical networking issues within the Azure Software Definition Layer (SDN). This problem prevents the deployment of necessary components and results in unpredictable behavior and instability, impacting operations such as environment activation, VW creation, modification, and start/stop operations. While we work towards a resolution with Microsoft, estimated within the next 6-9 months, we recommend utilizing alternative methods like enabling public endpoints or virtual network peering for accessing your Azure Cluster. default: false + aksVNetIntegrationSubnetName: + type: string + description: Enable AKS VNet Azure Virtual Network (VNet) integration by specifying the delegated subnet name. An Azure Kubernetes Service (AKS) cluster configured with API Server VNet Integration projects the API server endpoint directly into a delegated subnet in the VNet where AKS is deployed. API Server VNet Integration enables network communication between the API server and the cluster nodes without requiring a private link or tunnel. PrivateCloudActivationOptions: type: object description: Options for activating a Private Cloud environment. + x-form-factors: private required: - delegationUsername - delegationPassword @@ -2183,6 +2716,10 @@ definitions: dbHue: type: string description: The name of the HUE database. Not required for embedded databases. + dedicatedExecutorNodes: + type: boolean + description: Enable to use dedicated nodes exclusively for executors and coordinators, and improve performance. You can enable this only if you reserved nodes while adding a CDP Private Cloud containerized ECS cluster. When disabled, non-compute pods such as MetaStore and Data Visualization can also use the reserved nodes. + default: false CreateClusterResponse: type: object description: Response object for the createCluster method. @@ -2190,6 +2727,28 @@ definitions: clusterId: type: string description: ID of new cluster. + CreateAwsClusterResponse: + type: object + description: Response object for the createAwsCluster method. + properties: + clusterId: + type: string + description: ID of new AWS cluster. + CreateAzureClusterResponse: + type: object + description: Response object for the createCluster method. + properties: + clusterId: + type: string + description: ID of new Azure cluster. + CreatePrivateClusterResponse: + x-form-factors: private + type: object + description: Response object for the createPrivateCluster method. + properties: + clusterId: + type: string + description: ID of new Private Cloud cluster. DeleteClusterRequest: type: object description: Request object for the deleteCluster method. @@ -2267,8 +2826,8 @@ definitions: type: object description: External bucket definition. additionalProperties: - description: External bucket access info. - $ref: '#/definitions/ExternalBucketAccessInfo' + description: External bucket access information. + $ref: '#/definitions/UpdateClusterExternalBucketAccessInfo' azureUpdate: type: object description: Additional properties for Azure clusters. @@ -2278,15 +2837,90 @@ definitions: default: false description: Renew Azure cluster certificate. observabilityConfig: + description: Cluster observability configurations to update. You can forward logs from environments activated in Cloudera Data Warehouse (CDW) to observability and monitoring systems such as Datadog, New Relic, or Splunk. Please refer to the following Cloudera documentation for more info. https://docs.cloudera.com/data-warehouse/cloud/monitoring/topics/dw-observability-log-forwarding.html + $ref: '#/definitions/UpdateClusterObservabilityConfig' + UpdateAwsClusterRequest: + type: object + description: Request object for the updateAwsCluster method. + required: + - clusterId + properties: + clusterId: + type: string + description: The ID of the AWS cluster to update. + description: + type: string + description: Cluster description. + whitelistK8sClusterAccessIpCIDRs: + type: array + items: + type: string + description: List of IP address CIDRs to whitelist for kubernetes cluster access. + whitelistWorkloadAccessIpCIDRs: + type: array + items: + type: string + description: List of IP address CIDRs to whitelist for workload access. + observabilityConfig: + description: Cluster observability configurations to update. You can forward logs from environments activated in Cloudera Data Warehouse (CDW) to observability and monitoring systems such as Datadog, New Relic, or Splunk. Please refer to the following Cloudera documentation for more info. https://docs.cloudera.com/data-warehouse/cloud/monitoring/topics/dw-observability-log-forwarding.html + $ref: '#/definitions/UpdateClusterObservabilityConfig' + externalBuckets: type: object - description: Update the cluster observability configurations. You can forward logs from environments activated in Cloudera Data Warehouse (CDW) to observability and monitoring systems such as Datadog, New Relic, or Splun. Please refer to the following Cloudera documentation for more info. https://docs.cloudera.com/data-warehouse/cloud/monitoring/topics/dw-observability-log-forwarding.html - properties: - logsForwardingConfig: - type: string - description: Create the log forwarding configuration in a valid fluentd format. Then that configuration is later inserted into a larger fluentd configuration. - proxyCABundle: - type: string - description: Set the proxy CA certificates (PEM Bundle). If you use a TLS-terminating proxy server to inspect outbound internet traffic, you need to provide the proxy server's CA certificates bundle in PEM bundle format when you configure log forwarding. + description: Cluster external bucket definition to update. + additionalProperties: + description: External bucket access information. + $ref: '#/definitions/UpdateClusterExternalBucketAccessInfo' + UpdateAzureClusterRequest: + type: object + description: Request object for the updateAzureCluster method. + required: + - clusterId + properties: + clusterId: + type: string + description: The ID of the Azure cluster to update. + description: + type: string + description: Cluster description. + whitelistK8sClusterAccessIpCIDRs: + type: array + items: + type: string + description: List of IP address CIDRs to whitelist for kubernetes cluster access. + whitelistWorkloadAccessIpCIDRs: + type: array + items: + type: string + description: List of IP address CIDRs to whitelist for workload access. + observabilityConfig: + description: Cluster observability configurations to update. You can forward logs from environments activated in Cloudera Data Warehouse (CDW) to observability and monitoring systems such as Datadog, New Relic, or Splunk. Please refer to the following Cloudera documentation for more info. https://docs.cloudera.com/data-warehouse/cloud/monitoring/topics/dw-observability-log-forwarding.html + $ref: '#/definitions/UpdateClusterObservabilityConfig' + renewCertificate: + type: boolean + default: false + description: Renew Azure cluster certificate. + UpdatePrivateClusterRequest: + x-form-factors: private + type: object + description: Request object for the updatePrivateCluster method. + required: + - clusterId + properties: + clusterId: + type: string + description: The ID of the Private Cloud cluster to update. + description: + type: string + description: Cluster description. + delegationUsername: + type: string + description: The user name to update for delegation user. Setting it to the same value as the existing delegation user name will be a no-op. + delegationPassword: + type: string + description: The password to update for delegation user. Setting it to the same value as the existing password will be a no-op. + dedicatedExecutorNodes: + type: boolean + description: Set it true to enable dedicated nodes exclusively for executors and coordinators, and improve performance. You can enable this only if you reserve nodes while adding a CDP Private Cloud containerized ECS cluster. When disabled, non-compute pods such as MetaStore and Data Visualization can also use the reserved nodes. ExternalBucketAccessInfo: type: object description: External bucket definition. @@ -2300,9 +2934,42 @@ definitions: kmsCmkArn: type: string description: Enable server side encryption with the specified KMS CMK ARN. If the value is empty or unspecified, default server side encryption will be used when the access mode is read-write. Otherwise this value is ignored. + UpdateClusterExternalBucketAccessInfo: + type: object + description: Cluster external bucket definition to update. + properties: + accessMode: + type: string + description: Specifies whether the external bucket will be added in read-only or read-write mode. + enum: + - READ + - READWRITE + kmsCmkArn: + type: string + description: Enable server side encryption with the specified KMS CMK ARN. If the value is empty or unspecified, default server side encryption will be used when the access mode is read-write. Otherwise this value is ignored. + UpdateClusterObservabilityConfig: + type: object + description: Cluster observability settings to update. + properties: + logsForwardingConfig: + type: string + description: Create the log forwarding configuration in a valid fluentd format. Then that configuration is later inserted into a larger fluentd configuration. + proxyCABundle: + type: string + description: Set the proxy CA certificates (PEM Bundle). If you use a TLS-terminating proxy server to inspect outbound internet traffic, you need to provide the proxy server's CA certificates bundle in PEM bundle format when you configure log forwarding. UpdateClusterResponse: type: object description: Response object for the updateCluster method. + UpdateAwsClusterResponse: + type: object + description: Response object for the updateAwsCluster method. + UpdateAzureClusterResponse: + type: object + description: Response object for the updateAzureCluster method. + UpdatePrivateClusterResponse: + x-form-factors: private + type: object + description: Response object for the updatePrivateCluster method. ListClustersRequest: type: object description: Request object for the listClusters method. @@ -2487,7 +3154,8 @@ definitions: x-form-factors: public isDefault: type: boolean - description: Is this a Default Database Catalog? + x-deprecated: true + description: 'NOTE: creating Default Database Catalogs is deprecated and explicitly disabled. Denotes if Default Database Catalog creation needed.' default: false tenantStorageRole: type: string @@ -3148,6 +3816,9 @@ definitions: podConfigName: type: string description: Name of the pod configuration. + impalaExecutorGroupSets: + $ref: '#/definitions/ImpalaExecutorGroupSetsCreateRequest' + description: Configures executor group sets for workload aware autoscaling. ImpalaOptionsCreateRequest: type: object description: Impala specific options. It cannot be provided for Virtual Warehouse types other than Impala. @@ -3240,6 +3911,9 @@ definitions: type: integer format: int32 description: DEPRECATED in favor of the top level impalaHASettings object. Number of the active coordinators. + impalaExecutorGroupSets: + $ref: '#/definitions/ImpalaExecutorGroupSetsUpdateRequest' + description: Re-configures executor group sets for workload aware autoscaling. ImpalaHASettingsUpdateRequest: type: object description: High Availability settings update options for the Impala Virtual Warehouse. @@ -3320,6 +3994,9 @@ definitions: podConfigName: type: string description: Name of the pod configuration. + impalaExecutorGroupSets: + $ref: '#/definitions/ImpalaExecutorGroupSetsResponse' + description: Configurations of executor groups sets for workload aware autoscaling. ImpalaHASettingsOptionsResponse: type: object description: Impala High Availability settings for a Virtual Warehouse. @@ -3394,6 +4071,11 @@ definitions: format: int32 description: Total number of coordinator replicas scheduled for the virtual warehouse. This number contains the number of coordinator replicas in pending state, as well as the replicas that are already running. If this number is zero, then the coordinator functionality is stopped. x-omitempty: false + readyCoordinatorReplicas: + type: integer + format: int32 + description: Total number of ready coordinator replicas in the virtual warehouse. This number only contains the healthy executor replicas that have already started up and are ready to accept requests. If this number is less than the totalCoordinatorReplicas, then the virtual warehouse might still be starting up or there might be a problem scheduling these replicas. + x-omitempty: false CreateVwRequest: type: object description: Request object for the createVw method. @@ -3432,7 +4114,7 @@ definitions: type: integer format: int32 default: 0 - description: Node Count per compute cluster. Implies 'custom' template, even if you pass template explicitly. + description: Nodes per compute cluster. If specified, forces 'template' to be 'custom' availabilityZone: type: string description: This feature works only for AWS cluster type. An availability zone to host compute instances. If not specified, defaults to a randomly selected availability zone inferred from available subnets. In order to query possible options, see "availabilityZones" field of describe-cluster or list-clusters command response. @@ -3459,6 +4141,16 @@ definitions: description: Tags associated with the resources. items: $ref: '#/definitions/TagRequest' + resourcePool: + type: string + description: The Resource Pool of the Virtual Warehouse. + x-form-factors: private + hiveAuthenticationMode: + type: string + x-nullable: true + x-deprecated: true + x-form-factors: private + description: 'DEPRECATED - Sets the authentication mode to use by Hive Server: * `LDAP` * `KERBEROS` Default: `LDAP` if not specified' platformJwtAuth: type: boolean default: false @@ -3679,6 +4371,10 @@ definitions: logAnalyticsWorkspaceId: type: string description: Workspace ID for Azure log analytics. + aksVNetIntegrationSubnetName: + x-omitempty: false + type: string + description: AKS VNet integration subnet name. If it's an empty string, then VNet integration is disabled. RestartVwRequest: type: object description: Request object for the restartVw method. @@ -4001,6 +4697,16 @@ definitions: type: boolean default: false description: Include Kube system. + ExternalBucket: + type: object + description: External bucket details. + properties: + name: + type: string + description: Name of the bucket. + accessInfo: + $ref: '#/definitions/ExternalBucketAccessInfo' + description: AccessInfo of the bucket. ClusterSummaryResponse: type: object description: A Cloudera Data Warehouse cluster. @@ -4039,6 +4745,16 @@ definitions: x-form-factors: public type: boolean description: Denotes whether the spot instances have been enabled for the cluster. This value is only available for AWS and Azure clusters. + reservedComputeNodes: + x-entitlement: CDW_CLUSTER_OVERPROVISIONER + type: integer + format: int32 + description: Number of additional reserved nodes for executors and coordinators to use during autoscaling. + reservedSharedServicesNodes: + x-entitlement: CDW_CLUSTER_OVERPROVISIONER + type: integer + format: int32 + description: Number of additional reserved nodes for other services in the cluster. computeInstanceTypes: type: array items: @@ -4057,6 +4773,24 @@ definitions: $ref: '#/definitions/AzureOptionsResponse' description: Response object of Azure related cluster options. x-form-factors: public + description: + type: string + description: Cluster description. + whitelistK8sClusterAccessIpCIDRs: + type: string + description: List of IP address CIDRs to whitelist for kubernetes cluster access. + whitelistWorkloadAccessIpCIDRs: + type: string + description: List of IP address CIDRs to whitelist for workload access. + resourcePool: + type: string + description: The name of the Resource Pool the cluster is in. + x-form-factors: private + externalBuckets: + type: array + description: External buckets attached to the environment. + items: + $ref: '#/definitions/ExternalBucket' DataVisualizationSummary: type: object description: A Cloudera Data Visualization. @@ -4079,6 +4813,20 @@ definitions: size: type: string description: The template size for the Cloudera Data Visualization + resourcePool: + type: string + description: The name of the Resource Pool the Cloudera Data Visualization is in. + x-form-factors: private + userGroups: + type: array + items: + type: string + description: User groups that are allowed to access the Data Visualization. + adminGroups: + type: array + items: + type: string + description: Admin groups that are allowed to access the Data Visualization. DbcSummary: type: object description: A Database Catalog. @@ -4106,6 +4854,10 @@ definitions: type: string format: date-time description: Creation date of Database Catalog. + resourcePool: + type: string + description: The name of the Resource Pool the Database Catalog is in. + x-form-factors: private VwSummary: type: object description: A Virtual Warehouse. @@ -4145,6 +4897,18 @@ definitions: cdhVersion: type: string description: CDH image version. + numOfCores: + type: integer + format: int32 + description: Number of cores of the Virtual Warehouse. + memoryCapacity: + type: integer + format: int32 + description: Memory size of the Virtual Warehouse in MB. + nodeCount: + type: integer + format: int32 + description: Size of the Virtual Warehouse (node count per compute cluster). availabilityZone: type: string description: Availability zone in which the Virtual Warehouse is running. @@ -4158,12 +4922,24 @@ definitions: impalaJdbc: type: string description: JDBC URL for Impala Virtual Warehouses. + impalaKerberosJdbc: + type: string + x-form-factors: private + description: JDBC URL for Impala Virtual Warehouses with Kerberos authentication. impalaFENGJdbc: type: string description: FENG JDBC URL for Impala Virtual Warehouses. impalaShell: type: string description: Command to use impala-shell for Impala Virtual Warehouses. + fengImpalaShell: + type: string + x-form-factors: private + description: Command to use impala-shell for Unified Analytics + kerberosImpalaShell: + type: string + x-form-factors: private + description: Command to use impala-shell for Impala Virtual Warehouses with Kerberos authentication. hue: type: string description: URL of Hue for both Hive and Impala Virtual Warehouses. @@ -4237,6 +5013,16 @@ definitions: x-form-factors: public,private description: Status information on the current state of replicas in the virtual warehouse. $ref: '#/definitions/ReplicaStatus' + resourcePool: + type: string + description: The name of the Resource Pool the Virtual Warehouse is in. + x-form-factors: private + hiveAuthenticationMode: + type: string + x-nullable: true + x-deprecated: true + x-form-factors: private + description: 'DEPRECATED - Authentication mode used by Hive Server: * `LDAP` * `KERBEROS`' TagResponse: description: A key/value pair attached to some resources. type: object @@ -4438,6 +5224,19 @@ definitions: vwId: type: string description: ID of the Virtual Warehouse. + template: + type: string + description: Name of configuration template to use. + enum: + - xsmall + - small + - medium + - large + nodeCount: + type: integer + format: int32 + default: 0 + description: Nodes per compute cluster. If specified, forces 'template' to be 'custom' config: description: The service configuration to update the VW with. This will be applied on top of the existing configuration so there's no need to list configurations that stay the same. $ref: '#/definitions/ServiceConfigReq' @@ -4450,6 +5249,12 @@ definitions: queryIsolationOptions: description: Query isolation settings for Hive Virtual Warehouses. $ref: '#/definitions/QueryIsolationOptionsRequest' + hiveAuthenticationMode: + type: string + x-nullable: true + x-deprecated: true + x-form-factors: private + description: 'DEPRECATED - Sets the authentication mode to use by Hive Server: * `LDAP` * `KERBEROS` If not set then the authentication mode will not be changed during update.' platformJwtAuth: type: boolean x-nullable: true @@ -4577,6 +5382,10 @@ definitions: items: type: string description: Admin groups to allow configuration access to Data Visualization for selected users + resourcePool: + type: string + description: The Resource Pool of the Cloudera Data Visualization. + x-form-factors: private ConfigContentDiff: type: object description: Difference between two ConfigContents. @@ -4839,6 +5648,175 @@ definitions: items: $ref: '#/definitions/CloudUserReference' description: The list of users allowed to access the given cluster. + ImpalaExecutorGroupSetsCreateRequest: + type: object + description: Configure executor group sets for workload aware autoscaling. + properties: + small: + $ref: '#/definitions/ImpalaExecutorGroupSetCreateRequest' + description: Configure small executor group set for workload aware autoscaling. + x-omitempty: false + custom1: + $ref: '#/definitions/ImpalaExecutorGroupSetCreateRequest' + description: Configure first optional custom executor group set for workload aware autoscaling. + custom2: + $ref: '#/definitions/ImpalaExecutorGroupSetCreateRequest' + description: Configure second optional custom executor group set for workload aware autoscaling. + custom3: + $ref: '#/definitions/ImpalaExecutorGroupSetCreateRequest' + description: Configure third optional custom executor group set for workload aware autoscaling. + large: + $ref: '#/definitions/ImpalaExecutorGroupSetCreateRequest' + description: Configure large executor group set for workload aware autoscaling. + x-omitempty: false + ImpalaExecutorGroupSetsUpdateRequest: + type: object + description: Re-configure executor group sets for workload aware autoscaling. + properties: + small: + $ref: '#/definitions/ImpalaExecutorGroupSetUpdateRequest' + description: Re-configure small executor group set for workload aware autoscaling. + custom1: + $ref: '#/definitions/ImpalaExecutorGroupSetUpdateRequest' + description: Re-configure first optional custom executor group set for workload aware autoscaling. + custom2: + $ref: '#/definitions/ImpalaExecutorGroupSetUpdateRequest' + description: Re-configure second optional custom executor group set for workload aware autoscaling. + custom3: + $ref: '#/definitions/ImpalaExecutorGroupSetUpdateRequest' + description: Re-configure third optional custom executor group set for workload aware autoscaling. + large: + $ref: '#/definitions/ImpalaExecutorGroupSetUpdateRequest' + description: Re-configure large executor group set for workload aware autoscaling. + ImpalaExecutorGroupSetsResponse: + type: object + description: Describes executor group sets for workload aware autoscaling. + properties: + small: + $ref: '#/definitions/ImpalaExecutorGroupSetResponse' + description: Describes small executor group set for workload aware autoscaling. + custom1: + $ref: '#/definitions/ImpalaExecutorGroupSetResponse' + description: Describes first custom executor group set for workload aware autoscaling. + custom2: + $ref: '#/definitions/ImpalaExecutorGroupSetResponse' + description: Describes second custom executor group set for workload aware autoscaling. + custom3: + $ref: '#/definitions/ImpalaExecutorGroupSetResponse' + description: Describes third custom executor group set for workload aware autoscaling. + large: + $ref: '#/definitions/ImpalaExecutorGroupSetResponse' + description: Describes large executor group set for workload aware autoscaling. + ImpalaExecutorGroupSetCreateRequest: + type: object + description: Configure independently scaling set of uniformly sized executor groups. + properties: + execGroupSize: + type: integer + format: int32 + description: Set number of executors per executor group. + x-omitempty: false + minExecutorGroups: + type: integer + format: int32 + description: Set minimum number of executor groups allowed. + x-omitempty: false + maxExecutorGroups: + type: integer + format: int32 + description: Set maximum number of executor groups allowed. + x-omitempty: false + autoSuspendTimeoutSeconds: + type: integer + format: int32 + description: Set auto suspend threshold. If not provided defaults will apply. + disableAutoSuspend: + type: boolean + description: Turn off auto suspend. If not provided defaults will apply. + triggerScaleUpDelay: + type: integer + format: int32 + description: Set scale up threshold in seconds. If not provided defaults will apply. + triggerScaleDownDelay: + type: integer + format: int32 + description: Set scale down threshold in seconds. If not provided defaults will apply. + ImpalaExecutorGroupSetUpdateRequest: + type: object + description: Re-configure independently scaling set of uniformly sized executor groups. + properties: + execGroupSize: + type: integer + format: int32 + description: Set number of executors per executor group. + minExecutorGroups: + type: integer + format: int32 + description: Set minimum number of executor groups allowed. + maxExecutorGroups: + type: integer + format: int32 + description: Set maximum number of executor groups allowed. + autoSuspendTimeoutSeconds: + type: integer + format: int32 + description: Set auto suspend threshold. If not provided defaults will apply. + disableAutoSuspend: + type: boolean + description: Turn off auto suspend. If not provided defaults will apply. + triggerScaleUpDelay: + type: integer + format: int32 + description: Set scale up threshold in seconds. If not provided defaults will apply. + triggerScaleDownDelay: + type: integer + format: int32 + description: Set scale down threshold in seconds. If not provided defaults will apply. + deleteGroupSet: + type: boolean + description: Delete the executor group set. + ImpalaExecutorGroupSetResponse: + type: object + description: Describes configurations for an executor group set. + properties: + groupSetPrefix: + type: string + description: Name of resource pool for this executor group set. + x-omitempty: false + execGroupSize: + type: integer + format: int32 + description: Number of executors per executor group. + x-omitempty: false + minExecutorGroups: + type: integer + format: int32 + description: Minimum number of executor groups allowed. + x-omitempty: false + maxExecutorGroups: + type: integer + format: int32 + description: Maximum number of executor groups allowed. + x-omitempty: false + autoSuspendTimeoutSeconds: + type: integer + format: int32 + description: Auto suspend threshold. + x-omitempty: false + disableAutoSuspend: + type: boolean + description: Denotes whether auto suspend is turned off. + x-omitempty: false + triggerScaleUpDelay: + type: integer + format: int32 + description: Scale up threshold in seconds. + x-omitempty: false + triggerScaleDownDelay: + type: integer + format: int32 + description: Scale down threshold in seconds. + x-omitempty: false CloudUserReference: type: object description: Cloud user definition object. @@ -5013,8 +5991,14 @@ definitions: type: string description: Specified name for the backup. If not set, the name will be blank. namespaceName: + x-deprecated: true type: string - description: Namespace of the potential candidate for backup. If not set, all of the Data Warehouse namespaces will be backed up. + description: DEPRECATED in favor of the namespaceNames. Namespace of the potential candidate for backup. If not set, all of the Data Warehouse namespaces will be backed up. + namespaceNames: + type: array + description: If both namespaceName and namespaceNames are set, the namespaceName will be ignored! A list of namespace of the potential candidates for backup. If not set, all of the Data Warehouse namespaces will be backed up. + items: + type: string CreateBackupResponse: type: object x-form-factors: private diff --git a/cdp-sdk-go/resources/swagger/environments.yaml b/cdp-sdk-go/resources/swagger/environments.yaml index c9a37f4c..5a2f4f73 100644 --- a/cdp-sdk-go/resources/swagger/environments.yaml +++ b/cdp-sdk-go/resources/swagger/environments.yaml @@ -6,7 +6,7 @@ x-form-factors: public,private x-cdp-releases: PUBLIC x-audit: true info: - version: 0.9.92 (BETA) + version: 0.9.103 (BETA) title: Cloudera Environments Service license: name: Apache 2.0 @@ -40,6 +40,27 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/environments2/getGovCloudCredentialPrerequisites: + post: + summary: This API provides the credential prerequisites for GovCloud for the enabled providers. + description: Provides the the credential prerequisites for GovCloud for the enabled providers. + operationId: getGovCloudCredentialPrerequisites + x-mutating: false + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/GetGovCloudCredentialPrerequisitesRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/GetGovCloudCredentialPrerequisitesResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/environments2/createAWSEnvironment: post: summary: Creates a new AWS environment by providing the cloud provider access and network information. A FreeIPA server will be automatically provisioned when an environment is created. @@ -61,6 +82,27 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/environments2/createAWSGovCloudEnvironment: + post: + summary: Creates a new AWS GovCloud environment by providing the cloud provider access and network information. A FreeIPA server will be automatically provisioned when an environment is created. + description: Creates a new AWS GovCloud environment. + operationId: createAWSGovCloudEnvironment + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/CreateAWSGovCloudEnvironmentRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/CreateAWSGovCloudEnvironmentResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/environments2/createAzureEnvironment: post: summary: Creates a new Azure environment by providing the cloud provider access and network information. A FreeIPA server will be automatically provisioned when an environment is created. @@ -146,6 +188,27 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/environments2/createAWSGovCloudCredential: + post: + summary: Creates a new AWS credential for GovCloud that can be attatched to an environment. The credential is used for authorization to provision resources such as compute instances within your cloud provider account. + description: Creates a new AWS credential for GovCloud. + operationId: createAWSGovCloudCredential + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/CreateAWSGovCloudCredentialRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/CreateAWSGovCloudCredentialResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/environments2/createAzureCredential: post: summary: Creates a new Azure credential that can be attached to an environment. The credential is used for authorization to provision resources such as compute instances within your cloud provider account. @@ -251,6 +314,27 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/environments2/updateAzureDatabaseResources: + post: + summary: Update the Azure database resources for the environment. + description: Updates the Azure database resources for the environment. Enables deploying private Flexible Server for the existing environment. + operationId: updateAzureDatabaseResources + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/UpdateAzureDatabaseResourcesRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/UpdateAzureDatabaseResourcesResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/environments2/disableS3Guard: post: summary: Disable the S3Guard for an environment. @@ -462,6 +546,27 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/environments2/listConnectedDataServices: + post: + summary: Returns the list of Data Services and their cluster names that are attached the given environment. + description: Returns the list of Data Services and their cluster names that are attached to the given environment. + operationId: listConnectedDataServices + x-mutating: false + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/ListConnectedDataServicesRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/ListConnectedDataServicesResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/environments2/getEnvironmentUserSyncState: post: summary: Returns the user synchronization state for an environment. @@ -720,6 +825,27 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/environments2/getOperation: + post: + summary: Get the latest (in progress or finished) operation for the environment resource. + description: Get the latest (in progress or finished) operation for the environment resource. + operationId: getOperation + x-mutating: false + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/GetOperationRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/GetOperationResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/environments2/checkEnvironmentConnectivity: post: summary: Checks connectivity to a new Private Cloud environment by trying to access the Cloudera Manager address with provided credentials. @@ -1208,6 +1334,27 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/environments2/getGovCloudAuditCredentialPrerequisites: + post: + summary: This API provides the audit credential prerequisites for GovCloud for the enabled providers. + description: Provides the the audit credential prerequisites for GovCloud for the enabled providers. + operationId: getGovCloudAuditCredentialPrerequisites + x-mutating: false + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/GetGovCloudAuditCredentialPrerequisitesRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/GetGovCloudAuditCredentialPrerequisitesResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/environments2/listAuditCredentials: post: summary: Lists audit credentials. @@ -1250,6 +1397,27 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/environments2/setAWSGovCloudAuditCredential: + post: + summary: Creates or updates the AWS GovCloud audit credential for the account. The credential is used for authorization to archive audit events to your cloud storage. + description: Creates or updates the AWS GovCloud audit credential for the account. The response will only contain details appropriate to AWS. + operationId: setAWSGovCloudAuditCredential + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/SetAWSGovCloudAuditCredentialRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/SetAWSGovCloudAuditCredentialResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/environments2/setAzureAuditCredential: post: summary: Creates or updates the Azure audit credential for the account. The credential is used for authorization to archive audit events to your cloud storage. @@ -1271,6 +1439,27 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/environments2/setGCPAuditCredential: + post: + summary: Creates or updates the GCP audit credential for the account. The credential is used for authorization to archive audit events to your cloud storage. + description: Creates or updates the GCP audit credential for the account. The response will only contain details appropriate to GCP. + operationId: setGCPAuditCredential + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/SetGCPAuditCredentialRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/SetGCPAuditCredentialResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/environments2/deleteAuditCredential: post: summary: Deletes an audit credential. @@ -1314,13 +1503,33 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/environments2/updateSshKey: + post: + summary: Updates the designated SSH key for the given environment. + description: Updates the designated SSH key for the given environment. + operationId: updateSshKey + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/UpdateSshKeyRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/UpdateSshKeyResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/environments2/updateSubnet: post: summary: Updates the subnet(s) of the given environment. description: Updates the subnet(s) of the given environment. operationId: updateSubnet x-mutating: true - x-no-compatibility-guarantee: true parameters: - name: input in: body @@ -1336,6 +1545,69 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/environments2/updateSecurityAccess: + post: + summary: Updates the security access settings of the given environment. + description: Updates the security access settings of the given environment. + operationId: updateSecurityAccess + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/UpdateSecurityAccessRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/UpdateSecurityAccessResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/environments2/validateAwsCloudStorage: + post: + summary: Validates AWS cloud storage settings of the given environment. + description: Validates AWS cloud storage settings of the given environment. + operationId: validateAwsCloudStorage + x-mutating: false + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/ValidateAwsCloudStorageRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/ValidateAwsCloudStorageResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/environments2/validateAzureCloudStorage: + post: + summary: Validates Azure cloud storage settings of the given environment. + description: Validates Azure cloud storage settings of the given environment. + operationId: validateAzureCloudStorage + x-mutating: false + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/ValidateAzureCloudStorageRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/ValidateAzureCloudStorageResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /api/v1/environments2/setCatalog: post: summary: Sets a catalog for a FreeIPA installation. @@ -1363,7 +1635,6 @@ paths: description: FreeIPA is an integrated Identity and Authentication solution that can be used for any of CM, CDP services. operationId: upgradeFreeipa x-mutating: true - x-no-compatibility-guarantee: true parameters: - name: input in: body @@ -1427,7 +1698,6 @@ paths: description: Retries the last failed operation on a FreeIPA. operationId: retryFreeipa x-mutating: true - x-no-compatibility-guarantee: true parameters: - name: input in: body @@ -1535,7 +1805,6 @@ paths: description: Updates the proxy config of the given environment. operationId: updateProxyConfig x-mutating: true - x-entitlement: CDP_ENVIRONMENT_EDIT_PROXY_CONFIG parameters: - name: input in: body @@ -1551,6 +1820,69 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /api/v1/environments2/updateAzureImageTermsPolicy: + post: + summary: Updates account level Azure Marketplace image policy. CDP is capable to automatically accept Azure Marketplace image terms during cluster deployment. You can use this setting in your account to opt in or opt out this behaviour. + description: Updates account level Azure Marketplace image policy. CDP is capable to automatically accept Azure Marketplace image terms during cluster deployment. You can use this setting in your account to opt in or opt out this behaviour. + operationId: updateAzureImageTermsPolicy + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/UpdateAzureImageTermsPolicyRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/UpdateAzureImageTermsPolicyResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/environments2/getAzureImageTermsPolicy: + post: + summary: Gets account level Azure Marketplace image policy. CDP is capable to automatically accept Azure Marketplace image terms during cluster deployment. You can use this setting in your account to opt in or opt out this behaviour. + description: Gets account level Azure Marketplace image policy. CDP is capable to automatically accept Azure Marketplace image terms during cluster deployment. You can use this setting in your account to opt in or opt out this behaviour. + operationId: getAzureImageTermsPolicy + x-mutating: false + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/GetAzureImageTermsPolicyRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/GetAzureImageTermsPolicyResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /api/v1/environments2/updateDataServiceResources: + post: + summary: Updates Data Service resources of an environment. + description: Updates Data Service resources of an environment. + operationId: updateDataServiceResources + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/UpdateDataServiceResourcesRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/UpdateDataServiceResourcesResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' definitions: Error: type: object @@ -1562,13 +1894,35 @@ definitions: message: type: string description: The error message. + UpdateSshKeyRequest: + type: object + description: The request object for updating the environment SSH key. + required: + - environment + properties: + environment: + type: string + description: The name or the CRN of the environment. + newPublicKey: + type: string + description: A new SSH public key that is stored locally. Either this or an existing public key ID has to be given. + existingPublicKeyId: + type: string + description: The ID of the existing SSH public key that is stored on the cloud provider side. Either this or a new public key has to be given. + UpdateSshKeyResponse: + type: object + description: Response object for an update environment SSH key request. + required: + - environment + properties: + environment: + $ref: '#/definitions/Environment' + description: The environment. UpdateSubnetRequest: type: object description: The request for updating subnets of the given environment. - x-no-compatibility-guarantee: true required: - environment - - subnetIds properties: environment: type: string @@ -1578,10 +1932,40 @@ definitions: items: type: string description: The selected subnets to update the given environment to. + endpointAccessGatewaySubnetIds: + type: array + items: + type: string + description: The selected subnets to update for the given environment's endpoint access gateway. UpdateSubnetResponse: type: object description: Response object for an update environment subnet request. - x-no-compatibility-guarantee: true + required: + - environment + properties: + environment: + $ref: '#/definitions/Environment' + description: The environment. + UpdateSecurityAccessRequest: + type: object + description: The request object for updating security access of the given environment. + required: + - environment + - gatewayNodeSecurityGroupId + - defaultSecurityGroupId + properties: + environment: + type: string + description: The name or the CRN of the environment. + gatewayNodeSecurityGroupId: + type: string + description: Security group ID where Knox-enabled hosts are placed. + defaultSecurityGroupId: + type: string + description: Security group ID for non-gateway nodes. + UpdateSecurityAccessResponse: + type: object + description: Response object for an update environment security access request. required: - environment properties: @@ -1613,6 +1997,31 @@ definitions: description: type: string description: A description for the credential. + CreateAWSGovCloudCredentialRequest: + type: object + description: Request object for a create AWS credential request for GovCloud. + required: + - credentialName + - roleArn + properties: + credentialName: + type: string + description: The name of the credential. + roleArn: + type: string + description: The ARN of the delegated access role. + description: + type: string + description: A description for the credential. + CreateAWSGovCloudCredentialResponse: + type: object + description: Response object for a create AWS credential request for GovCloud. + required: + - credential + properties: + credential: + description: The credential object. + $ref: '#/definitions/Credential' CreateAzureCredentialRequest: type: object description: Request object for a create Azure credential request. @@ -1758,6 +2167,9 @@ definitions: roleArn: type: string description: The AWS role arn for the given credential. + govCloud: + type: boolean + description: Flag that indicates that the given AWS credential is GovCloud specfic. AzureCredentialProperties: type: object description: The credential properties that closely related to those that have been created on Azure. @@ -1876,25 +2288,144 @@ definitions: description: The related role definition json encoded in base64 policies: type: array - description: The fine-grained policies related to each service. + description: The fine-grained policies related to each service. + items: + $ref: '#/definitions/CredentialGranularPolicyResponse' + GcpCredentialPrerequisitesResponse: + type: object + description: Response object for getting GCP credential prerequisites. + required: + - serviceAccountCreationCommand + properties: + serviceAccountCreationCommand: + type: string + description: GCP CLI command to create service account encoded in base64. + GetGovCloudCredentialPrerequisitesRequest: + type: object + description: Request object for getting the credential prerequisites for GovCloud for the enabled providers. + required: + - cloudPlatform + properties: + cloudPlatform: + type: string + description: The kind of cloud platform. As of now, the following cloud provider is accepted as the value of this field - AWS + GetGovCloudCredentialPrerequisitesResponse: + type: object + description: The credential prerequisites for GovCloud for the enabled providers. + properties: + accountId: + type: string + description: The provider specific identifier of the account/subscription/project. + aws: + description: Provides the external id and policy JSON (this one encoded in base64) for AWS GovCloud credential creation. + $ref: '#/definitions/AwsCredentialPrerequisitesResponse' + CredentialGranularPolicyResponse: + type: object + description: Response object for the granular policy for the given service or experience. + required: + - service + - policyJson + properties: + service: + type: string + description: The name of the service that requires the given policy for resource management. + policyJson: + type: string + description: The policy JSON encoded in base64. + CreateAWSEnvironmentRequest: + type: object + description: Request object for a create AWS environment request. + required: + - environmentName + - credentialName + - region + - securityAccess + - authentication + - logStorage + properties: + environmentName: + type: string + description: The name of the environment. Must contain only lowercase letters, numbers and hyphens. + credentialName: + type: string + description: Name of the credential to use for the environment. + region: + type: string + description: The region of the environment. + securityAccess: + description: Security control for FreeIPA and Data Lake deployment. + $ref: '#/definitions/SecurityAccessRequest' + authentication: + description: SSH authentication information for accessing cluster node instances. Users with access to this authentication information have root level access to the Data Lake and Data Hub cluster instances. + $ref: '#/definitions/AuthenticationRequest' + logStorage: + description: AWS storage configuration for cluster and audit logs. + $ref: '#/definitions/AwsLogStorageRequest' + networkCidr: + type: string + description: The network CIDR. This will create a VPC along with subnets in multiple Availability Zones. + vpcId: + type: string + description: The Amazon VPC ID. Mutually exclusive with networkCidr. + subnetIds: + type: array + description: One or more subnet IDs within the VPC. Mutually exclusive with networkCidr. + uniqueItems: true + items: + type: string + createPrivateSubnets: + type: boolean + description: Whether to create private subnets or not. + createServiceEndpoints: + type: boolean + description: Whether to create service endpoints or not. + endpointAccessGatewayScheme: + type: string + description: The scheme for the endpoint gateway. PUBLIC creates an external endpoint that can be accessed over the Internet. Defaults to PRIVATE which restricts the traffic to be internal to the VPC. + enum: + - PUBLIC + - PRIVATE + endpointAccessGatewaySubnetIds: + type: array + items: + type: string + description: The subnets to use for endpoint access gateway. + s3GuardTableName: + type: string + description: The name for the DynamoDB table backing S3Guard. + description: + type: string + description: An description of the environment. + enableTunnel: + type: boolean + default: true + description: Whether to enable SSH tunneling for the environment. + workloadAnalytics: + type: boolean + description: When this is enabled, diagnostic information about job and query execution is sent to Workload Manager for Data Hub clusters created within this environment. + reportDeploymentLogs: + type: boolean + description: When true, this will report additional diagnostic information back to Cloudera. + freeIpa: + $ref: '#/definitions/AWSFreeIpaCreationRequest' + description: The FreeIPA creation request for the environment + image: + $ref: '#/definitions/FreeIpaImageRequest' + description: The FreeIPA image request for the environment + tags: + type: array + description: Tags associated with the resources. items: - $ref: '#/definitions/CredentialGranularPolicyResponse' - CredentialGranularPolicyResponse: - type: object - description: Response object for the granular policy for the given service or experience. - required: - - service - - policyJson - properties: - service: + $ref: '#/definitions/TagRequest' + proxyConfigName: type: string - description: The name of the service that requires the given policy for resource management. - policyJson: + description: Name of the proxy config to use for the environment. + encryptionKeyArn: type: string - description: The policy JSON encoded in base64. - CreateAWSEnvironmentRequest: + description: ARN of the AWS KMS CMK to use for the server-side encryption of AWS storage resources. + CreateAWSGovCloudEnvironmentRequest: type: object - description: Request object for a create AWS environment request. + description: Request object for a create AWS GovCloud environment request. required: - environmentName - credentialName @@ -1958,6 +2489,7 @@ definitions: description: An description of the environment. enableTunnel: type: boolean + default: true description: Whether to enable SSH tunneling for the environment. workloadAnalytics: type: boolean @@ -1982,6 +2514,15 @@ definitions: encryptionKeyArn: type: string description: ARN of the AWS KMS CMK to use for the server-side encryption of AWS storage resources. + CreateAWSGovCloudEnvironmentResponse: + type: object + description: Response object for a create AWS GovCloud environment request. + required: + - environment + properties: + environment: + $ref: '#/definitions/Environment' + description: Created environment object. CreatePrivateEnvironmentRequest: type: object description: Request object for a create private cloud environment request. @@ -2398,6 +2939,7 @@ definitions: description: An description of the environment. enableTunnel: type: boolean + default: true description: Whether to enable SSH tunneling for the environment. workloadAnalytics: type: boolean @@ -2446,6 +2988,14 @@ definitions: enableOutboundLoadBalancer: type: boolean description: Whether or not outbound load balancers should be created for Azure environments. The default behavior is to not create the outbound load balancer. + flexibleServerSubnetIds: + type: array + items: + type: string + description: The subnets delegated for Flexible Server database. Accepts either the name or the full resource id. + dataServices: + description: Data Services parameters of the environment. + $ref: '#/definitions/DataServicesRequest' CreateGCPEnvironmentRequest: type: object description: Request object for a create GCP environment request. @@ -2486,6 +3036,7 @@ definitions: description: A description of the environment. enableTunnel: type: boolean + default: true description: Whether to enable SSH tunneling for the environment. workloadAnalytics: type: boolean @@ -2518,7 +3069,6 @@ definitions: encryptionKey: type: string description: Key Resource ID of the customer managed encryption key to encrypt GCP resources. - x-entitlement: CDP_CB_GCP_DISK_ENCRYPTION_WITH_CMEK availabilityZones: description: The zones of the environment in the given region. Multi-zone selection is not supported in GCP yet. It accepts only one zone until support is added. type: array @@ -2546,17 +3096,16 @@ definitions: type: string databasePrivateDnsZoneId: type: string - description: The ID of an existing private DNS zone used for the database. + description: The full Azure resource ID of the existing Private DNS Zone used for Flexible Server and Single Server Databases. aksPrivateDnsZoneId: type: string - description: The ID of an existing private DNS zone used for the AKS. + description: The full Azure resource ID of an existing Private DNS zone used for the AKS. ExistingGCPNetworkRequest: type: object description: Request object for creating an GCP environment using existing VPC and subnets. required: - networkName - subnetNames - - sharedProjectId properties: networkName: type: string @@ -2621,6 +3170,36 @@ definitions: resourceEncryptionParameters: $ref: '#/definitions/AzureResourceEncryptionParameters' description: Object containing details of encryption parameters for Azure cloud. + UpdateAzureDatabaseResourcesRequest: + type: object + description: Request object for updating Azure Database resources. + required: + - environment + properties: + environment: + type: string + description: The name or CRN of the environment. + databasePrivateDnsZoneId: + type: string + description: The full Azure resource ID of the existing Private DNS Zone used for Flexible Server and Single Server Databases. + x-no-paramfile: true + flexibleServerSubnetIds: + type: array + items: + type: string + description: The subnets delegated for Flexible Server database. Accepts either the name or the full resource id. + UpdateAzureDatabaseResourcesResponse: + type: object + description: Response object for a update Azure Database resources request. + required: + - environment + properties: + environment: + $ref: '#/definitions/Environment' + description: The environment summary. + azureDatabaseResources: + $ref: '#/definitions/AzureDatabaseResources' + description: Object containing details of database resources for Azure cloud. UpdateAwsDiskEncryptionParametersRequest: type: object description: Request object for updating AWS encryption parameters. @@ -2669,6 +3248,19 @@ definitions: diskEncryptionSetId: type: string description: ID of the Disk Encryption Set created in Azure which is used to encrypt Managed Disks of FreeIPA, Data Lake, Data Hub and PostgreSQL. + AzureDatabaseResources: + type: object + description: Object containing details of database resources for Azure cloud. + properties: + databasePrivateDnsZoneId: + type: string + description: The full Azure resource ID of the existing Private DNS Zone used for Flexible Server and Single Server Databases. + x-no-paramfile: true + flexibleServerSubnetIds: + type: array + items: + type: string + description: The subnets delegated for Flexible Server database. Accepts either the name or the full resource id. DisableS3GuardRequest: type: object description: Request object for disabling S3Guard in an environment. @@ -2838,7 +3430,9 @@ definitions: tags: description: Environment tags object containing the tag values defined for the environment. $ref: '#/definitions/EnvironmentTags' - x-no-compatibility-guarantee: true + dataServices: + description: Data Services parameters of the environment. + $ref: '#/definitions/DataServices' AuthenticationRequest: type: object description: Additional SSH key authentication configuration for accessing cluster node. @@ -2952,13 +3546,18 @@ definitions: description: Whether to associate public ip's to the resources within the network. databasePrivateDnsZoneId: type: string - description: The ID of an existing private DNS zone used for the database. + description: The full Azure resource ID of the existing Private DNS Zone used for Flexible Server and Single Server Databases. aksPrivateDnsZoneId: type: string - description: The ID of an existing private DNS zone used for the AKS. + description: The full Azure resource ID of an existing Private DNS zone used for the AKS. enableOutboundLoadBalancer: type: boolean description: Whether the outbound load balancer was created for this environment. + flexibleServerSubnetIds: + type: array + items: + type: string + description: The subnets delegated for Flexible Server database. Accepts either the name or the full resource id. NetworkGcpParams: type: object description: GCP network parameters. @@ -3206,6 +3805,41 @@ definitions: endTime: type: string description: Sync operation end timestamp. + ListConnectedDataServicesRequest: + type: object + description: Request object for listing connected Data Service(s) for a given environment. + required: + - environment + properties: + environment: + type: string + description: Name or CRN of the environment. + ListConnectedDataServicesResponse: + type: object + description: Response object for listing connected Data Service(s) for a given environment. + required: + - result + properties: + result: + type: array + description: List of connected Data Service for the given environment. + items: + $ref: '#/definitions/ConnectedDataService' + ConnectedDataService: + type: object + description: A single entry that contains the name of the given Data Service and its related resource(s). + required: + - name + - clusters + properties: + name: + type: string + description: The name of the given Data Service. + clusters: + type: array + description: List of resource names for the given Data Service. + items: + type: string GetEnvironmentUserSyncStateRequest: type: object description: Request object for retrieving the user sync state of an environment. @@ -3542,6 +4176,38 @@ definitions: - COMPLETED - FAILED - TIMEDOUT + GetOperationRequest: + type: object + description: Request object for tracking the latest (current/last) operation on the environment resource. + required: + - environmentName + properties: + environmentName: + type: string + description: Name of the environment resource. + GetOperationResponse: + type: object + description: Response object for tracking the latest (current/last) operation on the environment resource. + properties: + operationId: + type: string + description: Identifier of the operation. + operationType: + type: string + description: Type of the operation. + operationStatus: + type: string + description: Status of the operation. + enum: + - UNKNOWN + - RUNNING + - FAILED + - FINISHED + - CANCELLED + progress: + type: integer + format: int32 + description: Progress percentage of the operation. ExposedService: x-form-factors: private description: Exposed CDP DC service object. @@ -3942,6 +4608,10 @@ definitions: instanceType: type: string description: Custom instance type of FreeIPA instances. + multiAz: + type: boolean + default: false + description: Flag that enables deployment of the FreeIPA in a multi-availability zone. GCPFreeIpaCreationRequest: description: Request object for creating FreeIPA in the environment. type: object @@ -3969,6 +4639,9 @@ definitions: id: type: string description: Image ID to use for creating FreeIPA instances. + os: + type: string + description: The OS to use for creating FreeIPA instances. TagRequest: description: A label that can be attached to some resources. type: object @@ -4025,6 +4698,10 @@ definitions: uniqueItems: true items: $ref: '#/definitions/FreeIpaInstance' + instanceCountByGroup: + type: integer + format: int32 + description: The number of FreeIPA instances to create per group when creating FreeIPA in environment. FreeIpaInstance: type: object description: Object for a FreeIPA instance providing specific information about the instance. @@ -4218,6 +4895,30 @@ definitions: SetTelemetryFeaturesResponse: type: object description: Response object to enable environment level telemetry features. + UpdateAzureImageTermsPolicyRequest: + type: object + description: Request object to enable or disable automatic acceptance of Azure Marketplace image terms. + required: + - accepted + properties: + accepted: + type: boolean + description: Flag to enable or disable automatic acceptance of Azure Marketplace image terms. + UpdateAzureImageTermsPolicyResponse: + type: object + description: Response object to enable or disable automatic acceptance of Azure Marketplace image terms. + GetAzureImageTermsPolicyRequest: + type: object + description: Request object to retrieve current value of setting that controls automatic acceptance of Azure Marketplace image terms. + GetAzureImageTermsPolicyResponse: + type: object + description: Response object to retrieve current value of setting that controls automatic acceptance of Azure Marketplace image terms. + required: + - accepted + properties: + accepted: + type: boolean + description: Flag denoting whether automatic Azure Marketplace image terms acceptance is enabled or disabled. GetEnvironmentSettingRequest: x-form-factors: private type: object @@ -4581,7 +5282,6 @@ definitions: $ref: '#/definitions/FreeipaVmLogResponse' EnvironmentTags: type: object - x-no-compatibility-guarantee: true description: Environment tags object containing the tag values defined for the environment. properties: userDefined: @@ -4614,6 +5314,7 @@ definitions: enum: - AWS - AZURE + - GCP description: The kind of cloud platform. GetAuditCredentialPrerequisitesResponse: type: object @@ -4633,6 +5334,28 @@ definitions: azure: description: Provides the app creation command and role definition Json for Azure credential creation. $ref: '#/definitions/AzureCredentialPrerequisitesResponse' + gcp: + description: Provides the service account creation command for GCP credential creation. + $ref: '#/definitions/GcpCredentialPrerequisitesResponse' + GetGovCloudAuditCredentialPrerequisitesRequest: + type: object + description: Request object for getting the audit credential prerequisites for GovCloud for the enabled providers. + required: + - cloudPlatform + properties: + cloudPlatform: + type: string + description: The kind of cloud platform. As of now, the following cloud provider is accepted as the value of this field - AWS + GetGovCloudAuditCredentialPrerequisitesResponse: + type: object + description: The audit credential prerequisites for GovCloud for the enabled providers. + properties: + accountId: + type: string + description: The provider specific identifier of the account/subscription/project. + aws: + description: Provides the external id and policy JSON (this one encoded in base64) for AWS credential creation. + $ref: '#/definitions/AwsCredentialPrerequisitesResponse' ListAuditCredentialsRequest: type: object description: Request object for a list audit credentials request. @@ -4665,6 +5388,24 @@ definitions: credential: description: The credential object. $ref: '#/definitions/Credential' + SetAWSGovCloudAuditCredentialRequest: + type: object + description: Request object for a set AWS GovCloud audit credential request. + required: + - roleArn + properties: + roleArn: + type: string + description: The ARN of the delegated access role. + SetAWSGovCloudAuditCredentialResponse: + type: object + description: Response object for a set AWS GovCloud audit credential request. + required: + - credential + properties: + credential: + description: The credential object. + $ref: '#/definitions/Credential' SetAzureAuditCredentialRequest: type: object description: Request object for a set Azure audit credential request. @@ -4702,6 +5443,25 @@ definitions: credential: description: The credential object. $ref: '#/definitions/Credential' + SetGCPAuditCredentialRequest: + type: object + description: Request object for a set GCP audit credential request. + required: + - credentialKey + properties: + credentialKey: + type: string + x-sensitive: true + description: The JSON key for the service account. Please use the local path when using the CLI (e.g. file:///absolute/path/to/cred.json) to avoid exposing the keys in the command line history. + SetGCPAuditCredentialResponse: + type: object + description: Response object for a set GCP audit credential request. + required: + - credential + properties: + credential: + description: The credential object. + $ref: '#/definitions/Credential' DeleteAuditCredentialRequest: type: object description: Request object for a delete audit credential request. @@ -4761,6 +5521,68 @@ definitions: description: Additional detail related to the status. items: type: string + ValidateAwsCloudStorageRequest: + type: object + description: Request object for AWS environment cloud storage validation. + required: + - credentialCrn + - storageLocation + - instanceProfile + properties: + credentialCrn: + type: string + description: The CRN of the credential. + storageLocation: + type: string + description: AWS S3 storage bucket location for logging. + instanceProfile: + type: string + description: AWS instance profile. + ValidateAwsCloudStorageResponse: + type: object + description: Response object for AWS environment cloud storage validation. + properties: + status: + description: Validation result. Allowed values are "OK", "ACCESS_DENIED", "ERROR", "RESOURCE_NOT_FOUND". + type: string + error: + description: Error message if validation failed. + type: string + ValidateAzureCloudStorageRequest: + type: object + description: Request object for Azure environment cloud storage validation. + required: + - credentialCrn + - storageLocation + properties: + credentialCrn: + type: string + description: The CRN of the credential. + storageLocation: + type: string + description: Azure storage location for logging. + managedIdentity: + type: string + description: Azure managed identity. + accountKey: + description: Azure account key. + type: string + accountName: + description: Azure account name. + type: string + secure: + description: Azure secure flag. + type: boolean + ValidateAzureCloudStorageResponse: + type: object + description: Response object for Azure environment cloud storage validation. + properties: + status: + description: Validation result. Allowed values are "OK", "ACCESS_DENIED", "ERROR", "RESOURCE_NOT_FOUND". + type: string + error: + description: Error message if validation failed. + type: string SetCatalogRequest: type: object description: The request object to set catalog for a FreeIPA. @@ -4781,17 +5603,21 @@ definitions: UpgradeFreeipaRequest: type: object description: The request object for FreeIPA upgrade. - x-no-compatibility-guarantee: true required: - environmentName properties: environmentName: type: string description: The name or CRN of the environment. + imageId: + type: string + description: Target image ID for upgrade. + allowMajorOsUpgrade: + type: boolean + description: Allows the upgrade to a subsequent major OS version in the series. UpgradeFreeipaResponse: type: object description: The response object for FreeIPA upgrade. - x-no-compatibility-guarantee: true properties: targetImage: description: Image selected for upgrade. @@ -4850,6 +5676,11 @@ definitions: - HA - TWO_NODE_BASED description: The target FreeIPA availability type. + instances: + type: array + items: + type: string + description: The instance Ids to downscale. DownscaleFreeipaResponse: type: object description: The response object for FreeIPA downscale. @@ -4937,7 +5768,6 @@ definitions: ImageInfoResponse: type: object description: Information about FreeIPA image. - x-no-compatibility-guarantee: true properties: catalog: type: string @@ -4960,7 +5790,6 @@ definitions: RetryFreeipaRequest: type: object description: Request object for retry FreeIPA request. - x-no-compatibility-guarantee: true required: - environment properties: @@ -4970,7 +5799,6 @@ definitions: RetryFreeipaResponse: type: object description: Response object for retry FreeIPA operation on an environment. - x-no-compatibility-guarantee: true UpgradeCcmRequest: type: object description: Request object for upgrading Cluster Connectivity Manager on an environment. @@ -5026,4 +5854,58 @@ definitions: description: The name or CRN of the environment. UpdateOrchestratorStateResponse: type: object - description: Response object for running orchestrator engine state update on the FreeIPA cluster. \ No newline at end of file + description: Response object for running orchestrator engine state update on the FreeIPA cluster. + DataServicesRequest: + type: object + description: Data Services parameters request of the environment. + properties: + azure: + description: Azure-specific Data Service parameters request. + $ref: '#/definitions/AzureDataServicesParametersRequest' + DataServices: + type: object + description: Data Services parameters response of the environment. + properties: + azure: + description: Azure-specific Data Service parameters response. + $ref: '#/definitions/AzureDataServicesParameters' + AzureDataServicesParametersRequest: + description: Azure-specific Data Service parameters request. + type: object + required: + - sharedManagedIdentity + properties: + sharedManagedIdentity: + type: string + description: User-assigned managed identity used by the AKS control plane. + AzureDataServicesParameters: + description: Azure-specific Data Service parameters response. + type: object + required: + - sharedManagedIdentity + properties: + sharedManagedIdentity: + type: string + description: User-assigned managed identity used by the AKS control plane. + UpdateDataServiceResourcesRequest: + type: object + description: Update Data Services parameters request of the environment. + required: + - environment + - dataServices + properties: + environment: + type: string + description: The name or CRN of the environment. + dataServices: + description: Data Services parameters request of the environment. + $ref: '#/definitions/DataServicesRequest' + UpdateDataServiceResourcesResponse: + type: object + description: Response object for an update environment Data Service resource request. + required: + - environment + properties: + environment: + $ref: '#/definitions/Environment' + description: The environment. diff --git a/cdp-sdk-go/resources/swagger/iam.yaml b/cdp-sdk-go/resources/swagger/iam.yaml index 9b853e34..f79eee1d 100644 --- a/cdp-sdk-go/resources/swagger/iam.yaml +++ b/cdp-sdk-go/resources/swagger/iam.yaml @@ -5,8 +5,9 @@ x-form-factors: public,private x-altus-releases: PUBLIC x-cdp-releases: PUBLIC x-audit: true +x-extensions: pvcapipath info: - version: 0.9.91 (BETA) + version: 0.9.103 (BETA) title: Cloudera IAM Service license: name: Apache 2.0 @@ -1399,7 +1400,7 @@ paths: /iam/setAuthenticationPolicy: post: summary: Set the authentication policy for the account. - description: Set the authentication policy for the account. Check each request parameter for its default values. Changes to the authentication policy only affect authentications that are done after the policy has been updated. + description: Set the authentication policy for the account. Any parameters not specified in the request will be cleared, and their default values will be used for authentication. Changes to the authentication policy only affect authentications that are done after the policy has been updated. operationId: setAuthenticationPolicy x-no-compatibility-guarantee: true x-right: iam/setAuthenticationPolicy @@ -1629,6 +1630,52 @@ paths: description: The default response on an error. schema: $ref: '#/definitions/Error' + /iam/getDefaultIdentityProvider: + post: + summary: Retrieves the CRN of the default identity provider. + description: Retrieves the CRN of the default identity provider used for CDP initiated login requests. + operationId: getDefaultIdentityProvider + x-form-factors: public + x-right: iam/getDefaultIdentityProvider + x-mutating: false + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/GetDefaultIdentityProviderRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/GetDefaultIdentityProviderResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + /iam/setDefaultIdentityProvider: + post: + summary: Sets the default identity provider. + description: Sets the default identity provider used for CDP initiated login requests. + operationId: setDefaultIdentityProvider + x-form-factors: public + x-right: iam/setDefaultIdentityProvider + x-mutating: true + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/SetDefaultIdentityProviderRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/SetDefaultIdentityProviderResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' /iam/generateWorkloadAuthToken: post: summary: Generates an authentication token for workload APIs. @@ -1725,7 +1772,7 @@ paths: /iam/unlockUserInControlPlane: post: summary: Unlocks user in the CDP control plane. - description: Unlocks user in the CDP control plane. This operation is idempotent. Unlocking an active user will succeed and leave the user active. + description: Unlocks user in the CDP control plane. This operation is idempotent. Unlocking an active user will succeed and leave the user active. This operation is only supported on Cloudera for Government. operationId: unlockUserInControlPlane x-form-factors: public x-right: iam/unlockUserInControlPlane @@ -1748,7 +1795,7 @@ paths: /iam/unlockMachineUserInControlPlane: post: summary: Unlocks machine user in the CDP control plane. - description: Unlocks machine user in the CDP control plane. This operation is idempotent. Unlocking an active machine user will succeed and leave the machine user active. + description: Unlocks machine user in the CDP control plane. This operation is idempotent. Unlocking an active machine user will succeed and leave the machine user active. This operation is only supported on Cloudera for Government. operationId: unlockMachineUserInControlPlane x-form-factors: public x-right: iam/unlockMachineUserInControlPlane @@ -1845,6 +1892,18 @@ definitions: format: int32 description: The expiration, in seconds, of the UI session token. The value of '0' indicates the system default expiration (which is 12 hours). x-no-compatibility-guarantee: true + clientIpAddressesAllowed: + type: array + items: + type: string + description: The list of IP addresses and/or CIDRs used for allowing client access to the UI and API services. Both the allowed list and the blocked list will be used to determine whether to grant or block the client's access. The blocked list takes precedence over the allowed list. When the list is empty or not set, client IP address will not be validated to be present in the allowed list. + x-no-compatibility-guarantee: true + clientIpAddressesBlocked: + type: array + items: + type: string + description: The list of IP addresses and/or CIDRs used for blocking client access to the UI and API services. Both the allowed list and the blocked list will be used to determine whether to grant or block the client's access. The blocked list takes precedence over the allowed list. When the list is empty or not set, client IP address will not be validated to be absent from the blocked list. + x-no-compatibility-guarantee: true Account: type: object description: Information about a Cloudera CDP account. @@ -1925,6 +1984,9 @@ definitions: $ref: '#/definitions/AzureCloudIdentity' description: The list of Azure cloud identities assigned to the user. x-no-compatibility-guarantee: true + status: + type: string + description: The current status of the user. The possible status values are ACTIVE, CONTROL_PLANE_LOCKED_OUT, and DEACTIVATED. ACTIVE indicates that the user is active in CDP. An active user can authenticate to the CDP control plane and workload clusters. CONTROL_PLANE_LOCKED_OUT indicates that the user is locked out of the CDP control plane. The locked-out user can no longer authenticate to the control plane but can authenticate to the workload clusters. DEACTIVATED indicates that the user is deactivated in CDP. A deactivated user can neither authenticate to the control plane nor to the workload clusters. Note that more statuses could be added in the future. The statuses other than ACTIVE are only returned on Cloudera for Government. workloadPasswordDetails: $ref: '#/definitions/WorkloadPasswordDetails' description: Information about the workload password for the user. @@ -1960,6 +2022,9 @@ definitions: $ref: '#/definitions/AzureCloudIdentity' description: The list of Azure cloud identities assigned to the machine user. x-no-compatibility-guarantee: true + status: + type: string + description: The current status of the machine user. The possible status values are ACTIVE and CONTROL_PLANE_LOCKED_OUT. ACTIVE indicates that the machine user is active in CDP. An active machine user can authenticate to the CDP control plane and workload clusters. CONTROL_PLANE_LOCKED_OUT indicates that the machine user is locked out of the CDP control plane. The locked-out machine user can no longer authenticate to the control plane but can authenticate to the workload clusters. Note that more statuses could be added in the future. The statuses other than ACTIVE are only returned on Cloudera for Government. workloadPasswordDetails: $ref: '#/definitions/WorkloadPasswordDetails' description: Information about the workload password for the machine user. @@ -2451,6 +2516,8 @@ definitions: DeleteSamlProviderRequest: type: object description: Request object for deleting SAML provider request. + required: + - samlProviderName properties: samlProviderName: type: string @@ -2498,6 +2565,8 @@ definitions: DescribeSamlProviderRequest: type: object description: Request object for a describe SAML provider request. + required: + - samlProviderName properties: samlProviderName: type: string @@ -3693,6 +3762,18 @@ definitions: minimum: 0 description: The expiration, in seconds, of the UI session token. Set the value to '0' to use system default expiration (which is 12 hours for CDP). The value will be set to '0' if not provided. x-no-compatibility-guarantee: true + clientIpAddressesAllowed: + type: array + items: + type: string + description: The list of IP addresses and/or CIDRs used for allowing client access to the UI and API services. Duplicated values will be removed automatically. Both the allowed list and the blocked list will be used to determine whether to grant or block the client's access. The blocked list takes precedence over the allowed list. When the list is empty or not set, client IP address will not be validated to be present in the allowed list. + x-no-compatibility-guarantee: true + clientIpAddressesBlocked: + type: array + items: + type: string + description: The list of IP addresses and/or CIDRs used for blocking client access to the UI and API services. Duplicated values will be removed automatically. Both the allowed list and the blocked list will be used to determine whether to grant or block the client's access. The blocked list takes precedence over the allowed list. When the list is empty or not set, client IP address will not be validated to be absent from the blocked list. + x-no-compatibility-guarantee: true SetAuthenticationPolicyResponse: type: object description: Response object for a set authentication policy request. @@ -3903,6 +3984,30 @@ definitions: type: string x-paging-output-token: true description: The token to use when requesting the next set of results. If not present, there are no additional results. + GetDefaultIdentityProviderRequest: + type: object + description: Request object to get the default identity provider. + GetDefaultIdentityProviderResponse: + type: object + description: Response object to get the default identity provider. + required: + - crn + properties: + crn: + type: string + description: The CRN of the identity provider used for CDP initiated login requests. The CRN could be a user defined identity provider's CRN or one of the CDP built-ins (like Cloudera SSO). To retrieve more information about your own user-defined saml providers (or other provider types, not the default ones) call the relevant describeXXXProvider, e.g. for SAML providers call describeSamlProvider. + SetDefaultIdentityProviderRequest: + type: object + description: Request object to set the default identity provider. + required: + - nameOrCrn + properties: + nameOrCrn: + type: string + description: The name or CRN of the default identity provider. + SetDefaultIdentityProviderResponse: + type: object + description: Response object to set the default identity provider. GenerateWorkloadAuthTokenRequest: type: object description: Request object for GenerateWorkloadAuthToken method. diff --git a/cdp-sdk-go/resources/swagger/ml.yaml b/cdp-sdk-go/resources/swagger/ml.yaml index 754673fc..d0d72fbf 100644 --- a/cdp-sdk-go/resources/swagger/ml.yaml +++ b/cdp-sdk-go/resources/swagger/ml.yaml @@ -5,7 +5,7 @@ x-products: CDP x-form-factors: public,private x-cdp-releases: PUBLIC info: - version: 0.9.91 (BETA) + version: 0.9.103 (BETA) title: Cloudera Machine Learning license: name: Apache 2.0 @@ -39,6 +39,27 @@ paths: schema: $ref: '#/definitions/Error' x-mutating: true + /api/v1/ml/createModelRegistry: + post: + summary: Creates a new model registry. + description: Create a new model registry by creating a new workspace and install model registry on it. + operationId: createModelRegistry + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/CreateModelRegistryRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/CreateModelRegistryResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + x-mutating: true /api/v1/ml/createWorkspace: post: summary: Create a Cloudera Machine Learning workspace. @@ -102,6 +123,27 @@ paths: schema: $ref: '#/definitions/Error' x-mutating: true + /api/v1/ml/deleteModelRegistry: + post: + summary: Deletes a model registry. + description: Delete a model registry. + operationId: deleteModelRegistry + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/DeleteModelRegistryRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/DeleteModelRegistryResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + x-mutating: true /api/v1/ml/deleteWorkspace: post: summary: Delete Cloudera Machine Learning Workspace. @@ -123,6 +165,27 @@ paths: schema: $ref: '#/definitions/Error' x-mutating: true + /api/v1/ml/describeModelRegistry: + post: + summary: Describe Cloudera Machine Learning Model Registry. + description: Describes a Cloudera Machine Learning Model Registry. + operationId: describeModelRegistry + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/DescribeModelRegistryRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/DescribeModelRegistryResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + x-mutating: false /api/v1/ml/describeWorkspace: post: summary: Describe Cloudera Machine Learning Workspace. @@ -228,6 +291,48 @@ paths: schema: $ref: '#/definitions/Error' x-mutating: false + /api/v1/ml/getModelRegistryKubeconfig: + post: + summary: GetModelRegistryKubeconfig returns kube config for model registry. + description: Gets the Kubeconfig of the model registry cluster. + operationId: getModelRegistryKubeconfig + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/GetModelRegistryKubeconfigRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/GetModelRegistryKubeconfigResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + x-mutating: false + /api/v1/ml/grantModelRegistryAccess: + post: + summary: GrantModelRegistryAccess Cloudera Machine Learning Model Registry. + description: Grants an AWS user to perform Kubernetes operations on a Cloudera Machine Learning model registry via EKS. + operationId: grantModelRegistryAccess + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/GrantModelRegistryAccessRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/GrantModelRegistryAccessResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + x-mutating: true /api/v1/ml/grantWorkspaceAccess: post: summary: GrantWorkspaceAccess Cloudera Machine Learning Workspace. @@ -249,6 +354,48 @@ paths: schema: $ref: '#/definitions/Error' x-mutating: true + /api/v1/ml/listModelRegistries: + post: + summary: Lists all model registries. + description: List all model registries. + operationId: listModelRegistries + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/ListModelRegistriesRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/ListModelRegistriesResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + x-mutating: false + /api/v1/ml/listModelRegistryAccess: + post: + summary: ListWorkspaceAccess Cloudera Machine Learning Model Registry. + description: Lists users that can perform Kubernetes operations on a Cloudera Machine Learning model registry via EKS. + operationId: listModelRegistryAccess + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/ListModelRegistryAccessRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/ListModelRegistryAccessResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + x-mutating: false /api/v1/ml/listWorkspaceAccess: post: summary: ListWorkspaceAccess Cloudera Machine Learning Workspace. @@ -375,6 +522,27 @@ paths: schema: $ref: '#/definitions/Error' x-mutating: true + /api/v1/ml/refreshModelRegistryConfigmap: + post: + summary: Refreshes the model registry configmap of the workspace. + description: Refreshes the model registry configmap of the workspace from the control plane. + operationId: refreshModelRegistryConfigmap + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/RefreshModelRegistryConfigmapRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/RefreshModelRegistryConfigmapResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + x-mutating: true /api/v1/ml/requestWorkflowCancellation: post: summary: Request a workflow cancellation. @@ -438,6 +606,27 @@ paths: schema: $ref: '#/definitions/Error' x-mutating: true + /api/v1/ml/revokeModelRegistryAccess: + post: + summary: RevokeModelRegistryAccess Cloudera Machine Learning Model Registry. + description: Revokes an AWS user to perform Kubernetes operations on a Cloudera Machine Learning model registry via EKS. + operationId: revokeModelRegistryAccess + parameters: + - name: input + in: body + required: true + schema: + $ref: '#/definitions/RevokeModelRegistryAccessRequest' + responses: + 200: + description: Expected response to a valid request. + schema: + $ref: '#/definitions/RevokeModelRegistryAccessResponse' + default: + description: The default response on an error. + schema: + $ref: '#/definitions/Error' + x-mutating: true /api/v1/ml/revokeWorkspaceAccess: post: summary: RevokeWorkspaceAccess Cloudera Machine Learning Workspace. @@ -524,14 +713,10 @@ definitions: description: The volume size in GB. GetLogsRequest: type: object - description: GetLogsRequestfor getting logs for a request ID. + description: GetLogsRequest for getting logs for a request ID. required: - - workspaceCrn - requestID properties: - workspaceCrn: - type: string - description: WorkspaceCrn the requestID belongs to. requestID: type: string description: Unique Key to identify a set of logs. @@ -546,6 +731,10 @@ definitions: type: integer format: int32 description: offset from which the logs should be fetched. + workspaceCrn: + type: string + description: Deprecated. Please begin to use resourceCrn, as this will soon be unsupported + x-deprecated: true GetLogsResponse: type: object description: GetLogsResponse contains all the logs for a given request id. @@ -592,12 +781,14 @@ definitions: GetAuditEventsRequest: type: object description: GetAuditEventsRequest to get all audit events for a given workspace crn. - required: - - workspaceCrn properties: workspaceCrn: type: string - description: Workspace crn for which audit events to be fetched. + description: Deprecated, please begin to use Resource crn, as this will soon be unsupported. + x-deprecated: true + resourceCrn: + type: string + description: Resource crn for which audit events to be fetched. Resource can be workspace or model registry. GetAuditEventsResponse: type: object description: GetAuditEventsResponse containes all the audit events for a given workspace crn. @@ -798,6 +989,18 @@ definitions: network: description: The overlay network for an AWS Kubernetes cluster's CNI. $ref: '#/definitions/OverlayNetwork' + ModelRegistryProvisionK8sRequest: + type: object + description: Request object for provisioning model registry. + properties: + tags: + type: array + items: + $ref: '#/definitions/ProvisionTag' + description: Tags to add to the cloud provider resources created. This is in addition to any tags added by Cloudera. + network: + description: The overlay network for an AWS Kubernetes cluster's CNI. + $ref: '#/definitions/OverlayNetwork' OverlayNetwork: type: object description: Contains the information about overlay network. @@ -1141,6 +1344,9 @@ definitions: isPrivate: type: boolean description: The value to indicate if the cluster is private or not. + isRestored: + type: boolean + description: The value to indicate if the workspace is restored one or not Workspace: type: object description: A ML workspace, which includes the cluster and storage. @@ -1273,6 +1479,9 @@ definitions: isPrivate: type: boolean description: The value to indicate if the cluster is private or not. + isRestored: + type: boolean + description: The value to indicate if the workspace is restored one or not UpgradeWorkspaceRequest: type: object description: Request object for the UpgradeWorkspace method. @@ -1314,6 +1523,24 @@ definitions: workspace: description: The workspace. $ref: '#/definitions/Workspace' + DescribeModelRegistryRequest: + type: object + description: Request object for the DescribeModelRegistry method. + required: + - modelRegistryCrn + properties: + modelRegistryCrn: + type: string + description: The CRN of the Model Registry to describe. + DescribeModelRegistryResponse: + type: object + description: Response object for the DescribeModelRegistry method. + required: + - modelRegistry + properties: + modelRegistry: + description: The workspace. + $ref: '#/definitions/ModelRegistry' DeleteInstanceGroupRequest: type: object description: Request object for the DeleteInstanceGroup method. @@ -1446,6 +1673,20 @@ definitions: workspaceCrn: type: string description: The CRN of the workspace to list access. + GetModelRegistryKubeconfigRequest: + type: object + description: Request object for GetModelRegistryKubeconfig. + properties: + modelRegistryCrn: + type: string + description: CRN of the Model Registry + GetModelRegistryKubeconfigResponse: + type: object + description: GetModelRegistryKubeconfigResponse response provides model registry kube config. + properties: + kubeConfig: + type: string + description: KubeConfig of the model registry cluster GetKubeconfigResponse: type: object description: Response object for the GetKubeconfig method. @@ -1678,4 +1919,210 @@ definitions: items: $ref: '#/definitions/WorkflowMetadata' description: The list of workflow metedata for cancelled workflows. + CreateModelRegistryRequest: + type: object + description: Request object for creating model registry. + properties: + namespace: + type: string + description: The namespace of the model registry. + s3AccessKey: + type: string + description: The S3 access key of Ozone. + x-sensitive: true + s3SecretKey: + type: string + description: The S3 secret key of Ozone. + x-sensitive: true + s3Bucket: + type: string + description: The s3Bucket of Ozone. + s3Endpoint: + type: string + description: The endpoint of Ozone. + x-no-paramfile: true + creatorCrn: + type: string + description: The creator of model registry. + environmentCrn: + type: string + description: The environment CRN of model registry. + environmentName: + type: string + description: The environment for the model registry to create. + createWorkspacePayload: + description: Deprecated. The create workspace request on which model registry helm chart is deployed. + x-deprecated: true + $ref: '#/definitions/CreateWorkspaceRequest' + usePublicLoadBalancer: + type: boolean + description: The boolean flag to request a public load balancer. By default, a private load balancer is used. + subnetsForLoadBalancers: + type: array + items: + type: string + description: The list of subnets used for the load balancer that CML creates. + outboundTypes: + type: array + items: + $ref: '#/definitions/OutboundTypes' + description: Outbound Types provided for the cluster. + skipValidation: + type: boolean + description: Skip pre-flight validations if requested. + privateCluster: + type: boolean + description: Whether to create a private cluster. + provisionK8sRequest: + description: The request for Kubernetes cluster provision. Required in public cloud. + $ref: '#/definitions/ModelRegistryProvisionK8sRequest' + CreateModelRegistryResponse: + type: object + description: Response for creating model registry request. + ListModelRegistriesRequest: + type: object + description: Request object for deleting model registry. + ListModelRegistriesResponse: + type: object + description: List of all available model registries. + properties: + modelRegistries: + type: array + items: + $ref: '#/definitions/ModelRegistry' + description: The list of model registry. + ModelRegistry: + type: object + description: Model registry object + properties: + id: + type: integer + format: int64 + description: The id of model registry. + namespace: + type: string + description: The namespace of model registry. + s3Bucket: + type: string + description: The s3 bucket of model registry. + s3Endpoint: + type: string + description: The Ozone endpoint of model registry. + creator: + type: string + description: The creator of model registry. + status: + type: string + description: The status of model registry. + environmentCrn: + type: string + description: The environment CRN of model registry. + createdAt: + type: string + format: date-time + description: The creation time of model registry. + crn: + type: string + description: ModelRegistry CRN. + workspaceCrn: + type: string + description: Deprecated. WorkSpace CRN. This field is no longer used. + x-deprecated: true + environmentName: + type: string + description: Environment name. + workspaceName: + type: string + description: Deprecated, please refer to serviceName. Workspace name. + x-deprecated: true + machineUserCrn: + type: string + description: The machine user CRN of the model registry. + serviceName: + type: string + description: The service name of model registry. + DeleteModelRegistryRequest: + type: object + description: Request for deleting model registry. + properties: + id: + type: string + description: Deprecated, please use modelRegistryCrn. The environment CRN of the model registry. + x-deprecated: true + workspaceCrn: + type: string + description: Deprecated. The workspace CRN of the model registry (Public cloud only). + x-deprecated: true + force: + type: boolean + description: Force delete a model registry workspace even if errors occur during deletion. Force delete removes the guarantee that resources in your cloud account will be cleaned up. By default, force is set to false. + modelRegistryCrn: + type: string + description: CRN of the model registry to be deleted. + DeleteModelRegistryResponse: + type: object + description: Delete model registry response. + RefreshModelRegistryConfigmapRequest: + type: object + description: Request for refreshing workspace's model registry configmap. + properties: + workspaceCrn: + type: string + description: Workspace CRN. + RefreshModelRegistryConfigmapResponse: + type: object + description: Response for refreshing workspace's model registry configmap. + GrantModelRegistryAccessRequest: + type: object + description: Request object for the GrantModelRegistryAccess method. + properties: + resourceCrn: + type: string + description: The CRN of the Model Registry to grant access to. + identifier: + type: string + description: The cloud provider user id, such as ARN, which will be granted access to the model registry's Kubernetes cluster. + GrantModelRegistryAccessResponse: + type: object + description: Response object for the GrantModelRegistryAccess method. + required: + - kubeconfig + properties: + kubeconfig: + type: string + description: The Kubernetes config file + x-sensitive: true + RevokeModelRegistryAccessRequest: + type: object + description: Request object for the RevokeModelRegistry method. + properties: + resourceCrn: + type: string + description: The CRN of the Model Registry to grant access to. + identifier: + type: string + description: The cloud provider user id, such as ARN, which will be granted access to the model registry's Kubernetes cluster. + RevokeModelRegistryAccessResponse: + type: object + description: Response object for the RevokeModelRegistryAccess method. + ListModelRegistryAccessRequest: + type: object + description: Request object for the ListModelRegistryAccess method. + properties: + resourceCrn: + type: string + description: The CRN of the Model Registry to list access. + ListModelRegistryAccessResponse: + type: object + description: Response object for the ListModelRegistryAccess method. + required: + - users + properties: + users: + type: array + items: + type: string + x-sensitive: true + description: The list of users that have access. + x-sensitive: true x-audit: true diff --git a/go.mod b/go.mod index 065d523e..cee94952 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb github.com/mitchellh/go-homedir v1.1.0 github.com/pkg/errors v0.9.1 + github.com/stretchr/testify v1.8.4 golang.org/x/crypto v0.9.0 golang.org/x/net v0.10.0 golang.org/x/text v0.9.0 @@ -75,17 +76,12 @@ require ( github.com/oklog/run v1.0.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/posener/complete v1.2.3 // indirect github.com/russross/blackfriday v1.6.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.16.0 // indirect github.com/stretchr/objx v0.5.0 // indirect - github.com/stretchr/testify v1.8.4 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect github.com/vmihailenco/tagparser v0.1.1 // indirect diff --git a/go.sum b/go.sum index 2040665e..5063894e 100644 --- a/go.sum +++ b/go.sum @@ -269,7 +269,6 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -297,10 +296,7 @@ github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -316,7 +312,6 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= @@ -431,6 +426,7 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/mocks/github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/client/operations/MockEnvironmentClientService.go b/mocks/github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/client/operations/MockEnvironmentClientService.go index f9efb82a..04e196ef 100644 --- a/mocks/github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/client/operations/MockEnvironmentClientService.go +++ b/mocks/github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/client/operations/MockEnvironmentClientService.go @@ -642,6 +642,144 @@ func (_c *MockEnvironmentClientService_CreateAWSEnvironment_Call) RunAndReturn(r return _c } +// CreateAWSGovCloudCredential provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) CreateAWSGovCloudCredential(params *operations.CreateAWSGovCloudCredentialParams, opts ...operations.ClientOption) (*operations.CreateAWSGovCloudCredentialOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.CreateAWSGovCloudCredentialOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.CreateAWSGovCloudCredentialParams, ...operations.ClientOption) (*operations.CreateAWSGovCloudCredentialOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.CreateAWSGovCloudCredentialParams, ...operations.ClientOption) *operations.CreateAWSGovCloudCredentialOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.CreateAWSGovCloudCredentialOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.CreateAWSGovCloudCredentialParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_CreateAWSGovCloudCredential_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateAWSGovCloudCredential' +type MockEnvironmentClientService_CreateAWSGovCloudCredential_Call struct { + *mock.Call +} + +// CreateAWSGovCloudCredential is a helper method to define mock.On call +// - params *operations.CreateAWSGovCloudCredentialParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) CreateAWSGovCloudCredential(params interface{}, opts ...interface{}) *MockEnvironmentClientService_CreateAWSGovCloudCredential_Call { + return &MockEnvironmentClientService_CreateAWSGovCloudCredential_Call{Call: _e.mock.On("CreateAWSGovCloudCredential", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_CreateAWSGovCloudCredential_Call) Run(run func(params *operations.CreateAWSGovCloudCredentialParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_CreateAWSGovCloudCredential_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.CreateAWSGovCloudCredentialParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_CreateAWSGovCloudCredential_Call) Return(_a0 *operations.CreateAWSGovCloudCredentialOK, _a1 error) *MockEnvironmentClientService_CreateAWSGovCloudCredential_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_CreateAWSGovCloudCredential_Call) RunAndReturn(run func(*operations.CreateAWSGovCloudCredentialParams, ...operations.ClientOption) (*operations.CreateAWSGovCloudCredentialOK, error)) *MockEnvironmentClientService_CreateAWSGovCloudCredential_Call { + _c.Call.Return(run) + return _c +} + +// CreateAWSGovCloudEnvironment provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) CreateAWSGovCloudEnvironment(params *operations.CreateAWSGovCloudEnvironmentParams, opts ...operations.ClientOption) (*operations.CreateAWSGovCloudEnvironmentOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.CreateAWSGovCloudEnvironmentOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.CreateAWSGovCloudEnvironmentParams, ...operations.ClientOption) (*operations.CreateAWSGovCloudEnvironmentOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.CreateAWSGovCloudEnvironmentParams, ...operations.ClientOption) *operations.CreateAWSGovCloudEnvironmentOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.CreateAWSGovCloudEnvironmentOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.CreateAWSGovCloudEnvironmentParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_CreateAWSGovCloudEnvironment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateAWSGovCloudEnvironment' +type MockEnvironmentClientService_CreateAWSGovCloudEnvironment_Call struct { + *mock.Call +} + +// CreateAWSGovCloudEnvironment is a helper method to define mock.On call +// - params *operations.CreateAWSGovCloudEnvironmentParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) CreateAWSGovCloudEnvironment(params interface{}, opts ...interface{}) *MockEnvironmentClientService_CreateAWSGovCloudEnvironment_Call { + return &MockEnvironmentClientService_CreateAWSGovCloudEnvironment_Call{Call: _e.mock.On("CreateAWSGovCloudEnvironment", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_CreateAWSGovCloudEnvironment_Call) Run(run func(params *operations.CreateAWSGovCloudEnvironmentParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_CreateAWSGovCloudEnvironment_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.CreateAWSGovCloudEnvironmentParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_CreateAWSGovCloudEnvironment_Call) Return(_a0 *operations.CreateAWSGovCloudEnvironmentOK, _a1 error) *MockEnvironmentClientService_CreateAWSGovCloudEnvironment_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_CreateAWSGovCloudEnvironment_Call) RunAndReturn(run func(*operations.CreateAWSGovCloudEnvironmentParams, ...operations.ClientOption) (*operations.CreateAWSGovCloudEnvironmentOK, error)) *MockEnvironmentClientService_CreateAWSGovCloudEnvironment_Call { + _c.Call.Return(run) + return _c +} + // CreateAzureCredential provides a mock function with given fields: params, opts func (_m *MockEnvironmentClientService) CreateAzureCredential(params *operations.CreateAzureCredentialParams, opts ...operations.ClientOption) (*operations.CreateAzureCredentialOK, error) { _va := make([]interface{}, len(opts)) @@ -1884,6 +2022,75 @@ func (_c *MockEnvironmentClientService_GetAutomatedSyncEnvironmentStatus_Call) R return _c } +// GetAzureImageTermsPolicy provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) GetAzureImageTermsPolicy(params *operations.GetAzureImageTermsPolicyParams, opts ...operations.ClientOption) (*operations.GetAzureImageTermsPolicyOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.GetAzureImageTermsPolicyOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.GetAzureImageTermsPolicyParams, ...operations.ClientOption) (*operations.GetAzureImageTermsPolicyOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.GetAzureImageTermsPolicyParams, ...operations.ClientOption) *operations.GetAzureImageTermsPolicyOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.GetAzureImageTermsPolicyOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.GetAzureImageTermsPolicyParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_GetAzureImageTermsPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAzureImageTermsPolicy' +type MockEnvironmentClientService_GetAzureImageTermsPolicy_Call struct { + *mock.Call +} + +// GetAzureImageTermsPolicy is a helper method to define mock.On call +// - params *operations.GetAzureImageTermsPolicyParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) GetAzureImageTermsPolicy(params interface{}, opts ...interface{}) *MockEnvironmentClientService_GetAzureImageTermsPolicy_Call { + return &MockEnvironmentClientService_GetAzureImageTermsPolicy_Call{Call: _e.mock.On("GetAzureImageTermsPolicy", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_GetAzureImageTermsPolicy_Call) Run(run func(params *operations.GetAzureImageTermsPolicyParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_GetAzureImageTermsPolicy_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.GetAzureImageTermsPolicyParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_GetAzureImageTermsPolicy_Call) Return(_a0 *operations.GetAzureImageTermsPolicyOK, _a1 error) *MockEnvironmentClientService_GetAzureImageTermsPolicy_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_GetAzureImageTermsPolicy_Call) RunAndReturn(run func(*operations.GetAzureImageTermsPolicyParams, ...operations.ClientOption) (*operations.GetAzureImageTermsPolicyOK, error)) *MockEnvironmentClientService_GetAzureImageTermsPolicy_Call { + _c.Call.Return(run) + return _c +} + // GetCredentialPrerequisites provides a mock function with given fields: params, opts func (_m *MockEnvironmentClientService) GetCredentialPrerequisites(params *operations.GetCredentialPrerequisitesParams, opts ...operations.ClientOption) (*operations.GetCredentialPrerequisitesOK, error) { _va := make([]interface{}, len(opts)) @@ -2229,8 +2436,8 @@ func (_c *MockEnvironmentClientService_GetFreeipaStatus_Call) RunAndReturn(run f return _c } -// GetIDBrokerMappings provides a mock function with given fields: params, opts -func (_m *MockEnvironmentClientService) GetIDBrokerMappings(params *operations.GetIDBrokerMappingsParams, opts ...operations.ClientOption) (*operations.GetIDBrokerMappingsOK, error) { +// GetGovCloudAuditCredentialPrerequisites provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) GetGovCloudAuditCredentialPrerequisites(params *operations.GetGovCloudAuditCredentialPrerequisitesParams, opts ...operations.ClientOption) (*operations.GetGovCloudAuditCredentialPrerequisitesOK, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -2240,20 +2447,20 @@ func (_m *MockEnvironmentClientService) GetIDBrokerMappings(params *operations.G _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *operations.GetIDBrokerMappingsOK + var r0 *operations.GetGovCloudAuditCredentialPrerequisitesOK var r1 error - if rf, ok := ret.Get(0).(func(*operations.GetIDBrokerMappingsParams, ...operations.ClientOption) (*operations.GetIDBrokerMappingsOK, error)); ok { + if rf, ok := ret.Get(0).(func(*operations.GetGovCloudAuditCredentialPrerequisitesParams, ...operations.ClientOption) (*operations.GetGovCloudAuditCredentialPrerequisitesOK, error)); ok { return rf(params, opts...) } - if rf, ok := ret.Get(0).(func(*operations.GetIDBrokerMappingsParams, ...operations.ClientOption) *operations.GetIDBrokerMappingsOK); ok { + if rf, ok := ret.Get(0).(func(*operations.GetGovCloudAuditCredentialPrerequisitesParams, ...operations.ClientOption) *operations.GetGovCloudAuditCredentialPrerequisitesOK); ok { r0 = rf(params, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*operations.GetIDBrokerMappingsOK) + r0 = ret.Get(0).(*operations.GetGovCloudAuditCredentialPrerequisitesOK) } } - if rf, ok := ret.Get(1).(func(*operations.GetIDBrokerMappingsParams, ...operations.ClientOption) error); ok { + if rf, ok := ret.Get(1).(func(*operations.GetGovCloudAuditCredentialPrerequisitesParams, ...operations.ClientOption) error); ok { r1 = rf(params, opts...) } else { r1 = ret.Error(1) @@ -2262,20 +2469,20 @@ func (_m *MockEnvironmentClientService) GetIDBrokerMappings(params *operations.G return r0, r1 } -// MockEnvironmentClientService_GetIDBrokerMappings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIDBrokerMappings' -type MockEnvironmentClientService_GetIDBrokerMappings_Call struct { +// MockEnvironmentClientService_GetGovCloudAuditCredentialPrerequisites_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGovCloudAuditCredentialPrerequisites' +type MockEnvironmentClientService_GetGovCloudAuditCredentialPrerequisites_Call struct { *mock.Call } -// GetIDBrokerMappings is a helper method to define mock.On call -// - params *operations.GetIDBrokerMappingsParams +// GetGovCloudAuditCredentialPrerequisites is a helper method to define mock.On call +// - params *operations.GetGovCloudAuditCredentialPrerequisitesParams // - opts ...operations.ClientOption -func (_e *MockEnvironmentClientService_Expecter) GetIDBrokerMappings(params interface{}, opts ...interface{}) *MockEnvironmentClientService_GetIDBrokerMappings_Call { - return &MockEnvironmentClientService_GetIDBrokerMappings_Call{Call: _e.mock.On("GetIDBrokerMappings", +func (_e *MockEnvironmentClientService_Expecter) GetGovCloudAuditCredentialPrerequisites(params interface{}, opts ...interface{}) *MockEnvironmentClientService_GetGovCloudAuditCredentialPrerequisites_Call { + return &MockEnvironmentClientService_GetGovCloudAuditCredentialPrerequisites_Call{Call: _e.mock.On("GetGovCloudAuditCredentialPrerequisites", append([]interface{}{params}, opts...)...)} } -func (_c *MockEnvironmentClientService_GetIDBrokerMappings_Call) Run(run func(params *operations.GetIDBrokerMappingsParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_GetIDBrokerMappings_Call { +func (_c *MockEnvironmentClientService_GetGovCloudAuditCredentialPrerequisites_Call) Run(run func(params *operations.GetGovCloudAuditCredentialPrerequisitesParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_GetGovCloudAuditCredentialPrerequisites_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]operations.ClientOption, len(args)-1) for i, a := range args[1:] { @@ -2283,23 +2490,23 @@ func (_c *MockEnvironmentClientService_GetIDBrokerMappings_Call) Run(run func(pa variadicArgs[i] = a.(operations.ClientOption) } } - run(args[0].(*operations.GetIDBrokerMappingsParams), variadicArgs...) + run(args[0].(*operations.GetGovCloudAuditCredentialPrerequisitesParams), variadicArgs...) }) return _c } -func (_c *MockEnvironmentClientService_GetIDBrokerMappings_Call) Return(_a0 *operations.GetIDBrokerMappingsOK, _a1 error) *MockEnvironmentClientService_GetIDBrokerMappings_Call { +func (_c *MockEnvironmentClientService_GetGovCloudAuditCredentialPrerequisites_Call) Return(_a0 *operations.GetGovCloudAuditCredentialPrerequisitesOK, _a1 error) *MockEnvironmentClientService_GetGovCloudAuditCredentialPrerequisites_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockEnvironmentClientService_GetIDBrokerMappings_Call) RunAndReturn(run func(*operations.GetIDBrokerMappingsParams, ...operations.ClientOption) (*operations.GetIDBrokerMappingsOK, error)) *MockEnvironmentClientService_GetIDBrokerMappings_Call { +func (_c *MockEnvironmentClientService_GetGovCloudAuditCredentialPrerequisites_Call) RunAndReturn(run func(*operations.GetGovCloudAuditCredentialPrerequisitesParams, ...operations.ClientOption) (*operations.GetGovCloudAuditCredentialPrerequisitesOK, error)) *MockEnvironmentClientService_GetGovCloudAuditCredentialPrerequisites_Call { _c.Call.Return(run) return _c } -// GetIDBrokerMappingsSyncStatus provides a mock function with given fields: params, opts -func (_m *MockEnvironmentClientService) GetIDBrokerMappingsSyncStatus(params *operations.GetIDBrokerMappingsSyncStatusParams, opts ...operations.ClientOption) (*operations.GetIDBrokerMappingsSyncStatusOK, error) { +// GetGovCloudCredentialPrerequisites provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) GetGovCloudCredentialPrerequisites(params *operations.GetGovCloudCredentialPrerequisitesParams, opts ...operations.ClientOption) (*operations.GetGovCloudCredentialPrerequisitesOK, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -2309,20 +2516,20 @@ func (_m *MockEnvironmentClientService) GetIDBrokerMappingsSyncStatus(params *op _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *operations.GetIDBrokerMappingsSyncStatusOK + var r0 *operations.GetGovCloudCredentialPrerequisitesOK var r1 error - if rf, ok := ret.Get(0).(func(*operations.GetIDBrokerMappingsSyncStatusParams, ...operations.ClientOption) (*operations.GetIDBrokerMappingsSyncStatusOK, error)); ok { + if rf, ok := ret.Get(0).(func(*operations.GetGovCloudCredentialPrerequisitesParams, ...operations.ClientOption) (*operations.GetGovCloudCredentialPrerequisitesOK, error)); ok { return rf(params, opts...) } - if rf, ok := ret.Get(0).(func(*operations.GetIDBrokerMappingsSyncStatusParams, ...operations.ClientOption) *operations.GetIDBrokerMappingsSyncStatusOK); ok { + if rf, ok := ret.Get(0).(func(*operations.GetGovCloudCredentialPrerequisitesParams, ...operations.ClientOption) *operations.GetGovCloudCredentialPrerequisitesOK); ok { r0 = rf(params, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*operations.GetIDBrokerMappingsSyncStatusOK) + r0 = ret.Get(0).(*operations.GetGovCloudCredentialPrerequisitesOK) } } - if rf, ok := ret.Get(1).(func(*operations.GetIDBrokerMappingsSyncStatusParams, ...operations.ClientOption) error); ok { + if rf, ok := ret.Get(1).(func(*operations.GetGovCloudCredentialPrerequisitesParams, ...operations.ClientOption) error); ok { r1 = rf(params, opts...) } else { r1 = ret.Error(1) @@ -2331,20 +2538,20 @@ func (_m *MockEnvironmentClientService) GetIDBrokerMappingsSyncStatus(params *op return r0, r1 } -// MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIDBrokerMappingsSyncStatus' -type MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call struct { +// MockEnvironmentClientService_GetGovCloudCredentialPrerequisites_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGovCloudCredentialPrerequisites' +type MockEnvironmentClientService_GetGovCloudCredentialPrerequisites_Call struct { *mock.Call } -// GetIDBrokerMappingsSyncStatus is a helper method to define mock.On call -// - params *operations.GetIDBrokerMappingsSyncStatusParams +// GetGovCloudCredentialPrerequisites is a helper method to define mock.On call +// - params *operations.GetGovCloudCredentialPrerequisitesParams // - opts ...operations.ClientOption -func (_e *MockEnvironmentClientService_Expecter) GetIDBrokerMappingsSyncStatus(params interface{}, opts ...interface{}) *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call { - return &MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call{Call: _e.mock.On("GetIDBrokerMappingsSyncStatus", +func (_e *MockEnvironmentClientService_Expecter) GetGovCloudCredentialPrerequisites(params interface{}, opts ...interface{}) *MockEnvironmentClientService_GetGovCloudCredentialPrerequisites_Call { + return &MockEnvironmentClientService_GetGovCloudCredentialPrerequisites_Call{Call: _e.mock.On("GetGovCloudCredentialPrerequisites", append([]interface{}{params}, opts...)...)} } -func (_c *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call) Run(run func(params *operations.GetIDBrokerMappingsSyncStatusParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call { +func (_c *MockEnvironmentClientService_GetGovCloudCredentialPrerequisites_Call) Run(run func(params *operations.GetGovCloudCredentialPrerequisitesParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_GetGovCloudCredentialPrerequisites_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]operations.ClientOption, len(args)-1) for i, a := range args[1:] { @@ -2352,23 +2559,23 @@ func (_c *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call) Run(r variadicArgs[i] = a.(operations.ClientOption) } } - run(args[0].(*operations.GetIDBrokerMappingsSyncStatusParams), variadicArgs...) + run(args[0].(*operations.GetGovCloudCredentialPrerequisitesParams), variadicArgs...) }) return _c } -func (_c *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call) Return(_a0 *operations.GetIDBrokerMappingsSyncStatusOK, _a1 error) *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call { +func (_c *MockEnvironmentClientService_GetGovCloudCredentialPrerequisites_Call) Return(_a0 *operations.GetGovCloudCredentialPrerequisitesOK, _a1 error) *MockEnvironmentClientService_GetGovCloudCredentialPrerequisites_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call) RunAndReturn(run func(*operations.GetIDBrokerMappingsSyncStatusParams, ...operations.ClientOption) (*operations.GetIDBrokerMappingsSyncStatusOK, error)) *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call { +func (_c *MockEnvironmentClientService_GetGovCloudCredentialPrerequisites_Call) RunAndReturn(run func(*operations.GetGovCloudCredentialPrerequisitesParams, ...operations.ClientOption) (*operations.GetGovCloudCredentialPrerequisitesOK, error)) *MockEnvironmentClientService_GetGovCloudCredentialPrerequisites_Call { _c.Call.Return(run) return _c } -// GetKeytab provides a mock function with given fields: params, opts -func (_m *MockEnvironmentClientService) GetKeytab(params *operations.GetKeytabParams, opts ...operations.ClientOption) (*operations.GetKeytabOK, error) { +// GetIDBrokerMappings provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) GetIDBrokerMappings(params *operations.GetIDBrokerMappingsParams, opts ...operations.ClientOption) (*operations.GetIDBrokerMappingsOK, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -2378,20 +2585,20 @@ func (_m *MockEnvironmentClientService) GetKeytab(params *operations.GetKeytabPa _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *operations.GetKeytabOK + var r0 *operations.GetIDBrokerMappingsOK var r1 error - if rf, ok := ret.Get(0).(func(*operations.GetKeytabParams, ...operations.ClientOption) (*operations.GetKeytabOK, error)); ok { + if rf, ok := ret.Get(0).(func(*operations.GetIDBrokerMappingsParams, ...operations.ClientOption) (*operations.GetIDBrokerMappingsOK, error)); ok { return rf(params, opts...) } - if rf, ok := ret.Get(0).(func(*operations.GetKeytabParams, ...operations.ClientOption) *operations.GetKeytabOK); ok { + if rf, ok := ret.Get(0).(func(*operations.GetIDBrokerMappingsParams, ...operations.ClientOption) *operations.GetIDBrokerMappingsOK); ok { r0 = rf(params, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*operations.GetKeytabOK) + r0 = ret.Get(0).(*operations.GetIDBrokerMappingsOK) } } - if rf, ok := ret.Get(1).(func(*operations.GetKeytabParams, ...operations.ClientOption) error); ok { + if rf, ok := ret.Get(1).(func(*operations.GetIDBrokerMappingsParams, ...operations.ClientOption) error); ok { r1 = rf(params, opts...) } else { r1 = ret.Error(1) @@ -2400,20 +2607,20 @@ func (_m *MockEnvironmentClientService) GetKeytab(params *operations.GetKeytabPa return r0, r1 } -// MockEnvironmentClientService_GetKeytab_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetKeytab' -type MockEnvironmentClientService_GetKeytab_Call struct { +// MockEnvironmentClientService_GetIDBrokerMappings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIDBrokerMappings' +type MockEnvironmentClientService_GetIDBrokerMappings_Call struct { *mock.Call } -// GetKeytab is a helper method to define mock.On call -// - params *operations.GetKeytabParams +// GetIDBrokerMappings is a helper method to define mock.On call +// - params *operations.GetIDBrokerMappingsParams // - opts ...operations.ClientOption -func (_e *MockEnvironmentClientService_Expecter) GetKeytab(params interface{}, opts ...interface{}) *MockEnvironmentClientService_GetKeytab_Call { - return &MockEnvironmentClientService_GetKeytab_Call{Call: _e.mock.On("GetKeytab", +func (_e *MockEnvironmentClientService_Expecter) GetIDBrokerMappings(params interface{}, opts ...interface{}) *MockEnvironmentClientService_GetIDBrokerMappings_Call { + return &MockEnvironmentClientService_GetIDBrokerMappings_Call{Call: _e.mock.On("GetIDBrokerMappings", append([]interface{}{params}, opts...)...)} } -func (_c *MockEnvironmentClientService_GetKeytab_Call) Run(run func(params *operations.GetKeytabParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_GetKeytab_Call { +func (_c *MockEnvironmentClientService_GetIDBrokerMappings_Call) Run(run func(params *operations.GetIDBrokerMappingsParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_GetIDBrokerMappings_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]operations.ClientOption, len(args)-1) for i, a := range args[1:] { @@ -2421,23 +2628,23 @@ func (_c *MockEnvironmentClientService_GetKeytab_Call) Run(run func(params *oper variadicArgs[i] = a.(operations.ClientOption) } } - run(args[0].(*operations.GetKeytabParams), variadicArgs...) + run(args[0].(*operations.GetIDBrokerMappingsParams), variadicArgs...) }) return _c } -func (_c *MockEnvironmentClientService_GetKeytab_Call) Return(_a0 *operations.GetKeytabOK, _a1 error) *MockEnvironmentClientService_GetKeytab_Call { +func (_c *MockEnvironmentClientService_GetIDBrokerMappings_Call) Return(_a0 *operations.GetIDBrokerMappingsOK, _a1 error) *MockEnvironmentClientService_GetIDBrokerMappings_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockEnvironmentClientService_GetKeytab_Call) RunAndReturn(run func(*operations.GetKeytabParams, ...operations.ClientOption) (*operations.GetKeytabOK, error)) *MockEnvironmentClientService_GetKeytab_Call { +func (_c *MockEnvironmentClientService_GetIDBrokerMappings_Call) RunAndReturn(run func(*operations.GetIDBrokerMappingsParams, ...operations.ClientOption) (*operations.GetIDBrokerMappingsOK, error)) *MockEnvironmentClientService_GetIDBrokerMappings_Call { _c.Call.Return(run) return _c } -// GetRepairFreeipaStatus provides a mock function with given fields: params, opts -func (_m *MockEnvironmentClientService) GetRepairFreeipaStatus(params *operations.GetRepairFreeipaStatusParams, opts ...operations.ClientOption) (*operations.GetRepairFreeipaStatusOK, error) { +// GetIDBrokerMappingsSyncStatus provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) GetIDBrokerMappingsSyncStatus(params *operations.GetIDBrokerMappingsSyncStatusParams, opts ...operations.ClientOption) (*operations.GetIDBrokerMappingsSyncStatusOK, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -2447,20 +2654,20 @@ func (_m *MockEnvironmentClientService) GetRepairFreeipaStatus(params *operation _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *operations.GetRepairFreeipaStatusOK + var r0 *operations.GetIDBrokerMappingsSyncStatusOK var r1 error - if rf, ok := ret.Get(0).(func(*operations.GetRepairFreeipaStatusParams, ...operations.ClientOption) (*operations.GetRepairFreeipaStatusOK, error)); ok { + if rf, ok := ret.Get(0).(func(*operations.GetIDBrokerMappingsSyncStatusParams, ...operations.ClientOption) (*operations.GetIDBrokerMappingsSyncStatusOK, error)); ok { return rf(params, opts...) } - if rf, ok := ret.Get(0).(func(*operations.GetRepairFreeipaStatusParams, ...operations.ClientOption) *operations.GetRepairFreeipaStatusOK); ok { + if rf, ok := ret.Get(0).(func(*operations.GetIDBrokerMappingsSyncStatusParams, ...operations.ClientOption) *operations.GetIDBrokerMappingsSyncStatusOK); ok { r0 = rf(params, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*operations.GetRepairFreeipaStatusOK) + r0 = ret.Get(0).(*operations.GetIDBrokerMappingsSyncStatusOK) } } - if rf, ok := ret.Get(1).(func(*operations.GetRepairFreeipaStatusParams, ...operations.ClientOption) error); ok { + if rf, ok := ret.Get(1).(func(*operations.GetIDBrokerMappingsSyncStatusParams, ...operations.ClientOption) error); ok { r1 = rf(params, opts...) } else { r1 = ret.Error(1) @@ -2469,20 +2676,20 @@ func (_m *MockEnvironmentClientService) GetRepairFreeipaStatus(params *operation return r0, r1 } -// MockEnvironmentClientService_GetRepairFreeipaStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepairFreeipaStatus' -type MockEnvironmentClientService_GetRepairFreeipaStatus_Call struct { +// MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIDBrokerMappingsSyncStatus' +type MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call struct { *mock.Call } -// GetRepairFreeipaStatus is a helper method to define mock.On call -// - params *operations.GetRepairFreeipaStatusParams +// GetIDBrokerMappingsSyncStatus is a helper method to define mock.On call +// - params *operations.GetIDBrokerMappingsSyncStatusParams // - opts ...operations.ClientOption -func (_e *MockEnvironmentClientService_Expecter) GetRepairFreeipaStatus(params interface{}, opts ...interface{}) *MockEnvironmentClientService_GetRepairFreeipaStatus_Call { - return &MockEnvironmentClientService_GetRepairFreeipaStatus_Call{Call: _e.mock.On("GetRepairFreeipaStatus", +func (_e *MockEnvironmentClientService_Expecter) GetIDBrokerMappingsSyncStatus(params interface{}, opts ...interface{}) *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call { + return &MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call{Call: _e.mock.On("GetIDBrokerMappingsSyncStatus", append([]interface{}{params}, opts...)...)} } -func (_c *MockEnvironmentClientService_GetRepairFreeipaStatus_Call) Run(run func(params *operations.GetRepairFreeipaStatusParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_GetRepairFreeipaStatus_Call { +func (_c *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call) Run(run func(params *operations.GetIDBrokerMappingsSyncStatusParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]operations.ClientOption, len(args)-1) for i, a := range args[1:] { @@ -2490,12 +2697,219 @@ func (_c *MockEnvironmentClientService_GetRepairFreeipaStatus_Call) Run(run func variadicArgs[i] = a.(operations.ClientOption) } } - run(args[0].(*operations.GetRepairFreeipaStatusParams), variadicArgs...) + run(args[0].(*operations.GetIDBrokerMappingsSyncStatusParams), variadicArgs...) }) return _c } -func (_c *MockEnvironmentClientService_GetRepairFreeipaStatus_Call) Return(_a0 *operations.GetRepairFreeipaStatusOK, _a1 error) *MockEnvironmentClientService_GetRepairFreeipaStatus_Call { +func (_c *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call) Return(_a0 *operations.GetIDBrokerMappingsSyncStatusOK, _a1 error) *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call) RunAndReturn(run func(*operations.GetIDBrokerMappingsSyncStatusParams, ...operations.ClientOption) (*operations.GetIDBrokerMappingsSyncStatusOK, error)) *MockEnvironmentClientService_GetIDBrokerMappingsSyncStatus_Call { + _c.Call.Return(run) + return _c +} + +// GetKeytab provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) GetKeytab(params *operations.GetKeytabParams, opts ...operations.ClientOption) (*operations.GetKeytabOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.GetKeytabOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.GetKeytabParams, ...operations.ClientOption) (*operations.GetKeytabOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.GetKeytabParams, ...operations.ClientOption) *operations.GetKeytabOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.GetKeytabOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.GetKeytabParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_GetKeytab_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetKeytab' +type MockEnvironmentClientService_GetKeytab_Call struct { + *mock.Call +} + +// GetKeytab is a helper method to define mock.On call +// - params *operations.GetKeytabParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) GetKeytab(params interface{}, opts ...interface{}) *MockEnvironmentClientService_GetKeytab_Call { + return &MockEnvironmentClientService_GetKeytab_Call{Call: _e.mock.On("GetKeytab", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_GetKeytab_Call) Run(run func(params *operations.GetKeytabParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_GetKeytab_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.GetKeytabParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_GetKeytab_Call) Return(_a0 *operations.GetKeytabOK, _a1 error) *MockEnvironmentClientService_GetKeytab_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_GetKeytab_Call) RunAndReturn(run func(*operations.GetKeytabParams, ...operations.ClientOption) (*operations.GetKeytabOK, error)) *MockEnvironmentClientService_GetKeytab_Call { + _c.Call.Return(run) + return _c +} + +// GetOperation provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) GetOperation(params *operations.GetOperationParams, opts ...operations.ClientOption) (*operations.GetOperationOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.GetOperationOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.GetOperationParams, ...operations.ClientOption) (*operations.GetOperationOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.GetOperationParams, ...operations.ClientOption) *operations.GetOperationOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.GetOperationOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.GetOperationParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_GetOperation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOperation' +type MockEnvironmentClientService_GetOperation_Call struct { + *mock.Call +} + +// GetOperation is a helper method to define mock.On call +// - params *operations.GetOperationParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) GetOperation(params interface{}, opts ...interface{}) *MockEnvironmentClientService_GetOperation_Call { + return &MockEnvironmentClientService_GetOperation_Call{Call: _e.mock.On("GetOperation", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_GetOperation_Call) Run(run func(params *operations.GetOperationParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_GetOperation_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.GetOperationParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_GetOperation_Call) Return(_a0 *operations.GetOperationOK, _a1 error) *MockEnvironmentClientService_GetOperation_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_GetOperation_Call) RunAndReturn(run func(*operations.GetOperationParams, ...operations.ClientOption) (*operations.GetOperationOK, error)) *MockEnvironmentClientService_GetOperation_Call { + _c.Call.Return(run) + return _c +} + +// GetRepairFreeipaStatus provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) GetRepairFreeipaStatus(params *operations.GetRepairFreeipaStatusParams, opts ...operations.ClientOption) (*operations.GetRepairFreeipaStatusOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.GetRepairFreeipaStatusOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.GetRepairFreeipaStatusParams, ...operations.ClientOption) (*operations.GetRepairFreeipaStatusOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.GetRepairFreeipaStatusParams, ...operations.ClientOption) *operations.GetRepairFreeipaStatusOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.GetRepairFreeipaStatusOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.GetRepairFreeipaStatusParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_GetRepairFreeipaStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepairFreeipaStatus' +type MockEnvironmentClientService_GetRepairFreeipaStatus_Call struct { + *mock.Call +} + +// GetRepairFreeipaStatus is a helper method to define mock.On call +// - params *operations.GetRepairFreeipaStatusParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) GetRepairFreeipaStatus(params interface{}, opts ...interface{}) *MockEnvironmentClientService_GetRepairFreeipaStatus_Call { + return &MockEnvironmentClientService_GetRepairFreeipaStatus_Call{Call: _e.mock.On("GetRepairFreeipaStatus", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_GetRepairFreeipaStatus_Call) Run(run func(params *operations.GetRepairFreeipaStatusParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_GetRepairFreeipaStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.GetRepairFreeipaStatusParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_GetRepairFreeipaStatus_Call) Return(_a0 *operations.GetRepairFreeipaStatusOK, _a1 error) *MockEnvironmentClientService_GetRepairFreeipaStatus_Call { _c.Call.Return(_a0, _a1) return _c } @@ -2643,6 +3057,75 @@ func (_c *MockEnvironmentClientService_ListAuditCredentials_Call) RunAndReturn(r return _c } +// ListConnectedDataServices provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) ListConnectedDataServices(params *operations.ListConnectedDataServicesParams, opts ...operations.ClientOption) (*operations.ListConnectedDataServicesOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.ListConnectedDataServicesOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.ListConnectedDataServicesParams, ...operations.ClientOption) (*operations.ListConnectedDataServicesOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.ListConnectedDataServicesParams, ...operations.ClientOption) *operations.ListConnectedDataServicesOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.ListConnectedDataServicesOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.ListConnectedDataServicesParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_ListConnectedDataServices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListConnectedDataServices' +type MockEnvironmentClientService_ListConnectedDataServices_Call struct { + *mock.Call +} + +// ListConnectedDataServices is a helper method to define mock.On call +// - params *operations.ListConnectedDataServicesParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) ListConnectedDataServices(params interface{}, opts ...interface{}) *MockEnvironmentClientService_ListConnectedDataServices_Call { + return &MockEnvironmentClientService_ListConnectedDataServices_Call{Call: _e.mock.On("ListConnectedDataServices", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_ListConnectedDataServices_Call) Run(run func(params *operations.ListConnectedDataServicesParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_ListConnectedDataServices_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.ListConnectedDataServicesParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_ListConnectedDataServices_Call) Return(_a0 *operations.ListConnectedDataServicesOK, _a1 error) *MockEnvironmentClientService_ListConnectedDataServices_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_ListConnectedDataServices_Call) RunAndReturn(run func(*operations.ListConnectedDataServicesParams, ...operations.ClientOption) (*operations.ListConnectedDataServicesOK, error)) *MockEnvironmentClientService_ListConnectedDataServices_Call { + _c.Call.Return(run) + return _c +} + // ListCredentials provides a mock function with given fields: params, opts func (_m *MockEnvironmentClientService) ListCredentials(params *operations.ListCredentialsParams, opts ...operations.ClientOption) (*operations.ListCredentialsOK, error) { _va := make([]interface{}, len(opts)) @@ -3195,8 +3678,8 @@ func (_c *MockEnvironmentClientService_SetAWSAuditCredential_Call) RunAndReturn( return _c } -// SetAccountTelemetry provides a mock function with given fields: params, opts -func (_m *MockEnvironmentClientService) SetAccountTelemetry(params *operations.SetAccountTelemetryParams, opts ...operations.ClientOption) (*operations.SetAccountTelemetryOK, error) { +// SetAWSGovCloudAuditCredential provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) SetAWSGovCloudAuditCredential(params *operations.SetAWSGovCloudAuditCredentialParams, opts ...operations.ClientOption) (*operations.SetAWSGovCloudAuditCredentialOK, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -3206,20 +3689,20 @@ func (_m *MockEnvironmentClientService) SetAccountTelemetry(params *operations.S _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *operations.SetAccountTelemetryOK + var r0 *operations.SetAWSGovCloudAuditCredentialOK var r1 error - if rf, ok := ret.Get(0).(func(*operations.SetAccountTelemetryParams, ...operations.ClientOption) (*operations.SetAccountTelemetryOK, error)); ok { + if rf, ok := ret.Get(0).(func(*operations.SetAWSGovCloudAuditCredentialParams, ...operations.ClientOption) (*operations.SetAWSGovCloudAuditCredentialOK, error)); ok { return rf(params, opts...) } - if rf, ok := ret.Get(0).(func(*operations.SetAccountTelemetryParams, ...operations.ClientOption) *operations.SetAccountTelemetryOK); ok { + if rf, ok := ret.Get(0).(func(*operations.SetAWSGovCloudAuditCredentialParams, ...operations.ClientOption) *operations.SetAWSGovCloudAuditCredentialOK); ok { r0 = rf(params, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*operations.SetAccountTelemetryOK) + r0 = ret.Get(0).(*operations.SetAWSGovCloudAuditCredentialOK) } } - if rf, ok := ret.Get(1).(func(*operations.SetAccountTelemetryParams, ...operations.ClientOption) error); ok { + if rf, ok := ret.Get(1).(func(*operations.SetAWSGovCloudAuditCredentialParams, ...operations.ClientOption) error); ok { r1 = rf(params, opts...) } else { r1 = ret.Error(1) @@ -3228,20 +3711,89 @@ func (_m *MockEnvironmentClientService) SetAccountTelemetry(params *operations.S return r0, r1 } -// MockEnvironmentClientService_SetAccountTelemetry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAccountTelemetry' -type MockEnvironmentClientService_SetAccountTelemetry_Call struct { +// MockEnvironmentClientService_SetAWSGovCloudAuditCredential_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAWSGovCloudAuditCredential' +type MockEnvironmentClientService_SetAWSGovCloudAuditCredential_Call struct { *mock.Call } -// SetAccountTelemetry is a helper method to define mock.On call -// - params *operations.SetAccountTelemetryParams +// SetAWSGovCloudAuditCredential is a helper method to define mock.On call +// - params *operations.SetAWSGovCloudAuditCredentialParams // - opts ...operations.ClientOption -func (_e *MockEnvironmentClientService_Expecter) SetAccountTelemetry(params interface{}, opts ...interface{}) *MockEnvironmentClientService_SetAccountTelemetry_Call { - return &MockEnvironmentClientService_SetAccountTelemetry_Call{Call: _e.mock.On("SetAccountTelemetry", +func (_e *MockEnvironmentClientService_Expecter) SetAWSGovCloudAuditCredential(params interface{}, opts ...interface{}) *MockEnvironmentClientService_SetAWSGovCloudAuditCredential_Call { + return &MockEnvironmentClientService_SetAWSGovCloudAuditCredential_Call{Call: _e.mock.On("SetAWSGovCloudAuditCredential", append([]interface{}{params}, opts...)...)} } -func (_c *MockEnvironmentClientService_SetAccountTelemetry_Call) Run(run func(params *operations.SetAccountTelemetryParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_SetAccountTelemetry_Call { +func (_c *MockEnvironmentClientService_SetAWSGovCloudAuditCredential_Call) Run(run func(params *operations.SetAWSGovCloudAuditCredentialParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_SetAWSGovCloudAuditCredential_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.SetAWSGovCloudAuditCredentialParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_SetAWSGovCloudAuditCredential_Call) Return(_a0 *operations.SetAWSGovCloudAuditCredentialOK, _a1 error) *MockEnvironmentClientService_SetAWSGovCloudAuditCredential_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_SetAWSGovCloudAuditCredential_Call) RunAndReturn(run func(*operations.SetAWSGovCloudAuditCredentialParams, ...operations.ClientOption) (*operations.SetAWSGovCloudAuditCredentialOK, error)) *MockEnvironmentClientService_SetAWSGovCloudAuditCredential_Call { + _c.Call.Return(run) + return _c +} + +// SetAccountTelemetry provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) SetAccountTelemetry(params *operations.SetAccountTelemetryParams, opts ...operations.ClientOption) (*operations.SetAccountTelemetryOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.SetAccountTelemetryOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.SetAccountTelemetryParams, ...operations.ClientOption) (*operations.SetAccountTelemetryOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.SetAccountTelemetryParams, ...operations.ClientOption) *operations.SetAccountTelemetryOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.SetAccountTelemetryOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.SetAccountTelemetryParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_SetAccountTelemetry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAccountTelemetry' +type MockEnvironmentClientService_SetAccountTelemetry_Call struct { + *mock.Call +} + +// SetAccountTelemetry is a helper method to define mock.On call +// - params *operations.SetAccountTelemetryParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) SetAccountTelemetry(params interface{}, opts ...interface{}) *MockEnvironmentClientService_SetAccountTelemetry_Call { + return &MockEnvironmentClientService_SetAccountTelemetry_Call{Call: _e.mock.On("SetAccountTelemetry", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_SetAccountTelemetry_Call) Run(run func(params *operations.SetAccountTelemetryParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_SetAccountTelemetry_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]operations.ClientOption, len(args)-1) for i, a := range args[1:] { @@ -3540,6 +4092,75 @@ func (_c *MockEnvironmentClientService_SetEnvironmentSetting_Call) RunAndReturn( return _c } +// SetGCPAuditCredential provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) SetGCPAuditCredential(params *operations.SetGCPAuditCredentialParams, opts ...operations.ClientOption) (*operations.SetGCPAuditCredentialOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.SetGCPAuditCredentialOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.SetGCPAuditCredentialParams, ...operations.ClientOption) (*operations.SetGCPAuditCredentialOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.SetGCPAuditCredentialParams, ...operations.ClientOption) *operations.SetGCPAuditCredentialOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.SetGCPAuditCredentialOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.SetGCPAuditCredentialParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_SetGCPAuditCredential_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGCPAuditCredential' +type MockEnvironmentClientService_SetGCPAuditCredential_Call struct { + *mock.Call +} + +// SetGCPAuditCredential is a helper method to define mock.On call +// - params *operations.SetGCPAuditCredentialParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) SetGCPAuditCredential(params interface{}, opts ...interface{}) *MockEnvironmentClientService_SetGCPAuditCredential_Call { + return &MockEnvironmentClientService_SetGCPAuditCredential_Call{Call: _e.mock.On("SetGCPAuditCredential", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_SetGCPAuditCredential_Call) Run(run func(params *operations.SetGCPAuditCredentialParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_SetGCPAuditCredential_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.SetGCPAuditCredentialParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_SetGCPAuditCredential_Call) Return(_a0 *operations.SetGCPAuditCredentialOK, _a1 error) *MockEnvironmentClientService_SetGCPAuditCredential_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_SetGCPAuditCredential_Call) RunAndReturn(run func(*operations.SetGCPAuditCredentialParams, ...operations.ClientOption) (*operations.SetGCPAuditCredentialOK, error)) *MockEnvironmentClientService_SetGCPAuditCredential_Call { + _c.Call.Return(run) + return _c +} + // SetIDBrokerMappings provides a mock function with given fields: params, opts func (_m *MockEnvironmentClientService) SetIDBrokerMappings(params *operations.SetIDBrokerMappingsParams, opts ...operations.ClientOption) (*operations.SetIDBrokerMappingsOK, error) { _va := make([]interface{}, len(opts)) @@ -4539,6 +5160,75 @@ func (_c *MockEnvironmentClientService_UpdateAzureCredential_Call) RunAndReturn( return _c } +// UpdateAzureDatabaseResources provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) UpdateAzureDatabaseResources(params *operations.UpdateAzureDatabaseResourcesParams, opts ...operations.ClientOption) (*operations.UpdateAzureDatabaseResourcesOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.UpdateAzureDatabaseResourcesOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.UpdateAzureDatabaseResourcesParams, ...operations.ClientOption) (*operations.UpdateAzureDatabaseResourcesOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.UpdateAzureDatabaseResourcesParams, ...operations.ClientOption) *operations.UpdateAzureDatabaseResourcesOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.UpdateAzureDatabaseResourcesOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.UpdateAzureDatabaseResourcesParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_UpdateAzureDatabaseResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAzureDatabaseResources' +type MockEnvironmentClientService_UpdateAzureDatabaseResources_Call struct { + *mock.Call +} + +// UpdateAzureDatabaseResources is a helper method to define mock.On call +// - params *operations.UpdateAzureDatabaseResourcesParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) UpdateAzureDatabaseResources(params interface{}, opts ...interface{}) *MockEnvironmentClientService_UpdateAzureDatabaseResources_Call { + return &MockEnvironmentClientService_UpdateAzureDatabaseResources_Call{Call: _e.mock.On("UpdateAzureDatabaseResources", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_UpdateAzureDatabaseResources_Call) Run(run func(params *operations.UpdateAzureDatabaseResourcesParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_UpdateAzureDatabaseResources_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.UpdateAzureDatabaseResourcesParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_UpdateAzureDatabaseResources_Call) Return(_a0 *operations.UpdateAzureDatabaseResourcesOK, _a1 error) *MockEnvironmentClientService_UpdateAzureDatabaseResources_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_UpdateAzureDatabaseResources_Call) RunAndReturn(run func(*operations.UpdateAzureDatabaseResourcesParams, ...operations.ClientOption) (*operations.UpdateAzureDatabaseResourcesOK, error)) *MockEnvironmentClientService_UpdateAzureDatabaseResources_Call { + _c.Call.Return(run) + return _c +} + // UpdateAzureEncryptionResources provides a mock function with given fields: params, opts func (_m *MockEnvironmentClientService) UpdateAzureEncryptionResources(params *operations.UpdateAzureEncryptionResourcesParams, opts ...operations.ClientOption) (*operations.UpdateAzureEncryptionResourcesOK, error) { _va := make([]interface{}, len(opts)) @@ -4608,6 +5298,144 @@ func (_c *MockEnvironmentClientService_UpdateAzureEncryptionResources_Call) RunA return _c } +// UpdateAzureImageTermsPolicy provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) UpdateAzureImageTermsPolicy(params *operations.UpdateAzureImageTermsPolicyParams, opts ...operations.ClientOption) (*operations.UpdateAzureImageTermsPolicyOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.UpdateAzureImageTermsPolicyOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.UpdateAzureImageTermsPolicyParams, ...operations.ClientOption) (*operations.UpdateAzureImageTermsPolicyOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.UpdateAzureImageTermsPolicyParams, ...operations.ClientOption) *operations.UpdateAzureImageTermsPolicyOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.UpdateAzureImageTermsPolicyOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.UpdateAzureImageTermsPolicyParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_UpdateAzureImageTermsPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAzureImageTermsPolicy' +type MockEnvironmentClientService_UpdateAzureImageTermsPolicy_Call struct { + *mock.Call +} + +// UpdateAzureImageTermsPolicy is a helper method to define mock.On call +// - params *operations.UpdateAzureImageTermsPolicyParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) UpdateAzureImageTermsPolicy(params interface{}, opts ...interface{}) *MockEnvironmentClientService_UpdateAzureImageTermsPolicy_Call { + return &MockEnvironmentClientService_UpdateAzureImageTermsPolicy_Call{Call: _e.mock.On("UpdateAzureImageTermsPolicy", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_UpdateAzureImageTermsPolicy_Call) Run(run func(params *operations.UpdateAzureImageTermsPolicyParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_UpdateAzureImageTermsPolicy_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.UpdateAzureImageTermsPolicyParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_UpdateAzureImageTermsPolicy_Call) Return(_a0 *operations.UpdateAzureImageTermsPolicyOK, _a1 error) *MockEnvironmentClientService_UpdateAzureImageTermsPolicy_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_UpdateAzureImageTermsPolicy_Call) RunAndReturn(run func(*operations.UpdateAzureImageTermsPolicyParams, ...operations.ClientOption) (*operations.UpdateAzureImageTermsPolicyOK, error)) *MockEnvironmentClientService_UpdateAzureImageTermsPolicy_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataServiceResources provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) UpdateDataServiceResources(params *operations.UpdateDataServiceResourcesParams, opts ...operations.ClientOption) (*operations.UpdateDataServiceResourcesOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.UpdateDataServiceResourcesOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.UpdateDataServiceResourcesParams, ...operations.ClientOption) (*operations.UpdateDataServiceResourcesOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.UpdateDataServiceResourcesParams, ...operations.ClientOption) *operations.UpdateDataServiceResourcesOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.UpdateDataServiceResourcesOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.UpdateDataServiceResourcesParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_UpdateDataServiceResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataServiceResources' +type MockEnvironmentClientService_UpdateDataServiceResources_Call struct { + *mock.Call +} + +// UpdateDataServiceResources is a helper method to define mock.On call +// - params *operations.UpdateDataServiceResourcesParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) UpdateDataServiceResources(params interface{}, opts ...interface{}) *MockEnvironmentClientService_UpdateDataServiceResources_Call { + return &MockEnvironmentClientService_UpdateDataServiceResources_Call{Call: _e.mock.On("UpdateDataServiceResources", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_UpdateDataServiceResources_Call) Run(run func(params *operations.UpdateDataServiceResourcesParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_UpdateDataServiceResources_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.UpdateDataServiceResourcesParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_UpdateDataServiceResources_Call) Return(_a0 *operations.UpdateDataServiceResourcesOK, _a1 error) *MockEnvironmentClientService_UpdateDataServiceResources_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_UpdateDataServiceResources_Call) RunAndReturn(run func(*operations.UpdateDataServiceResourcesParams, ...operations.ClientOption) (*operations.UpdateDataServiceResourcesOK, error)) *MockEnvironmentClientService_UpdateDataServiceResources_Call { + _c.Call.Return(run) + return _c +} + // UpdateOrchestratorState provides a mock function with given fields: params, opts func (_m *MockEnvironmentClientService) UpdateOrchestratorState(params *operations.UpdateOrchestratorStateParams, opts ...operations.ClientOption) (*operations.UpdateOrchestratorStateOK, error) { _va := make([]interface{}, len(opts)) @@ -4746,6 +5574,144 @@ func (_c *MockEnvironmentClientService_UpdateProxyConfig_Call) RunAndReturn(run return _c } +// UpdateSSHKey provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) UpdateSSHKey(params *operations.UpdateSSHKeyParams, opts ...operations.ClientOption) (*operations.UpdateSSHKeyOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.UpdateSSHKeyOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.UpdateSSHKeyParams, ...operations.ClientOption) (*operations.UpdateSSHKeyOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.UpdateSSHKeyParams, ...operations.ClientOption) *operations.UpdateSSHKeyOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.UpdateSSHKeyOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.UpdateSSHKeyParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_UpdateSSHKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSSHKey' +type MockEnvironmentClientService_UpdateSSHKey_Call struct { + *mock.Call +} + +// UpdateSSHKey is a helper method to define mock.On call +// - params *operations.UpdateSSHKeyParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) UpdateSSHKey(params interface{}, opts ...interface{}) *MockEnvironmentClientService_UpdateSSHKey_Call { + return &MockEnvironmentClientService_UpdateSSHKey_Call{Call: _e.mock.On("UpdateSSHKey", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_UpdateSSHKey_Call) Run(run func(params *operations.UpdateSSHKeyParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_UpdateSSHKey_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.UpdateSSHKeyParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_UpdateSSHKey_Call) Return(_a0 *operations.UpdateSSHKeyOK, _a1 error) *MockEnvironmentClientService_UpdateSSHKey_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_UpdateSSHKey_Call) RunAndReturn(run func(*operations.UpdateSSHKeyParams, ...operations.ClientOption) (*operations.UpdateSSHKeyOK, error)) *MockEnvironmentClientService_UpdateSSHKey_Call { + _c.Call.Return(run) + return _c +} + +// UpdateSecurityAccess provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) UpdateSecurityAccess(params *operations.UpdateSecurityAccessParams, opts ...operations.ClientOption) (*operations.UpdateSecurityAccessOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.UpdateSecurityAccessOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.UpdateSecurityAccessParams, ...operations.ClientOption) (*operations.UpdateSecurityAccessOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.UpdateSecurityAccessParams, ...operations.ClientOption) *operations.UpdateSecurityAccessOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.UpdateSecurityAccessOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.UpdateSecurityAccessParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_UpdateSecurityAccess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSecurityAccess' +type MockEnvironmentClientService_UpdateSecurityAccess_Call struct { + *mock.Call +} + +// UpdateSecurityAccess is a helper method to define mock.On call +// - params *operations.UpdateSecurityAccessParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) UpdateSecurityAccess(params interface{}, opts ...interface{}) *MockEnvironmentClientService_UpdateSecurityAccess_Call { + return &MockEnvironmentClientService_UpdateSecurityAccess_Call{Call: _e.mock.On("UpdateSecurityAccess", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_UpdateSecurityAccess_Call) Run(run func(params *operations.UpdateSecurityAccessParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_UpdateSecurityAccess_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.UpdateSecurityAccessParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_UpdateSecurityAccess_Call) Return(_a0 *operations.UpdateSecurityAccessOK, _a1 error) *MockEnvironmentClientService_UpdateSecurityAccess_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_UpdateSecurityAccess_Call) RunAndReturn(run func(*operations.UpdateSecurityAccessParams, ...operations.ClientOption) (*operations.UpdateSecurityAccessOK, error)) *MockEnvironmentClientService_UpdateSecurityAccess_Call { + _c.Call.Return(run) + return _c +} + // UpdateSubnet provides a mock function with given fields: params, opts func (_m *MockEnvironmentClientService) UpdateSubnet(params *operations.UpdateSubnetParams, opts ...operations.ClientOption) (*operations.UpdateSubnetOK, error) { _va := make([]interface{}, len(opts)) @@ -5022,6 +5988,144 @@ func (_c *MockEnvironmentClientService_UpscaleFreeipa_Call) RunAndReturn(run fun return _c } +// ValidateAwsCloudStorage provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) ValidateAwsCloudStorage(params *operations.ValidateAwsCloudStorageParams, opts ...operations.ClientOption) (*operations.ValidateAwsCloudStorageOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.ValidateAwsCloudStorageOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.ValidateAwsCloudStorageParams, ...operations.ClientOption) (*operations.ValidateAwsCloudStorageOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.ValidateAwsCloudStorageParams, ...operations.ClientOption) *operations.ValidateAwsCloudStorageOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.ValidateAwsCloudStorageOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.ValidateAwsCloudStorageParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_ValidateAwsCloudStorage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateAwsCloudStorage' +type MockEnvironmentClientService_ValidateAwsCloudStorage_Call struct { + *mock.Call +} + +// ValidateAwsCloudStorage is a helper method to define mock.On call +// - params *operations.ValidateAwsCloudStorageParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) ValidateAwsCloudStorage(params interface{}, opts ...interface{}) *MockEnvironmentClientService_ValidateAwsCloudStorage_Call { + return &MockEnvironmentClientService_ValidateAwsCloudStorage_Call{Call: _e.mock.On("ValidateAwsCloudStorage", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_ValidateAwsCloudStorage_Call) Run(run func(params *operations.ValidateAwsCloudStorageParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_ValidateAwsCloudStorage_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.ValidateAwsCloudStorageParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_ValidateAwsCloudStorage_Call) Return(_a0 *operations.ValidateAwsCloudStorageOK, _a1 error) *MockEnvironmentClientService_ValidateAwsCloudStorage_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_ValidateAwsCloudStorage_Call) RunAndReturn(run func(*operations.ValidateAwsCloudStorageParams, ...operations.ClientOption) (*operations.ValidateAwsCloudStorageOK, error)) *MockEnvironmentClientService_ValidateAwsCloudStorage_Call { + _c.Call.Return(run) + return _c +} + +// ValidateAzureCloudStorage provides a mock function with given fields: params, opts +func (_m *MockEnvironmentClientService) ValidateAzureCloudStorage(params *operations.ValidateAzureCloudStorageParams, opts ...operations.ClientOption) (*operations.ValidateAzureCloudStorageOK, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *operations.ValidateAzureCloudStorageOK + var r1 error + if rf, ok := ret.Get(0).(func(*operations.ValidateAzureCloudStorageParams, ...operations.ClientOption) (*operations.ValidateAzureCloudStorageOK, error)); ok { + return rf(params, opts...) + } + if rf, ok := ret.Get(0).(func(*operations.ValidateAzureCloudStorageParams, ...operations.ClientOption) *operations.ValidateAzureCloudStorageOK); ok { + r0 = rf(params, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*operations.ValidateAzureCloudStorageOK) + } + } + + if rf, ok := ret.Get(1).(func(*operations.ValidateAzureCloudStorageParams, ...operations.ClientOption) error); ok { + r1 = rf(params, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEnvironmentClientService_ValidateAzureCloudStorage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateAzureCloudStorage' +type MockEnvironmentClientService_ValidateAzureCloudStorage_Call struct { + *mock.Call +} + +// ValidateAzureCloudStorage is a helper method to define mock.On call +// - params *operations.ValidateAzureCloudStorageParams +// - opts ...operations.ClientOption +func (_e *MockEnvironmentClientService_Expecter) ValidateAzureCloudStorage(params interface{}, opts ...interface{}) *MockEnvironmentClientService_ValidateAzureCloudStorage_Call { + return &MockEnvironmentClientService_ValidateAzureCloudStorage_Call{Call: _e.mock.On("ValidateAzureCloudStorage", + append([]interface{}{params}, opts...)...)} +} + +func (_c *MockEnvironmentClientService_ValidateAzureCloudStorage_Call) Run(run func(params *operations.ValidateAzureCloudStorageParams, opts ...operations.ClientOption)) *MockEnvironmentClientService_ValidateAzureCloudStorage_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]operations.ClientOption, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(operations.ClientOption) + } + } + run(args[0].(*operations.ValidateAzureCloudStorageParams), variadicArgs...) + }) + return _c +} + +func (_c *MockEnvironmentClientService_ValidateAzureCloudStorage_Call) Return(_a0 *operations.ValidateAzureCloudStorageOK, _a1 error) *MockEnvironmentClientService_ValidateAzureCloudStorage_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEnvironmentClientService_ValidateAzureCloudStorage_Call) RunAndReturn(run func(*operations.ValidateAzureCloudStorageParams, ...operations.ClientOption) (*operations.ValidateAzureCloudStorageOK, error)) *MockEnvironmentClientService_ValidateAzureCloudStorage_Call { + _c.Call.Return(run) + return _c +} + // NewMockEnvironmentClientService creates a new instance of MockEnvironmentClientService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockEnvironmentClientService(t interface { diff --git a/provider/provider.go b/provider/provider.go index 8133e456..8428d4b3 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -225,6 +225,7 @@ func (p *CdpProvider) Resources(_ context.Context) []func() resource.Resource { environments.NewIDBrokerMappingsResource, environments.NewAzureCredentialResource, environments.NewAzureEnvironmentResource, + environments.NewAzureImageTermsResource, environments.NewGcpEnvironmentResource, environments.NewGcpCredentialResource, environments.NewProxyConfigurationResource, diff --git a/provider/provider_test.go b/provider/provider_test.go index e2523090..52b9501c 100644 --- a/provider/provider_test.go +++ b/provider/provider_test.go @@ -613,6 +613,7 @@ func TestCdpProvider_Resources(t *testing.T) { environments.NewGcpEnvironmentResource, environments.NewGcpCredentialResource, environments.NewProxyConfigurationResource, + environments.NewAzureImageTermsResource, datalake.NewAwsDatalakeResource, datalake.NewAzureDatalakeResource, datalake.NewGcpDatalakeResource, diff --git a/resources/datalake/converter_gcp.go b/resources/datalake/converter_gcp.go index 97ad6822..8ef202b3 100644 --- a/resources/datalake/converter_gcp.go +++ b/resources/datalake/converter_gcp.go @@ -12,6 +12,7 @@ package datalake import ( "context" + "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -73,7 +74,7 @@ func toGcpDatalakeRequest(ctx context.Context, model *gcpDatalakeResourceModel) if model.Image != nil { req.Image = &datalakemodels.ImageRequest{ CatalogName: model.Image.CatalogName.ValueStringPointer(), - ID: model.Image.ID.ValueStringPointer(), + ID: model.Image.ID.ValueString(), } } req.JavaVersion = int32(model.JavaVersion.ValueInt64()) diff --git a/resources/datalake/resource_aws_datalake.go b/resources/datalake/resource_aws_datalake.go index 22a9f491..5421d4cb 100644 --- a/resources/datalake/resource_aws_datalake.go +++ b/resources/datalake/resource_aws_datalake.go @@ -74,7 +74,7 @@ func toAwsDatalakeRequest(ctx context.Context, model *awsDatalakeResourceModel) if model.Image != nil { req.Image = &datalakemodels.ImageRequest{ CatalogName: model.Image.CatalogName.ValueStringPointer(), - ID: model.Image.ID.ValueStringPointer(), + ID: model.Image.ID.ValueString(), } } req.JavaVersion = int32(model.JavaVersion.ValueInt64()) diff --git a/resources/datalake/resource_azure_datalake.go b/resources/datalake/resource_azure_datalake.go index 248ba5db..bfbb2482 100644 --- a/resources/datalake/resource_azure_datalake.go +++ b/resources/datalake/resource_azure_datalake.go @@ -63,7 +63,7 @@ func toAzureDatalakeRequest(ctx context.Context, model *azureDatalakeResourceMod if model.Image != nil { req.Image = &datalakemodels.ImageRequest{ CatalogName: model.Image.CatalogName.ValueStringPointer(), - ID: model.Image.ID.ValueStringPointer(), + ID: model.Image.ID.ValueString(), } } req.JavaVersion = int32(model.JavaVersion.ValueInt64()) diff --git a/resources/environments/converter_gcp.go b/resources/environments/converter_gcp.go index a58f1780..986aca34 100644 --- a/resources/environments/converter_gcp.go +++ b/resources/environments/converter_gcp.go @@ -13,6 +13,7 @@ package environments import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" @@ -25,13 +26,13 @@ func toGcpEnvironmentRequest(ctx context.Context, model *gcpEnvironmentResourceM req := &environmentsmodels.CreateGCPEnvironmentRequest{ CredentialName: model.CredentialName.ValueStringPointer(), Description: model.Description.ValueString(), - EnableTunnel: model.EnableTunnel.ValueBool(), + EnableTunnel: model.EnableTunnel.ValueBoolPointer(), EncryptionKey: model.EncryptionKey.ValueString(), EndpointAccessGatewayScheme: model.EndpointAccessGatewayScheme.ValueString(), EnvironmentName: model.EnvironmentName.ValueStringPointer(), ExistingNetworkParams: &environmentsmodels.ExistingGCPNetworkRequest{ NetworkName: model.ExistingNetworkParams.NetworkName.ValueStringPointer(), - SharedProjectID: model.ExistingNetworkParams.SharedProjectId.ValueStringPointer(), + SharedProjectID: model.ExistingNetworkParams.SharedProjectId.ValueString(), SubnetNames: utils.FromListValueToStringList(model.ExistingNetworkParams.SubnetNames), }, ProxyConfigName: model.ProxyConfigName.ValueString(), diff --git a/resources/environments/converter_gcp_test.go b/resources/environments/converter_gcp_test.go index 30d077ee..8daab0fe 100644 --- a/resources/environments/converter_gcp_test.go +++ b/resources/environments/converter_gcp_test.go @@ -12,12 +12,13 @@ package environments import ( "context" + "testing" + "github.com/go-openapi/strfmt" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "testing" environmentsmodels "github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" "github.com/cloudera/terraform-provider-cdp/utils" @@ -50,7 +51,7 @@ func TestToGcpEnvironmentRequestExistingNetworkParams(t *testing.T) { assert.NotNilf(t, result.ExistingNetworkParams, "ExistingNetworkParams is expected to be not nil") assert.Equal(t, testObject.ExistingNetworkParams.NetworkName.ValueString(), *result.ExistingNetworkParams.NetworkName) - assert.Equal(t, testObject.ExistingNetworkParams.SharedProjectId.ValueString(), *result.ExistingNetworkParams.SharedProjectID) + assert.Equal(t, testObject.ExistingNetworkParams.SharedProjectId.ValueString(), result.ExistingNetworkParams.SharedProjectID) assert.Equal(t, len(testObject.ExistingNetworkParams.SubnetNames.Elements()), len(result.ExistingNetworkParams.SubnetNames)) } diff --git a/resources/environments/resource_azure_image_terms.go b/resources/environments/resource_azure_image_terms.go new file mode 100644 index 00000000..542d36c4 --- /dev/null +++ b/resources/environments/resource_azure_image_terms.go @@ -0,0 +1,163 @@ +// Copyright 2023 Cloudera. All Rights Reserved. +// +// This file is licensed under the Apache License Version 2.0 (the "License"). +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. +// +// This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, either express or implied. Refer to the License for the specific +// permissions and limitations governing your use of the file. + +package environments + +import ( + "context" + + "github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/cdp" + "github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/client/operations" + environmentsmodels "github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" + environments "github.com/cloudera/terraform-provider-cdp/resources" + "github.com/cloudera/terraform-provider-cdp/utils" + "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +var ( + _ resource.Resource = &azureImageTermsResource{} +) + +type azureImageTermsResource struct { + client *cdp.Client +} + +type azureImageTermsResourceModel struct { + ID types.String `tfsdk:"id"` + Accepted types.Bool `tfsdk:"accepted"` +} + +func NewAzureImageTermsResource() resource.Resource { + return &azureImageTermsResource{} +} + +func (r *azureImageTermsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_environments_azure_image_terms" +} + +func (r *azureImageTermsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = environments.AzureImageTermsPolicySchema +} + +func (r *azureImageTermsResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = utils.GetCdpClientForResource(req, resp) +} + +func (r *azureImageTermsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var data azureImageTermsResourceModel + diags := req.Plan.Get(ctx, &data) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + client := r.client.Environments + + params := operations.NewUpdateAzureImageTermsPolicyParamsWithContext(ctx) + params.WithInput(&environmentsmodels.UpdateAzureImageTermsPolicyRequest{ + Accepted: data.Accepted.ValueBoolPointer(), + }) + + _, err := client.Operations.UpdateAzureImageTermsPolicy(params) + if err != nil { + utils.AddEnvironmentDiagnosticsError(err, &resp.Diagnostics, "create Azure Image Terms Policy") + return + } + + data.ID = types.StringValue(uuid.New().String()) + + diags = resp.State.Set(ctx, data) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } +} + +type getAzureImageTermsPolicyRequest struct{} + +func (r *azureImageTermsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + // Get current state + var state azureImageTermsResourceModel + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + params := operations.NewGetAzureImageTermsPolicyParamsWithContext(ctx) + params.WithInput(getAzureImageTermsPolicyRequest{}) + getPolicyResp, err := r.client.Environments.Operations.GetAzureImageTermsPolicy(params) + if err != nil { + utils.AddEnvironmentDiagnosticsError(err, &resp.Diagnostics, "read Azure Image Terms Policy") + return + } + + state.Accepted = types.BoolPointerValue(getPolicyResp.Payload.Accepted) + + diags = resp.State.Set(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } +} + +func (r *azureImageTermsResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var data azureImageTermsResourceModel + diags := req.Plan.Get(ctx, &data) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + client := r.client.Environments + + params := operations.NewUpdateAzureImageTermsPolicyParamsWithContext(ctx) + params.WithInput(&environmentsmodels.UpdateAzureImageTermsPolicyRequest{ + Accepted: data.Accepted.ValueBoolPointer(), + }) + + _, err := client.Operations.UpdateAzureImageTermsPolicy(params) + if err != nil { + utils.AddEnvironmentDiagnosticsError(err, &resp.Diagnostics, "update Azure Image Terms Policy") + return + } + + diags = resp.State.Set(ctx, data) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } +} + +func (r *azureImageTermsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var data azureImageTermsResourceModel + diags := req.State.Get(ctx, &data) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + client := r.client.Environments + + defaultValue := false + + params := operations.NewUpdateAzureImageTermsPolicyParamsWithContext(ctx) + params.WithInput(&environmentsmodels.UpdateAzureImageTermsPolicyRequest{ + Accepted: &defaultValue, + }) + + _, err := client.Operations.UpdateAzureImageTermsPolicy(params) + if err != nil { + utils.AddEnvironmentDiagnosticsError(err, &resp.Diagnostics, "delete Azure Image Terms Policy") + return + } +} diff --git a/resources/environments/resource_azure_image_terms_test.go b/resources/environments/resource_azure_image_terms_test.go new file mode 100644 index 00000000..7c2b93fb --- /dev/null +++ b/resources/environments/resource_azure_image_terms_test.go @@ -0,0 +1,357 @@ +// Copyright 2023 Cloudera. All Rights Reserved. +// +// This file is licensed under the Apache License Version 2.0 (the "License"). +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. +// +// This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, either express or implied. Refer to the License for the specific +// permissions and limitations governing your use of the file. + +package environments + +import ( + "context" + "errors" + "testing" + + "github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/cdp" + "github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/client/operations" + "github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/models" + mocks "github.com/cloudera/terraform-provider-cdp/mocks/github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/environments/client/operations" + environments "github.com/cloudera/terraform-provider-cdp/resources" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-go/tftypes" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +func createRawAzureImageTermsResource(accepted bool) tftypes.Value { + return tftypes.NewValue( + tftypes.Object{ + AttributeTypes: map[string]tftypes.Type{ + "id": tftypes.String, + "accepted": tftypes.Bool, + }, + }, + map[string]tftypes.Value{ + "id": tftypes.NewValue(tftypes.String, ""), + "accepted": tftypes.NewValue(tftypes.Bool, accepted), + }, + ) +} + +func TestCreateAzureImageTerms(t *testing.T) { + testCases := map[string]struct { + expectedResponse interface{} + expectedErrorResponse interface{} + expectedError bool + expectedSummary string + expectedDetail string + expectedAccepted bool + }{ + "OK": { + expectedResponse: &operations.UpdateAzureImageTermsPolicyOK{}, + expectedErrorResponse: nil, + expectedError: false, + expectedSummary: "", + expectedDetail: "", + expectedAccepted: true, + }, + "TransportError": { + expectedResponse: nil, + expectedErrorResponse: errors.New("request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"), + expectedError: true, + expectedSummary: "Create Azure Image Terms Policy", + expectedDetail: "Failed to create Azure Image Terms Policy, unexpected error: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)", + expectedAccepted: false, + }, + } + for name, testCase := range testCases { + t.Run(name, func(t *testing.T) { + ctx := context.TODO() + + mockClient := new(mocks.MockEnvironmentClientService) + + createMatcher := func(params *operations.UpdateAzureImageTermsPolicyParams) bool { + return *params.Input.Accepted + } + mockClient.On("UpdateAzureImageTermsPolicy", mock.MatchedBy(createMatcher)).Return(testCase.expectedResponse, testCase.expectedErrorResponse) + + aitpResource := &azureImageTermsResource{ + client: &cdp.Client{Environments: NewMockEnvironments(mockClient)}, + } + + req := resource.CreateRequest{ + Plan: tfsdk.Plan{ + Raw: createRawAzureImageTermsResource(true), + Schema: environments.AzureImageTermsPolicySchema, + }, + } + + resp := &resource.CreateResponse{ + State: tfsdk.State{ + Schema: environments.AzureImageTermsPolicySchema, + }, + } + + aitpResource.Create(ctx, req, resp) + + assert.Equal(t, testCase.expectedError, resp.Diagnostics.HasError()) + if testCase.expectedError { + assert.Equal(t, testCase.expectedSummary, resp.Diagnostics.Errors()[0].Summary()) + assert.Equal(t, testCase.expectedDetail, resp.Diagnostics.Errors()[0].Detail()) + } + + var state azureImageTermsResourceModel + resp.State.Get(ctx, &state) + + assert.Equal(t, testCase.expectedAccepted, state.Accepted.ValueBool()) + + mockClient.AssertExpectations(t) + }) + } +} + +func TestReadAzureImageTermsPolicy(t *testing.T) { + testCases := map[string]struct { + expectedResponse interface{} + expectedErrorResponse interface{} + expectedError bool + expectedWarning bool + expectedSummary string + expectedDetail string + expectedAccepted bool + }{ + "OK": { + expectedResponse: &operations.GetAzureImageTermsPolicyOK{ + Payload: &models.GetAzureImageTermsPolicyResponse{ + Accepted: func(in bool) *bool { return &in }(true), + }, + }, + expectedErrorResponse: nil, + expectedError: false, + expectedSummary: "", + expectedDetail: "", + expectedAccepted: true, + }, + "TransportError": { + expectedResponse: nil, + expectedErrorResponse: errors.New("request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"), + expectedError: true, + expectedSummary: "Read Azure Image Terms Policy", + expectedDetail: "Failed to read Azure Image Terms Policy, unexpected error: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)", + expectedAccepted: false, + }, + } + for name, testCase := range testCases { + t.Run(name, func(t *testing.T) { + ctx := context.TODO() + + mockClient := new(mocks.MockEnvironmentClientService) + readMatcher := func(params *operations.GetAzureImageTermsPolicyParams) bool { + return true + } + mockClient.On("GetAzureImageTermsPolicy", mock.MatchedBy(readMatcher)).Return(testCase.expectedResponse, testCase.expectedErrorResponse) + + aitpResource := &azureImageTermsResource{ + client: &cdp.Client{Environments: NewMockEnvironments(mockClient)}, + } + + req := resource.ReadRequest{ + State: tfsdk.State{ + Raw: createRawAzureImageTermsResource(true), + Schema: environments.AzureImageTermsPolicySchema, + }, + } + + resp := &resource.ReadResponse{ + State: tfsdk.State{ + Schema: environments.AzureImageTermsPolicySchema, + }, + } + + aitpResource.Read(ctx, req, resp) + + assert.Equal(t, testCase.expectedError, resp.Diagnostics.HasError()) + if testCase.expectedError { + assert.Equal(t, testCase.expectedSummary, resp.Diagnostics.Errors()[0].Summary()) + assert.Equal(t, testCase.expectedDetail, resp.Diagnostics.Errors()[0].Detail()) + } + + if testCase.expectedWarning { + assert.Equal(t, 1, resp.Diagnostics.WarningsCount()) + assert.Equal(t, testCase.expectedSummary, resp.Diagnostics.Warnings()[0].Summary()) + assert.Equal(t, testCase.expectedDetail, resp.Diagnostics.Warnings()[0].Detail()) + assert.True(t, resp.State.Raw.IsNull()) + } + + var state azureImageTermsResourceModel + resp.State.Get(ctx, &state) + + assert.Equal(t, testCase.expectedAccepted, state.Accepted.ValueBool()) + + mockClient.AssertExpectations(t) + }) + } +} + +func TestUpdateAzureImageTermsPolicy(t *testing.T) { + testCases := map[string]struct { + expectedResponse interface{} + expectedErrorResponse interface{} + expectedError bool + expectedWarning bool + expectedSummary string + expectedDetail string + expectedAccepted bool + }{ + "OK": { + expectedResponse: &operations.UpdateAzureImageTermsPolicyOK{}, + expectedErrorResponse: nil, + expectedError: false, + expectedSummary: "", + expectedDetail: "", + expectedAccepted: true, + }, + "TransportError": { + expectedResponse: nil, + expectedErrorResponse: errors.New("request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"), + expectedError: true, + expectedSummary: "Update Azure Image Terms Policy", + expectedDetail: "Failed to update Azure Image Terms Policy, unexpected error: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)", + expectedAccepted: false, + }, + } + for name, testCase := range testCases { + t.Run(name, func(t *testing.T) { + ctx := context.TODO() + + mockClient := new(mocks.MockEnvironmentClientService) + updateMatcher := func(params *operations.UpdateAzureImageTermsPolicyParams) bool { + return *params.Input.Accepted + } + mockClient.On("UpdateAzureImageTermsPolicy", mock.MatchedBy(updateMatcher)).Return(testCase.expectedResponse, testCase.expectedErrorResponse) + + aitpResource := &azureImageTermsResource{ + client: &cdp.Client{Environments: NewMockEnvironments(mockClient)}, + } + + req := resource.UpdateRequest{ + Plan: tfsdk.Plan{ + Raw: createRawAzureImageTermsResource(true), + Schema: environments.AzureImageTermsPolicySchema, + }, + } + + resp := &resource.UpdateResponse{ + State: tfsdk.State{ + Raw: createRawAzureImageTermsResource(false), + Schema: environments.AzureImageTermsPolicySchema, + }, + } + + aitpResource.Update(ctx, req, resp) + + assert.Equal(t, testCase.expectedError, resp.Diagnostics.HasError()) + if testCase.expectedError { + assert.Equal(t, testCase.expectedSummary, resp.Diagnostics.Errors()[0].Summary()) + assert.Equal(t, testCase.expectedDetail, resp.Diagnostics.Errors()[0].Detail()) + } + + if testCase.expectedWarning { + assert.Equal(t, 1, resp.Diagnostics.WarningsCount()) + assert.Equal(t, testCase.expectedSummary, resp.Diagnostics.Warnings()[0].Summary()) + assert.Equal(t, testCase.expectedDetail, resp.Diagnostics.Warnings()[0].Detail()) + assert.True(t, resp.State.Raw.IsNull()) + } + + var state azureImageTermsResourceModel + resp.State.Get(ctx, &state) + + assert.Equal(t, testCase.expectedAccepted, state.Accepted.ValueBool()) + + mockClient.AssertExpectations(t) + }) + } +} + +func TestDeleteAzureImageTermsPolicy(t *testing.T) { + testCases := map[string]struct { + expectedResponse interface{} + expectedErrorResponse interface{} + expectedError bool + expectedWarning bool + expectedSummary string + expectedDetail string + expectedAccepted bool + }{ + "OK": { + expectedResponse: &operations.UpdateAzureImageTermsPolicyOK{}, + expectedErrorResponse: nil, + expectedError: false, + expectedSummary: "", + expectedDetail: "", + expectedAccepted: false, + }, + "TransportError": { + expectedResponse: nil, + expectedErrorResponse: errors.New("request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"), + expectedError: true, + expectedSummary: "Delete Azure Image Terms Policy", + expectedDetail: "Failed to delete Azure Image Terms Policy, unexpected error: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)", + expectedAccepted: false, + }, + } + for name, testCase := range testCases { + t.Run(name, func(t *testing.T) { + ctx := context.TODO() + + mockClient := new(mocks.MockEnvironmentClientService) + updateMatcher := func(params *operations.UpdateAzureImageTermsPolicyParams) bool { + return !*params.Input.Accepted + } + mockClient.On("UpdateAzureImageTermsPolicy", mock.MatchedBy(updateMatcher)).Return(testCase.expectedResponse, testCase.expectedErrorResponse) + + aitpResource := &azureImageTermsResource{ + client: &cdp.Client{Environments: NewMockEnvironments(mockClient)}, + } + + req := resource.DeleteRequest{ + State: tfsdk.State{ + Raw: createRawAzureImageTermsResource(true), + Schema: environments.AzureImageTermsPolicySchema, + }, + } + + resp := &resource.DeleteResponse{ + State: tfsdk.State{ + Schema: environments.AzureImageTermsPolicySchema, + }, + } + + aitpResource.Delete(ctx, req, resp) + + assert.Equal(t, testCase.expectedError, resp.Diagnostics.HasError()) + if testCase.expectedError { + assert.Equal(t, testCase.expectedSummary, resp.Diagnostics.Errors()[0].Summary()) + assert.Equal(t, testCase.expectedDetail, resp.Diagnostics.Errors()[0].Detail()) + } + + if testCase.expectedWarning { + assert.Equal(t, 1, resp.Diagnostics.WarningsCount()) + assert.Equal(t, testCase.expectedSummary, resp.Diagnostics.Warnings()[0].Summary()) + assert.Equal(t, testCase.expectedDetail, resp.Diagnostics.Warnings()[0].Detail()) + } + + var state azureImageTermsResourceModel + resp.State.Get(ctx, &state) + + assert.Equal(t, testCase.expectedAccepted, state.Accepted.ValueBool()) + assert.True(t, resp.State.Raw.IsNull()) + + mockClient.AssertExpectations(t) + }) + } +} diff --git a/resources/environments/schema_aws_environment.go b/resources/environments/schema_aws_environment.go index 14af02d0..bb402aca 100644 --- a/resources/environments/schema_aws_environment.go +++ b/resources/environments/schema_aws_environment.go @@ -12,6 +12,7 @@ package environments import ( "context" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -290,7 +291,7 @@ func ToAwsEnvironmentRequest(ctx context.Context, model *awsEnvironmentResourceM res.CreateServiceEndpoints = model.CreateServiceEndpoints.ValueBool() res.CredentialName = model.CredentialName.ValueStringPointer() res.Description = model.Description.ValueString() - res.EnableTunnel = model.EnableTunnel.ValueBool() + res.EnableTunnel = model.EnableTunnel.ValueBoolPointer() res.EncryptionKeyArn = model.EncryptionKeyArn.ValueString() res.EndpointAccessGatewayScheme = model.EndpointAccessGatewayScheme.ValueString() res.EndpointAccessGatewaySubnetIds = utils.FromSetValueToStringList(model.EndpointAccessGatewaySubnetIds) diff --git a/resources/environments/schema_azure_environment.go b/resources/environments/schema_azure_environment.go index ca3087c2..e8a67bb2 100644 --- a/resources/environments/schema_azure_environment.go +++ b/resources/environments/schema_azure_environment.go @@ -12,6 +12,7 @@ package environments import ( "context" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default" "github.com/hashicorp/terraform-plugin-framework/resource/schema" @@ -293,7 +294,7 @@ func ToAzureEnvironmentRequest(ctx context.Context, model *azureEnvironmentResou req.CredentialName = model.CredentialName.ValueStringPointer() req.Description = model.Description.ValueString() req.EnableOutboundLoadBalancer = model.EnableOutboundLoadBalancer.ValueBool() - req.EnableTunnel = model.EnableTunnel.ValueBool() + req.EnableTunnel = model.EnableTunnel.ValueBoolPointer() req.EncryptionKeyResourceGroupName = model.EncryptionKeyResourceGroupName.ValueString() req.EncryptionKeyURL = model.EncryptionKeyURL.ValueString() req.EnvironmentName = model.EnvironmentName.ValueStringPointer() diff --git a/resources/schema_azure_image_terms.go b/resources/schema_azure_image_terms.go new file mode 100644 index 00000000..04513dd3 --- /dev/null +++ b/resources/schema_azure_image_terms.go @@ -0,0 +1,28 @@ +// Copyright 2023 Cloudera. All Rights Reserved. +// +// This file is licensed under the Apache License Version 2.0 (the "License"). +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. +// +// This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS +// OF ANY KIND, either express or implied. Refer to the License for the specific +// permissions and limitations governing your use of the file. + +package environments + +import ( + "github.com/hashicorp/terraform-plugin-framework/resource/schema" +) + +var AzureImageTermsPolicySchema = schema.Schema{ + MarkdownDescription: "Updates account level Azure Marketplace image policy. CDP is capable to automatically accept Azure Marketplace image terms during cluster deployment. You can use this setting in your account to opt in or opt out this behaviour.", + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + }, + "accepted": schema.BoolAttribute{ + Required: true, + Description: "Flag to enable or disable automatic acceptance of Azure Marketplace image terms.", + }, + }, +}