diff --git a/v3/swagger/gen/scylla/v1/client/operations/operations_client.go b/v3/swagger/gen/scylla/v1/client/operations/operations_client.go index bf0593584..db351411a 100644 --- a/v3/swagger/gen/scylla/v1/client/operations/operations_client.go +++ b/v3/swagger/gen/scylla/v1/client/operations/operations_client.go @@ -783,6 +783,8 @@ type ClientService interface { StorageServiceTabletsBalancingPost(params *StorageServiceTabletsBalancingPostParams) (*StorageServiceTabletsBalancingPostOK, error) + StorageServiceTabletsRepairPost(params *StorageServiceTabletsRepairPostParams) (*StorageServiceTabletsRepairPostOK, error) + StorageServiceTokensByEndpointGet(params *StorageServiceTokensByEndpointGetParams) (*StorageServiceTokensByEndpointGetOK, error) StorageServiceTokensEndpointGet(params *StorageServiceTokensEndpointGetParams) (*StorageServiceTokensEndpointGetOK, error) @@ -14109,6 +14111,41 @@ func (a *Client) StorageServiceTabletsBalancingPost(params *StorageServiceTablet return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +StorageServiceTabletsRepairPost tablets repair + +Repair a tablet +*/ +func (a *Client) StorageServiceTabletsRepairPost(params *StorageServiceTabletsRepairPostParams) (*StorageServiceTabletsRepairPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceTabletsRepairPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceTabletsRepairPost", + Method: "POST", + PathPattern: "/storage_service/tablets/repair", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceTabletsRepairPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceTabletsRepairPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceTabletsRepairPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* StorageServiceTokensByEndpointGet gets node tokens diff --git a/v3/swagger/gen/scylla/v1/client/operations/storage_service_tablets_repair_post_parameters.go b/v3/swagger/gen/scylla/v1/client/operations/storage_service_tablets_repair_post_parameters.go new file mode 100644 index 000000000..ce264d57d --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/storage_service_tablets_repair_post_parameters.go @@ -0,0 +1,190 @@ +// 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" +) + +// NewStorageServiceTabletsRepairPostParams creates a new StorageServiceTabletsRepairPostParams object +// with the default values initialized. +func NewStorageServiceTabletsRepairPostParams() *StorageServiceTabletsRepairPostParams { + var () + return &StorageServiceTabletsRepairPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceTabletsRepairPostParamsWithTimeout creates a new StorageServiceTabletsRepairPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceTabletsRepairPostParamsWithTimeout(timeout time.Duration) *StorageServiceTabletsRepairPostParams { + var () + return &StorageServiceTabletsRepairPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceTabletsRepairPostParamsWithContext creates a new StorageServiceTabletsRepairPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceTabletsRepairPostParamsWithContext(ctx context.Context) *StorageServiceTabletsRepairPostParams { + var () + return &StorageServiceTabletsRepairPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceTabletsRepairPostParamsWithHTTPClient creates a new StorageServiceTabletsRepairPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceTabletsRepairPostParamsWithHTTPClient(client *http.Client) *StorageServiceTabletsRepairPostParams { + var () + return &StorageServiceTabletsRepairPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceTabletsRepairPostParams contains all the parameters to send to the API endpoint +for the storage service tablets repair post operation typically these are written to a http.Request +*/ +type StorageServiceTabletsRepairPostParams struct { + + /*Ks + Keyspace name to repair + + */ + Ks string + /*Table + Table name to repair + + */ + Table string + /*Tokens + Tokens owned by the tablets to repair. Multiple tokens can be provided using a comma-separated list. When set to the special word 'all', all tablets will be repaired + + */ + Tokens string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service tablets repair post params +func (o *StorageServiceTabletsRepairPostParams) WithTimeout(timeout time.Duration) *StorageServiceTabletsRepairPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service tablets repair post params +func (o *StorageServiceTabletsRepairPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service tablets repair post params +func (o *StorageServiceTabletsRepairPostParams) WithContext(ctx context.Context) *StorageServiceTabletsRepairPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service tablets repair post params +func (o *StorageServiceTabletsRepairPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service tablets repair post params +func (o *StorageServiceTabletsRepairPostParams) WithHTTPClient(client *http.Client) *StorageServiceTabletsRepairPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service tablets repair post params +func (o *StorageServiceTabletsRepairPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithKs adds the ks to the storage service tablets repair post params +func (o *StorageServiceTabletsRepairPostParams) WithKs(ks string) *StorageServiceTabletsRepairPostParams { + o.SetKs(ks) + return o +} + +// SetKs adds the ks to the storage service tablets repair post params +func (o *StorageServiceTabletsRepairPostParams) SetKs(ks string) { + o.Ks = ks +} + +// WithTable adds the table to the storage service tablets repair post params +func (o *StorageServiceTabletsRepairPostParams) WithTable(table string) *StorageServiceTabletsRepairPostParams { + o.SetTable(table) + return o +} + +// SetTable adds the table to the storage service tablets repair post params +func (o *StorageServiceTabletsRepairPostParams) SetTable(table string) { + o.Table = table +} + +// WithTokens adds the tokens to the storage service tablets repair post params +func (o *StorageServiceTabletsRepairPostParams) WithTokens(tokens string) *StorageServiceTabletsRepairPostParams { + o.SetTokens(tokens) + return o +} + +// SetTokens adds the tokens to the storage service tablets repair post params +func (o *StorageServiceTabletsRepairPostParams) SetTokens(tokens string) { + o.Tokens = tokens +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceTabletsRepairPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param ks + qrKs := o.Ks + qKs := qrKs + if qKs != "" { + if err := r.SetQueryParam("ks", qKs); err != nil { + return err + } + } + + // query param table + qrTable := o.Table + qTable := qrTable + if qTable != "" { + if err := r.SetQueryParam("table", qTable); err != nil { + return err + } + } + + // query param tokens + qrTokens := o.Tokens + qTokens := qrTokens + if qTokens != "" { + if err := r.SetQueryParam("tokens", qTokens); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/storage_service_tablets_repair_post_responses.go b/v3/swagger/gen/scylla/v1/client/operations/storage_service_tablets_repair_post_responses.go new file mode 100644 index 000000000..159978fe5 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/storage_service_tablets_repair_post_responses.go @@ -0,0 +1,104 @@ +// 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" + "strings" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models" +) + +// StorageServiceTabletsRepairPostReader is a Reader for the StorageServiceTabletsRepairPost structure. +type StorageServiceTabletsRepairPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceTabletsRepairPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceTabletsRepairPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceTabletsRepairPostDefault(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 + } +} + +// NewStorageServiceTabletsRepairPostOK creates a StorageServiceTabletsRepairPostOK with default headers values +func NewStorageServiceTabletsRepairPostOK() *StorageServiceTabletsRepairPostOK { + return &StorageServiceTabletsRepairPostOK{} +} + +/* +StorageServiceTabletsRepairPostOK handles this case with default header values. + +Success +*/ +type StorageServiceTabletsRepairPostOK struct { +} + +func (o *StorageServiceTabletsRepairPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewStorageServiceTabletsRepairPostDefault creates a StorageServiceTabletsRepairPostDefault with default headers values +func NewStorageServiceTabletsRepairPostDefault(code int) *StorageServiceTabletsRepairPostDefault { + return &StorageServiceTabletsRepairPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceTabletsRepairPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceTabletsRepairPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service tablets repair post default response +func (o *StorageServiceTabletsRepairPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceTabletsRepairPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceTabletsRepairPostDefault) 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 *StorageServiceTabletsRepairPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/v3/swagger/scylla_v1.json b/v3/swagger/scylla_v1.json index f97a966fd..1a35c5068 100644 --- a/v3/swagger/scylla_v1.json +++ b/v3/swagger/scylla_v1.json @@ -12664,6 +12664,53 @@ "security": [] } }, + "/storage_service/tablets/repair": { + "post": { + "description": "Repair a tablet", + "summary": "tablets_repair", + "operationId": "StorageServiceTabletsRepairPost", + "deprecated": false, + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "ks", + "in": "query", + "required": true, + "type": "string", + "description": "Keyspace name to repair" + }, + { + "name": "table", + "in": "query", + "required": true, + "type": "string", + "description": "Table name to repair" + }, + { + "name": "tokens", + "in": "query", + "required": true, + "type": "string", + "description": "Tokens owned by the tablets to repair. Multiple tokens can be provided using a comma-separated list. When set to the special word 'all', all tablets will be repaired" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": {} + }, + "default": { + "description": "internal server error", + "schema": { + "$ref": "#/definitions/ErrorModel" + } + } + }, + "security": [] + } + }, "/task_manager/list_modules": { "get": { "description": "Get all modules names", @@ -12920,8 +12967,8 @@ } }, "post": { - "description":"Set ttl in seconds and get last value", - "summary":"get_and_update_ttl", + "description": "Set ttl in seconds and get last value", + "summary": "get_and_update_ttl", "operationId": "TaskManagerTtlPost", "deprecated": false, "produces": [ @@ -12980,8 +13027,8 @@ } }, "post": { - "description":"Set user task ttl in seconds and get last value", - "summary":"get_and_update_user_ttl", + "description": "Set user task ttl in seconds and get last value", + "summary": "get_and_update_user_ttl", "operationId": "TaskManagerUserTtlPost", "deprecated": false, "produces": [