diff --git a/swagger/gen/scylla/v2/client/config/config_client.go b/swagger/gen/scylla/v2/client/config/config_client.go index 4759c1cb06..213ef58ed6 100644 --- a/swagger/gen/scylla/v2/client/config/config_client.go +++ b/swagger/gen/scylla/v2/client/config/config_client.go @@ -117,6 +117,8 @@ type ClientService interface { FindConfigConcurrentWrites(params *FindConfigConcurrentWritesParams) (*FindConfigConcurrentWritesOK, error) + FindConfigConsistentClusterManagement(params *FindConfigConsistentClusterManagementParams) (*FindConfigConsistentClusterManagementOK, error) + FindConfigConsistentRangemovement(params *FindConfigConsistentRangemovementParams) (*FindConfigConsistentRangemovementOK, error) FindConfigCounterCacheKeysToSave(params *FindConfigCounterCacheKeysToSaveParams) (*FindConfigCounterCacheKeysToSaveOK, error) @@ -1957,6 +1959,39 @@ func (a *Client) FindConfigConcurrentWrites(params *FindConfigConcurrentWritesPa return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +FindConfigConsistentClusterManagement Return true if node uses RAFT for cluster management and DDL. +*/ +func (a *Client) FindConfigConsistentClusterManagement(params *FindConfigConsistentClusterManagementParams) (*FindConfigConsistentClusterManagementOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewFindConfigConsistentClusterManagementParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "find_config_consistent_cluster_management", + Method: "GET", + PathPattern: "/config/consistent_cluster_management", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &FindConfigConsistentClusterManagementReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*FindConfigConsistentClusterManagementOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*FindConfigConsistentClusterManagementDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* FindConfigConsistentRangemovement When set to true, range movements will be consistent. It means: 1) it will refuse to bootstrap a new node if other bootstrapping/leaving/moving nodes detected. 2) data will be streamed to a new node only from the node which is no longer responsible for the token range. Same as -Dcassandra.consistent.rangemovement in cassandra */ diff --git a/swagger/gen/scylla/v2/client/config/find_config_consistent_cluster_management_parameters.go b/swagger/gen/scylla/v2/client/config/find_config_consistent_cluster_management_parameters.go new file mode 100644 index 0000000000..692b79ba92 --- /dev/null +++ b/swagger/gen/scylla/v2/client/config/find_config_consistent_cluster_management_parameters.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// 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" +) + +// NewFindConfigConsistentClusterManagementParams creates a new FindConfigConsistentClusterManagementParams object +// with the default values initialized. +func NewFindConfigConsistentClusterManagementParams() *FindConfigConsistentClusterManagementParams { + + return &FindConfigConsistentClusterManagementParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewFindConfigConsistentClusterManagementParamsWithTimeout creates a new FindConfigConsistentClusterManagementParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewFindConfigConsistentClusterManagementParamsWithTimeout(timeout time.Duration) *FindConfigConsistentClusterManagementParams { + + return &FindConfigConsistentClusterManagementParams{ + + timeout: timeout, + } +} + +// NewFindConfigConsistentClusterManagementParamsWithContext creates a new FindConfigConsistentClusterManagementParams object +// with the default values initialized, and the ability to set a context for a request +func NewFindConfigConsistentClusterManagementParamsWithContext(ctx context.Context) *FindConfigConsistentClusterManagementParams { + + return &FindConfigConsistentClusterManagementParams{ + + Context: ctx, + } +} + +// NewFindConfigConsistentClusterManagementParamsWithHTTPClient creates a new FindConfigConsistentClusterManagementParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewFindConfigConsistentClusterManagementParamsWithHTTPClient(client *http.Client) *FindConfigConsistentClusterManagementParams { + + return &FindConfigConsistentClusterManagementParams{ + HTTPClient: client, + } +} + +/* +FindConfigConsistentClusterManagementParams contains all the parameters to send to the API endpoint +for the find config consistent cluster management operation typically these are written to a http.Request +*/ +type FindConfigConsistentClusterManagementParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the find config consistent cluster management params +func (o *FindConfigConsistentClusterManagementParams) WithTimeout(timeout time.Duration) *FindConfigConsistentClusterManagementParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the find config consistent cluster management params +func (o *FindConfigConsistentClusterManagementParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the find config consistent cluster management params +func (o *FindConfigConsistentClusterManagementParams) WithContext(ctx context.Context) *FindConfigConsistentClusterManagementParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the find config consistent cluster management params +func (o *FindConfigConsistentClusterManagementParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the find config consistent cluster management params +func (o *FindConfigConsistentClusterManagementParams) WithHTTPClient(client *http.Client) *FindConfigConsistentClusterManagementParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the find config consistent cluster management params +func (o *FindConfigConsistentClusterManagementParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *FindConfigConsistentClusterManagementParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/swagger/gen/scylla/v2/client/config/find_config_consistent_cluster_management_responses.go b/swagger/gen/scylla/v2/client/config/find_config_consistent_cluster_management_responses.go new file mode 100644 index 0000000000..7cef53f909 --- /dev/null +++ b/swagger/gen/scylla/v2/client/config/find_config_consistent_cluster_management_responses.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package config + +// 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" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v2/models" +) + +// FindConfigConsistentClusterManagementReader is a Reader for the FindConfigConsistentClusterManagement structure. +type FindConfigConsistentClusterManagementReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *FindConfigConsistentClusterManagementReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewFindConfigConsistentClusterManagementOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewFindConfigConsistentClusterManagementDefault(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 + } +} + +// NewFindConfigConsistentClusterManagementOK creates a FindConfigConsistentClusterManagementOK with default headers values +func NewFindConfigConsistentClusterManagementOK() *FindConfigConsistentClusterManagementOK { + return &FindConfigConsistentClusterManagementOK{} +} + +/* +FindConfigConsistentClusterManagementOK handles this case with default header values. + +Config value +*/ +type FindConfigConsistentClusterManagementOK struct { + Payload bool +} + +func (o *FindConfigConsistentClusterManagementOK) GetPayload() bool { + return o.Payload +} + +func (o *FindConfigConsistentClusterManagementOK) 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 +} + +// NewFindConfigConsistentClusterManagementDefault creates a FindConfigConsistentClusterManagementDefault with default headers values +func NewFindConfigConsistentClusterManagementDefault(code int) *FindConfigConsistentClusterManagementDefault { + return &FindConfigConsistentClusterManagementDefault{ + _statusCode: code, + } +} + +/* +FindConfigConsistentClusterManagementDefault handles this case with default header values. + +unexpected error +*/ +type FindConfigConsistentClusterManagementDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the find config consistent cluster management default response +func (o *FindConfigConsistentClusterManagementDefault) Code() int { + return o._statusCode +} + +func (o *FindConfigConsistentClusterManagementDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *FindConfigConsistentClusterManagementDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorModel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +func (o *FindConfigConsistentClusterManagementDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/swagger/scylla_v2.json b/swagger/scylla_v2.json index a4a6d7a75d..bd77fd982b 100644 --- a/swagger/scylla_v2.json +++ b/swagger/scylla_v2.json @@ -4983,6 +4983,33 @@ } } }, + "/config/consistent_cluster_management": { + "get": { + "description": "Return true if node uses RAFT for cluster management and DDL.", + "operationId": "find_config_consistent_cluster_management", + "produces": [ + "application/json" + ], + "tags": [ + "config" + ], + "parameters": [], + "responses": { + "200": { + "description": "Config value", + "schema": { + "type": "boolean" + } + }, + "default": { + "description": "unexpected error", + "schema": { + "$ref": "#/definitions/ErrorModel" + } + } + } + } + }, "/config/alternator_enforce_authorization": { "get": { "description": "Whether alternator requires authorization",