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 0e9a09324d..e329c35a64 100644 --- a/v3/swagger/gen/scylla/v1/client/operations/operations_client.go +++ b/v3/swagger/gen/scylla/v1/client/operations/operations_client.go @@ -821,6 +821,22 @@ type ClientService interface { SystemLoggerPost(params *SystemLoggerPostParams) (*SystemLoggerPostOK, error) + TaskManagerAbortTaskTaskIDPost(params *TaskManagerAbortTaskTaskIDPostParams) (*TaskManagerAbortTaskTaskIDPostOK, error) + + TaskManagerListModuleTasksModuleGet(params *TaskManagerListModuleTasksModuleGetParams) (*TaskManagerListModuleTasksModuleGetOK, error) + + TaskManagerListModulesGet(params *TaskManagerListModulesGetParams) (*TaskManagerListModulesGetOK, error) + + TaskManagerTaskStatusRecursiveTaskIDGet(params *TaskManagerTaskStatusRecursiveTaskIDGetParams) (*TaskManagerTaskStatusRecursiveTaskIDGetOK, error) + + TaskManagerTaskStatusTaskIDGet(params *TaskManagerTaskStatusTaskIDGetParams) (*TaskManagerTaskStatusTaskIDGetOK, error) + + TaskManagerTTLGet(params *TaskManagerTTLGetParams) (*TaskManagerTTLGetOK, error) + + TaskManagerTTLPost(params *TaskManagerTTLPostParams) (*TaskManagerTTLPostOK, error) + + TaskManagerWaitTaskTaskIDGet(params *TaskManagerWaitTaskTaskIDGetParams) (*TaskManagerWaitTaskTaskIDGetOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -14744,6 +14760,286 @@ func (a *Client) SystemLoggerPost(params *SystemLoggerPostParams) (*SystemLogger return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +TaskManagerAbortTaskTaskIDPost aborts task + +Abort running task and its descendants +*/ +func (a *Client) TaskManagerAbortTaskTaskIDPost(params *TaskManagerAbortTaskTaskIDPostParams) (*TaskManagerAbortTaskTaskIDPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaskManagerAbortTaskTaskIDPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "TaskManagerAbortTaskTaskIdPost", + Method: "POST", + PathPattern: "/task_manager/abort_task/{task_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaskManagerAbortTaskTaskIDPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaskManagerAbortTaskTaskIDPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*TaskManagerAbortTaskTaskIDPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +TaskManagerListModuleTasksModuleGet gets tasks + +Get a list of tasks +*/ +func (a *Client) TaskManagerListModuleTasksModuleGet(params *TaskManagerListModuleTasksModuleGetParams) (*TaskManagerListModuleTasksModuleGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaskManagerListModuleTasksModuleGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "TaskManagerListModuleTasksModuleGet", + Method: "GET", + PathPattern: "/task_manager/list_module_tasks/{module}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaskManagerListModuleTasksModuleGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaskManagerListModuleTasksModuleGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*TaskManagerListModuleTasksModuleGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +TaskManagerListModulesGet gets modules + +Get all modules names +*/ +func (a *Client) TaskManagerListModulesGet(params *TaskManagerListModulesGetParams) (*TaskManagerListModulesGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaskManagerListModulesGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "TaskManagerListModulesGet", + Method: "GET", + PathPattern: "/task_manager/list_modules", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaskManagerListModulesGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaskManagerListModulesGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*TaskManagerListModulesGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +TaskManagerTaskStatusRecursiveTaskIDGet gets task status recursively + +Get statuses of the task and all its descendants +*/ +func (a *Client) TaskManagerTaskStatusRecursiveTaskIDGet(params *TaskManagerTaskStatusRecursiveTaskIDGetParams) (*TaskManagerTaskStatusRecursiveTaskIDGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaskManagerTaskStatusRecursiveTaskIDGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "TaskManagerTaskStatusRecursiveTaskIdGet", + Method: "GET", + PathPattern: "/task_manager/task_status_recursive/{task_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaskManagerTaskStatusRecursiveTaskIDGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaskManagerTaskStatusRecursiveTaskIDGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*TaskManagerTaskStatusRecursiveTaskIDGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +TaskManagerTaskStatusTaskIDGet gets task status + +Get task status +*/ +func (a *Client) TaskManagerTaskStatusTaskIDGet(params *TaskManagerTaskStatusTaskIDGetParams) (*TaskManagerTaskStatusTaskIDGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaskManagerTaskStatusTaskIDGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "TaskManagerTaskStatusTaskIdGet", + Method: "GET", + PathPattern: "/task_manager/task_status/{task_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaskManagerTaskStatusTaskIDGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaskManagerTaskStatusTaskIDGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*TaskManagerTaskStatusTaskIDGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +TaskManagerTTLGet gets ttl + +Get current ttl value +*/ +func (a *Client) TaskManagerTTLGet(params *TaskManagerTTLGetParams) (*TaskManagerTTLGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaskManagerTTLGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "TaskManagerTtlGet", + Method: "GET", + PathPattern: "/task_manager/ttl", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaskManagerTTLGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaskManagerTTLGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*TaskManagerTTLGetDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +TaskManagerTTLPost gets and update ttl + +Set ttl in seconds and get last value +*/ +func (a *Client) TaskManagerTTLPost(params *TaskManagerTTLPostParams) (*TaskManagerTTLPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaskManagerTTLPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "TaskManagerTtlPost", + Method: "POST", + PathPattern: "/task_manager/ttl", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaskManagerTTLPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaskManagerTTLPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*TaskManagerTTLPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +TaskManagerWaitTaskTaskIDGet waits task + +Wait for a task to complete +*/ +func (a *Client) TaskManagerWaitTaskTaskIDGet(params *TaskManagerWaitTaskTaskIDGetParams) (*TaskManagerWaitTaskTaskIDGetOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTaskManagerWaitTaskTaskIDGetParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "TaskManagerWaitTaskTaskIdGet", + Method: "GET", + PathPattern: "/task_manager/wait_task/{task_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TaskManagerWaitTaskTaskIDGetReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*TaskManagerWaitTaskTaskIDGetOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*TaskManagerWaitTaskTaskIDGetDefault) + 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/v3/swagger/gen/scylla/v1/client/operations/task_manager_abort_task_task_id_post_parameters.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_abort_task_task_id_post_parameters.go new file mode 100644 index 0000000000..af4f1f231a --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_abort_task_task_id_post_parameters.go @@ -0,0 +1,136 @@ +// 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" +) + +// NewTaskManagerAbortTaskTaskIDPostParams creates a new TaskManagerAbortTaskTaskIDPostParams object +// with the default values initialized. +func NewTaskManagerAbortTaskTaskIDPostParams() *TaskManagerAbortTaskTaskIDPostParams { + var () + return &TaskManagerAbortTaskTaskIDPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaskManagerAbortTaskTaskIDPostParamsWithTimeout creates a new TaskManagerAbortTaskTaskIDPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaskManagerAbortTaskTaskIDPostParamsWithTimeout(timeout time.Duration) *TaskManagerAbortTaskTaskIDPostParams { + var () + return &TaskManagerAbortTaskTaskIDPostParams{ + + timeout: timeout, + } +} + +// NewTaskManagerAbortTaskTaskIDPostParamsWithContext creates a new TaskManagerAbortTaskTaskIDPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaskManagerAbortTaskTaskIDPostParamsWithContext(ctx context.Context) *TaskManagerAbortTaskTaskIDPostParams { + var () + return &TaskManagerAbortTaskTaskIDPostParams{ + + Context: ctx, + } +} + +// NewTaskManagerAbortTaskTaskIDPostParamsWithHTTPClient creates a new TaskManagerAbortTaskTaskIDPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaskManagerAbortTaskTaskIDPostParamsWithHTTPClient(client *http.Client) *TaskManagerAbortTaskTaskIDPostParams { + var () + return &TaskManagerAbortTaskTaskIDPostParams{ + HTTPClient: client, + } +} + +/* +TaskManagerAbortTaskTaskIDPostParams contains all the parameters to send to the API endpoint +for the task manager abort task task Id post operation typically these are written to a http.Request +*/ +type TaskManagerAbortTaskTaskIDPostParams struct { + + /*TaskID + The uuid of a task to abort; if the task is not abortable, 403 status code is returned + + */ + TaskID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the task manager abort task task Id post params +func (o *TaskManagerAbortTaskTaskIDPostParams) WithTimeout(timeout time.Duration) *TaskManagerAbortTaskTaskIDPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the task manager abort task task Id post params +func (o *TaskManagerAbortTaskTaskIDPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the task manager abort task task Id post params +func (o *TaskManagerAbortTaskTaskIDPostParams) WithContext(ctx context.Context) *TaskManagerAbortTaskTaskIDPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the task manager abort task task Id post params +func (o *TaskManagerAbortTaskTaskIDPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the task manager abort task task Id post params +func (o *TaskManagerAbortTaskTaskIDPostParams) WithHTTPClient(client *http.Client) *TaskManagerAbortTaskTaskIDPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the task manager abort task task Id post params +func (o *TaskManagerAbortTaskTaskIDPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskID adds the taskID to the task manager abort task task Id post params +func (o *TaskManagerAbortTaskTaskIDPostParams) WithTaskID(taskID string) *TaskManagerAbortTaskTaskIDPostParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the task manager abort task task Id post params +func (o *TaskManagerAbortTaskTaskIDPostParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WriteToRequest writes these params to a swagger request +func (o *TaskManagerAbortTaskTaskIDPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_abort_task_task_id_post_responses.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_abort_task_task_id_post_responses.go new file mode 100644 index 0000000000..73df4a1769 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_abort_task_task_id_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" +) + +// TaskManagerAbortTaskTaskIDPostReader is a Reader for the TaskManagerAbortTaskTaskIDPost structure. +type TaskManagerAbortTaskTaskIDPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaskManagerAbortTaskTaskIDPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaskManagerAbortTaskTaskIDPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewTaskManagerAbortTaskTaskIDPostDefault(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 + } +} + +// NewTaskManagerAbortTaskTaskIDPostOK creates a TaskManagerAbortTaskTaskIDPostOK with default headers values +func NewTaskManagerAbortTaskTaskIDPostOK() *TaskManagerAbortTaskTaskIDPostOK { + return &TaskManagerAbortTaskTaskIDPostOK{} +} + +/* +TaskManagerAbortTaskTaskIDPostOK handles this case with default header values. + +Success +*/ +type TaskManagerAbortTaskTaskIDPostOK struct { +} + +func (o *TaskManagerAbortTaskTaskIDPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewTaskManagerAbortTaskTaskIDPostDefault creates a TaskManagerAbortTaskTaskIDPostDefault with default headers values +func NewTaskManagerAbortTaskTaskIDPostDefault(code int) *TaskManagerAbortTaskTaskIDPostDefault { + return &TaskManagerAbortTaskTaskIDPostDefault{ + _statusCode: code, + } +} + +/* +TaskManagerAbortTaskTaskIDPostDefault handles this case with default header values. + +internal server error +*/ +type TaskManagerAbortTaskTaskIDPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the task manager abort task task Id post default response +func (o *TaskManagerAbortTaskTaskIDPostDefault) Code() int { + return o._statusCode +} + +func (o *TaskManagerAbortTaskTaskIDPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *TaskManagerAbortTaskTaskIDPostDefault) 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 *TaskManagerAbortTaskTaskIDPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_module_tasks_module_get_parameters.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_module_tasks_module_get_parameters.go new file mode 100644 index 0000000000..024420d74b --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_module_tasks_module_get_parameters.go @@ -0,0 +1,233 @@ +// 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/go-openapi/swag" +) + +// NewTaskManagerListModuleTasksModuleGetParams creates a new TaskManagerListModuleTasksModuleGetParams object +// with the default values initialized. +func NewTaskManagerListModuleTasksModuleGetParams() *TaskManagerListModuleTasksModuleGetParams { + var () + return &TaskManagerListModuleTasksModuleGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaskManagerListModuleTasksModuleGetParamsWithTimeout creates a new TaskManagerListModuleTasksModuleGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaskManagerListModuleTasksModuleGetParamsWithTimeout(timeout time.Duration) *TaskManagerListModuleTasksModuleGetParams { + var () + return &TaskManagerListModuleTasksModuleGetParams{ + + timeout: timeout, + } +} + +// NewTaskManagerListModuleTasksModuleGetParamsWithContext creates a new TaskManagerListModuleTasksModuleGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaskManagerListModuleTasksModuleGetParamsWithContext(ctx context.Context) *TaskManagerListModuleTasksModuleGetParams { + var () + return &TaskManagerListModuleTasksModuleGetParams{ + + Context: ctx, + } +} + +// NewTaskManagerListModuleTasksModuleGetParamsWithHTTPClient creates a new TaskManagerListModuleTasksModuleGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaskManagerListModuleTasksModuleGetParamsWithHTTPClient(client *http.Client) *TaskManagerListModuleTasksModuleGetParams { + var () + return &TaskManagerListModuleTasksModuleGetParams{ + HTTPClient: client, + } +} + +/* +TaskManagerListModuleTasksModuleGetParams contains all the parameters to send to the API endpoint +for the task manager list module tasks module get operation typically these are written to a http.Request +*/ +type TaskManagerListModuleTasksModuleGetParams struct { + + /*Internal + Boolean flag indicating whether internal tasks should be shown (false by default) + + */ + Internal *bool + /*Keyspace + The keyspace to query about + + */ + Keyspace *string + /*Module + The module to query about + + */ + Module string + /*Table + The table to query about + + */ + Table *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) WithTimeout(timeout time.Duration) *TaskManagerListModuleTasksModuleGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) WithContext(ctx context.Context) *TaskManagerListModuleTasksModuleGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) WithHTTPClient(client *http.Client) *TaskManagerListModuleTasksModuleGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithInternal adds the internal to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) WithInternal(internal *bool) *TaskManagerListModuleTasksModuleGetParams { + o.SetInternal(internal) + return o +} + +// SetInternal adds the internal to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) SetInternal(internal *bool) { + o.Internal = internal +} + +// WithKeyspace adds the keyspace to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) WithKeyspace(keyspace *string) *TaskManagerListModuleTasksModuleGetParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) SetKeyspace(keyspace *string) { + o.Keyspace = keyspace +} + +// WithModule adds the module to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) WithModule(module string) *TaskManagerListModuleTasksModuleGetParams { + o.SetModule(module) + return o +} + +// SetModule adds the module to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) SetModule(module string) { + o.Module = module +} + +// WithTable adds the table to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) WithTable(table *string) *TaskManagerListModuleTasksModuleGetParams { + o.SetTable(table) + return o +} + +// SetTable adds the table to the task manager list module tasks module get params +func (o *TaskManagerListModuleTasksModuleGetParams) SetTable(table *string) { + o.Table = table +} + +// WriteToRequest writes these params to a swagger request +func (o *TaskManagerListModuleTasksModuleGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Internal != nil { + + // query param internal + var qrInternal bool + if o.Internal != nil { + qrInternal = *o.Internal + } + qInternal := swag.FormatBool(qrInternal) + if qInternal != "" { + if err := r.SetQueryParam("internal", qInternal); err != nil { + return err + } + } + + } + + if o.Keyspace != nil { + + // query param keyspace + var qrKeyspace string + if o.Keyspace != nil { + qrKeyspace = *o.Keyspace + } + qKeyspace := qrKeyspace + if qKeyspace != "" { + if err := r.SetQueryParam("keyspace", qKeyspace); err != nil { + return err + } + } + + } + + // path param module + if err := r.SetPathParam("module", o.Module); err != nil { + return err + } + + if o.Table != nil { + + // query param table + var qrTable string + if o.Table != nil { + qrTable = *o.Table + } + qTable := qrTable + if qTable != "" { + if err := r.SetQueryParam("table", qTable); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_module_tasks_module_get_responses.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_module_tasks_module_get_responses.go new file mode 100644 index 0000000000..99d4e4d4aa --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_module_tasks_module_get_responses.go @@ -0,0 +1,114 @@ +// 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" +) + +// TaskManagerListModuleTasksModuleGetReader is a Reader for the TaskManagerListModuleTasksModuleGet structure. +type TaskManagerListModuleTasksModuleGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaskManagerListModuleTasksModuleGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaskManagerListModuleTasksModuleGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewTaskManagerListModuleTasksModuleGetDefault(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 + } +} + +// NewTaskManagerListModuleTasksModuleGetOK creates a TaskManagerListModuleTasksModuleGetOK with default headers values +func NewTaskManagerListModuleTasksModuleGetOK() *TaskManagerListModuleTasksModuleGetOK { + return &TaskManagerListModuleTasksModuleGetOK{} +} + +/* +TaskManagerListModuleTasksModuleGetOK handles this case with default header values. + +Success +*/ +type TaskManagerListModuleTasksModuleGetOK struct { + Payload []*models.TaskStats +} + +func (o *TaskManagerListModuleTasksModuleGetOK) GetPayload() []*models.TaskStats { + return o.Payload +} + +func (o *TaskManagerListModuleTasksModuleGetOK) 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 +} + +// NewTaskManagerListModuleTasksModuleGetDefault creates a TaskManagerListModuleTasksModuleGetDefault with default headers values +func NewTaskManagerListModuleTasksModuleGetDefault(code int) *TaskManagerListModuleTasksModuleGetDefault { + return &TaskManagerListModuleTasksModuleGetDefault{ + _statusCode: code, + } +} + +/* +TaskManagerListModuleTasksModuleGetDefault handles this case with default header values. + +internal server error +*/ +type TaskManagerListModuleTasksModuleGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the task manager list module tasks module get default response +func (o *TaskManagerListModuleTasksModuleGetDefault) Code() int { + return o._statusCode +} + +func (o *TaskManagerListModuleTasksModuleGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *TaskManagerListModuleTasksModuleGetDefault) 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 *TaskManagerListModuleTasksModuleGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_modules_get_parameters.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_modules_get_parameters.go new file mode 100644 index 0000000000..3898feaaa5 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_modules_get_parameters.go @@ -0,0 +1,113 @@ +// 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" +) + +// NewTaskManagerListModulesGetParams creates a new TaskManagerListModulesGetParams object +// with the default values initialized. +func NewTaskManagerListModulesGetParams() *TaskManagerListModulesGetParams { + + return &TaskManagerListModulesGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaskManagerListModulesGetParamsWithTimeout creates a new TaskManagerListModulesGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaskManagerListModulesGetParamsWithTimeout(timeout time.Duration) *TaskManagerListModulesGetParams { + + return &TaskManagerListModulesGetParams{ + + timeout: timeout, + } +} + +// NewTaskManagerListModulesGetParamsWithContext creates a new TaskManagerListModulesGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaskManagerListModulesGetParamsWithContext(ctx context.Context) *TaskManagerListModulesGetParams { + + return &TaskManagerListModulesGetParams{ + + Context: ctx, + } +} + +// NewTaskManagerListModulesGetParamsWithHTTPClient creates a new TaskManagerListModulesGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaskManagerListModulesGetParamsWithHTTPClient(client *http.Client) *TaskManagerListModulesGetParams { + + return &TaskManagerListModulesGetParams{ + HTTPClient: client, + } +} + +/* +TaskManagerListModulesGetParams contains all the parameters to send to the API endpoint +for the task manager list modules get operation typically these are written to a http.Request +*/ +type TaskManagerListModulesGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the task manager list modules get params +func (o *TaskManagerListModulesGetParams) WithTimeout(timeout time.Duration) *TaskManagerListModulesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the task manager list modules get params +func (o *TaskManagerListModulesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the task manager list modules get params +func (o *TaskManagerListModulesGetParams) WithContext(ctx context.Context) *TaskManagerListModulesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the task manager list modules get params +func (o *TaskManagerListModulesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the task manager list modules get params +func (o *TaskManagerListModulesGetParams) WithHTTPClient(client *http.Client) *TaskManagerListModulesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the task manager list modules get params +func (o *TaskManagerListModulesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TaskManagerListModulesGetParams) 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/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_modules_get_responses.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_modules_get_responses.go new file mode 100644 index 0000000000..09b42c8fb8 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_modules_get_responses.go @@ -0,0 +1,114 @@ +// 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" +) + +// TaskManagerListModulesGetReader is a Reader for the TaskManagerListModulesGet structure. +type TaskManagerListModulesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaskManagerListModulesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaskManagerListModulesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewTaskManagerListModulesGetDefault(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 + } +} + +// NewTaskManagerListModulesGetOK creates a TaskManagerListModulesGetOK with default headers values +func NewTaskManagerListModulesGetOK() *TaskManagerListModulesGetOK { + return &TaskManagerListModulesGetOK{} +} + +/* +TaskManagerListModulesGetOK handles this case with default header values. + +Success +*/ +type TaskManagerListModulesGetOK struct { + Payload []string +} + +func (o *TaskManagerListModulesGetOK) GetPayload() []string { + return o.Payload +} + +func (o *TaskManagerListModulesGetOK) 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 +} + +// NewTaskManagerListModulesGetDefault creates a TaskManagerListModulesGetDefault with default headers values +func NewTaskManagerListModulesGetDefault(code int) *TaskManagerListModulesGetDefault { + return &TaskManagerListModulesGetDefault{ + _statusCode: code, + } +} + +/* +TaskManagerListModulesGetDefault handles this case with default header values. + +internal server error +*/ +type TaskManagerListModulesGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the task manager list modules get default response +func (o *TaskManagerListModulesGetDefault) Code() int { + return o._statusCode +} + +func (o *TaskManagerListModulesGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *TaskManagerListModulesGetDefault) 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 *TaskManagerListModulesGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_recursive_task_id_get_parameters.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_recursive_task_id_get_parameters.go new file mode 100644 index 0000000000..1af2ed9bfa --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_recursive_task_id_get_parameters.go @@ -0,0 +1,136 @@ +// 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" +) + +// NewTaskManagerTaskStatusRecursiveTaskIDGetParams creates a new TaskManagerTaskStatusRecursiveTaskIDGetParams object +// with the default values initialized. +func NewTaskManagerTaskStatusRecursiveTaskIDGetParams() *TaskManagerTaskStatusRecursiveTaskIDGetParams { + var () + return &TaskManagerTaskStatusRecursiveTaskIDGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaskManagerTaskStatusRecursiveTaskIDGetParamsWithTimeout creates a new TaskManagerTaskStatusRecursiveTaskIDGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaskManagerTaskStatusRecursiveTaskIDGetParamsWithTimeout(timeout time.Duration) *TaskManagerTaskStatusRecursiveTaskIDGetParams { + var () + return &TaskManagerTaskStatusRecursiveTaskIDGetParams{ + + timeout: timeout, + } +} + +// NewTaskManagerTaskStatusRecursiveTaskIDGetParamsWithContext creates a new TaskManagerTaskStatusRecursiveTaskIDGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaskManagerTaskStatusRecursiveTaskIDGetParamsWithContext(ctx context.Context) *TaskManagerTaskStatusRecursiveTaskIDGetParams { + var () + return &TaskManagerTaskStatusRecursiveTaskIDGetParams{ + + Context: ctx, + } +} + +// NewTaskManagerTaskStatusRecursiveTaskIDGetParamsWithHTTPClient creates a new TaskManagerTaskStatusRecursiveTaskIDGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaskManagerTaskStatusRecursiveTaskIDGetParamsWithHTTPClient(client *http.Client) *TaskManagerTaskStatusRecursiveTaskIDGetParams { + var () + return &TaskManagerTaskStatusRecursiveTaskIDGetParams{ + HTTPClient: client, + } +} + +/* +TaskManagerTaskStatusRecursiveTaskIDGetParams contains all the parameters to send to the API endpoint +for the task manager task status recursive task Id get operation typically these are written to a http.Request +*/ +type TaskManagerTaskStatusRecursiveTaskIDGetParams struct { + + /*TaskID + The uuid of a task to query about + + */ + TaskID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the task manager task status recursive task Id get params +func (o *TaskManagerTaskStatusRecursiveTaskIDGetParams) WithTimeout(timeout time.Duration) *TaskManagerTaskStatusRecursiveTaskIDGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the task manager task status recursive task Id get params +func (o *TaskManagerTaskStatusRecursiveTaskIDGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the task manager task status recursive task Id get params +func (o *TaskManagerTaskStatusRecursiveTaskIDGetParams) WithContext(ctx context.Context) *TaskManagerTaskStatusRecursiveTaskIDGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the task manager task status recursive task Id get params +func (o *TaskManagerTaskStatusRecursiveTaskIDGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the task manager task status recursive task Id get params +func (o *TaskManagerTaskStatusRecursiveTaskIDGetParams) WithHTTPClient(client *http.Client) *TaskManagerTaskStatusRecursiveTaskIDGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the task manager task status recursive task Id get params +func (o *TaskManagerTaskStatusRecursiveTaskIDGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskID adds the taskID to the task manager task status recursive task Id get params +func (o *TaskManagerTaskStatusRecursiveTaskIDGetParams) WithTaskID(taskID string) *TaskManagerTaskStatusRecursiveTaskIDGetParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the task manager task status recursive task Id get params +func (o *TaskManagerTaskStatusRecursiveTaskIDGetParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WriteToRequest writes these params to a swagger request +func (o *TaskManagerTaskStatusRecursiveTaskIDGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_recursive_task_id_get_responses.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_recursive_task_id_get_responses.go new file mode 100644 index 0000000000..6c9b93b9c5 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_recursive_task_id_get_responses.go @@ -0,0 +1,114 @@ +// 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" +) + +// TaskManagerTaskStatusRecursiveTaskIDGetReader is a Reader for the TaskManagerTaskStatusRecursiveTaskIDGet structure. +type TaskManagerTaskStatusRecursiveTaskIDGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaskManagerTaskStatusRecursiveTaskIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaskManagerTaskStatusRecursiveTaskIDGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewTaskManagerTaskStatusRecursiveTaskIDGetDefault(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 + } +} + +// NewTaskManagerTaskStatusRecursiveTaskIDGetOK creates a TaskManagerTaskStatusRecursiveTaskIDGetOK with default headers values +func NewTaskManagerTaskStatusRecursiveTaskIDGetOK() *TaskManagerTaskStatusRecursiveTaskIDGetOK { + return &TaskManagerTaskStatusRecursiveTaskIDGetOK{} +} + +/* +TaskManagerTaskStatusRecursiveTaskIDGetOK handles this case with default header values. + +Success +*/ +type TaskManagerTaskStatusRecursiveTaskIDGetOK struct { + Payload []*models.TaskStatus +} + +func (o *TaskManagerTaskStatusRecursiveTaskIDGetOK) GetPayload() []*models.TaskStatus { + return o.Payload +} + +func (o *TaskManagerTaskStatusRecursiveTaskIDGetOK) 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 +} + +// NewTaskManagerTaskStatusRecursiveTaskIDGetDefault creates a TaskManagerTaskStatusRecursiveTaskIDGetDefault with default headers values +func NewTaskManagerTaskStatusRecursiveTaskIDGetDefault(code int) *TaskManagerTaskStatusRecursiveTaskIDGetDefault { + return &TaskManagerTaskStatusRecursiveTaskIDGetDefault{ + _statusCode: code, + } +} + +/* +TaskManagerTaskStatusRecursiveTaskIDGetDefault handles this case with default header values. + +internal server error +*/ +type TaskManagerTaskStatusRecursiveTaskIDGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the task manager task status recursive task Id get default response +func (o *TaskManagerTaskStatusRecursiveTaskIDGetDefault) Code() int { + return o._statusCode +} + +func (o *TaskManagerTaskStatusRecursiveTaskIDGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *TaskManagerTaskStatusRecursiveTaskIDGetDefault) 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 *TaskManagerTaskStatusRecursiveTaskIDGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_task_id_get_parameters.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_task_id_get_parameters.go new file mode 100644 index 0000000000..795b029a07 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_task_id_get_parameters.go @@ -0,0 +1,136 @@ +// 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" +) + +// NewTaskManagerTaskStatusTaskIDGetParams creates a new TaskManagerTaskStatusTaskIDGetParams object +// with the default values initialized. +func NewTaskManagerTaskStatusTaskIDGetParams() *TaskManagerTaskStatusTaskIDGetParams { + var () + return &TaskManagerTaskStatusTaskIDGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaskManagerTaskStatusTaskIDGetParamsWithTimeout creates a new TaskManagerTaskStatusTaskIDGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaskManagerTaskStatusTaskIDGetParamsWithTimeout(timeout time.Duration) *TaskManagerTaskStatusTaskIDGetParams { + var () + return &TaskManagerTaskStatusTaskIDGetParams{ + + timeout: timeout, + } +} + +// NewTaskManagerTaskStatusTaskIDGetParamsWithContext creates a new TaskManagerTaskStatusTaskIDGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaskManagerTaskStatusTaskIDGetParamsWithContext(ctx context.Context) *TaskManagerTaskStatusTaskIDGetParams { + var () + return &TaskManagerTaskStatusTaskIDGetParams{ + + Context: ctx, + } +} + +// NewTaskManagerTaskStatusTaskIDGetParamsWithHTTPClient creates a new TaskManagerTaskStatusTaskIDGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaskManagerTaskStatusTaskIDGetParamsWithHTTPClient(client *http.Client) *TaskManagerTaskStatusTaskIDGetParams { + var () + return &TaskManagerTaskStatusTaskIDGetParams{ + HTTPClient: client, + } +} + +/* +TaskManagerTaskStatusTaskIDGetParams contains all the parameters to send to the API endpoint +for the task manager task status task Id get operation typically these are written to a http.Request +*/ +type TaskManagerTaskStatusTaskIDGetParams struct { + + /*TaskID + The uuid of a task to query about + + */ + TaskID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the task manager task status task Id get params +func (o *TaskManagerTaskStatusTaskIDGetParams) WithTimeout(timeout time.Duration) *TaskManagerTaskStatusTaskIDGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the task manager task status task Id get params +func (o *TaskManagerTaskStatusTaskIDGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the task manager task status task Id get params +func (o *TaskManagerTaskStatusTaskIDGetParams) WithContext(ctx context.Context) *TaskManagerTaskStatusTaskIDGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the task manager task status task Id get params +func (o *TaskManagerTaskStatusTaskIDGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the task manager task status task Id get params +func (o *TaskManagerTaskStatusTaskIDGetParams) WithHTTPClient(client *http.Client) *TaskManagerTaskStatusTaskIDGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the task manager task status task Id get params +func (o *TaskManagerTaskStatusTaskIDGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskID adds the taskID to the task manager task status task Id get params +func (o *TaskManagerTaskStatusTaskIDGetParams) WithTaskID(taskID string) *TaskManagerTaskStatusTaskIDGetParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the task manager task status task Id get params +func (o *TaskManagerTaskStatusTaskIDGetParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WriteToRequest writes these params to a swagger request +func (o *TaskManagerTaskStatusTaskIDGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_task_id_get_responses.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_task_id_get_responses.go new file mode 100644 index 0000000000..b3978d2891 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_task_id_get_responses.go @@ -0,0 +1,116 @@ +// 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" +) + +// TaskManagerTaskStatusTaskIDGetReader is a Reader for the TaskManagerTaskStatusTaskIDGet structure. +type TaskManagerTaskStatusTaskIDGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaskManagerTaskStatusTaskIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaskManagerTaskStatusTaskIDGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewTaskManagerTaskStatusTaskIDGetDefault(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 + } +} + +// NewTaskManagerTaskStatusTaskIDGetOK creates a TaskManagerTaskStatusTaskIDGetOK with default headers values +func NewTaskManagerTaskStatusTaskIDGetOK() *TaskManagerTaskStatusTaskIDGetOK { + return &TaskManagerTaskStatusTaskIDGetOK{} +} + +/* +TaskManagerTaskStatusTaskIDGetOK handles this case with default header values. + +Success +*/ +type TaskManagerTaskStatusTaskIDGetOK struct { + Payload *models.TaskStatus +} + +func (o *TaskManagerTaskStatusTaskIDGetOK) GetPayload() *models.TaskStatus { + return o.Payload +} + +func (o *TaskManagerTaskStatusTaskIDGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskStatus) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTaskManagerTaskStatusTaskIDGetDefault creates a TaskManagerTaskStatusTaskIDGetDefault with default headers values +func NewTaskManagerTaskStatusTaskIDGetDefault(code int) *TaskManagerTaskStatusTaskIDGetDefault { + return &TaskManagerTaskStatusTaskIDGetDefault{ + _statusCode: code, + } +} + +/* +TaskManagerTaskStatusTaskIDGetDefault handles this case with default header values. + +internal server error +*/ +type TaskManagerTaskStatusTaskIDGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the task manager task status task Id get default response +func (o *TaskManagerTaskStatusTaskIDGetDefault) Code() int { + return o._statusCode +} + +func (o *TaskManagerTaskStatusTaskIDGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *TaskManagerTaskStatusTaskIDGetDefault) 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 *TaskManagerTaskStatusTaskIDGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_get_parameters.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_get_parameters.go new file mode 100644 index 0000000000..71753eba22 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_get_parameters.go @@ -0,0 +1,113 @@ +// 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" +) + +// NewTaskManagerTTLGetParams creates a new TaskManagerTTLGetParams object +// with the default values initialized. +func NewTaskManagerTTLGetParams() *TaskManagerTTLGetParams { + + return &TaskManagerTTLGetParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaskManagerTTLGetParamsWithTimeout creates a new TaskManagerTTLGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaskManagerTTLGetParamsWithTimeout(timeout time.Duration) *TaskManagerTTLGetParams { + + return &TaskManagerTTLGetParams{ + + timeout: timeout, + } +} + +// NewTaskManagerTTLGetParamsWithContext creates a new TaskManagerTTLGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaskManagerTTLGetParamsWithContext(ctx context.Context) *TaskManagerTTLGetParams { + + return &TaskManagerTTLGetParams{ + + Context: ctx, + } +} + +// NewTaskManagerTTLGetParamsWithHTTPClient creates a new TaskManagerTTLGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaskManagerTTLGetParamsWithHTTPClient(client *http.Client) *TaskManagerTTLGetParams { + + return &TaskManagerTTLGetParams{ + HTTPClient: client, + } +} + +/* +TaskManagerTTLGetParams contains all the parameters to send to the API endpoint +for the task manager Ttl get operation typically these are written to a http.Request +*/ +type TaskManagerTTLGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the task manager Ttl get params +func (o *TaskManagerTTLGetParams) WithTimeout(timeout time.Duration) *TaskManagerTTLGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the task manager Ttl get params +func (o *TaskManagerTTLGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the task manager Ttl get params +func (o *TaskManagerTTLGetParams) WithContext(ctx context.Context) *TaskManagerTTLGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the task manager Ttl get params +func (o *TaskManagerTTLGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the task manager Ttl get params +func (o *TaskManagerTTLGetParams) WithHTTPClient(client *http.Client) *TaskManagerTTLGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the task manager Ttl get params +func (o *TaskManagerTTLGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TaskManagerTTLGetParams) 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/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_get_responses.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_get_responses.go new file mode 100644 index 0000000000..8fcb7ea5bf --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_get_responses.go @@ -0,0 +1,114 @@ +// 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" +) + +// TaskManagerTTLGetReader is a Reader for the TaskManagerTTLGet structure. +type TaskManagerTTLGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaskManagerTTLGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaskManagerTTLGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewTaskManagerTTLGetDefault(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 + } +} + +// NewTaskManagerTTLGetOK creates a TaskManagerTTLGetOK with default headers values +func NewTaskManagerTTLGetOK() *TaskManagerTTLGetOK { + return &TaskManagerTTLGetOK{} +} + +/* +TaskManagerTTLGetOK handles this case with default header values. + +Success +*/ +type TaskManagerTTLGetOK struct { + Payload int64 +} + +func (o *TaskManagerTTLGetOK) GetPayload() int64 { + return o.Payload +} + +func (o *TaskManagerTTLGetOK) 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 +} + +// NewTaskManagerTTLGetDefault creates a TaskManagerTTLGetDefault with default headers values +func NewTaskManagerTTLGetDefault(code int) *TaskManagerTTLGetDefault { + return &TaskManagerTTLGetDefault{ + _statusCode: code, + } +} + +/* +TaskManagerTTLGetDefault handles this case with default header values. + +internal server error +*/ +type TaskManagerTTLGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the task manager Ttl get default response +func (o *TaskManagerTTLGetDefault) Code() int { + return o._statusCode +} + +func (o *TaskManagerTTLGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *TaskManagerTTLGetDefault) 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 *TaskManagerTTLGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_post_parameters.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_post_parameters.go new file mode 100644 index 0000000000..fa6b2326a2 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_post_parameters.go @@ -0,0 +1,141 @@ +// 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/go-openapi/swag" +) + +// NewTaskManagerTTLPostParams creates a new TaskManagerTTLPostParams object +// with the default values initialized. +func NewTaskManagerTTLPostParams() *TaskManagerTTLPostParams { + var () + return &TaskManagerTTLPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTaskManagerTTLPostParamsWithTimeout creates a new TaskManagerTTLPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaskManagerTTLPostParamsWithTimeout(timeout time.Duration) *TaskManagerTTLPostParams { + var () + return &TaskManagerTTLPostParams{ + + timeout: timeout, + } +} + +// NewTaskManagerTTLPostParamsWithContext creates a new TaskManagerTTLPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaskManagerTTLPostParamsWithContext(ctx context.Context) *TaskManagerTTLPostParams { + var () + return &TaskManagerTTLPostParams{ + + Context: ctx, + } +} + +// NewTaskManagerTTLPostParamsWithHTTPClient creates a new TaskManagerTTLPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaskManagerTTLPostParamsWithHTTPClient(client *http.Client) *TaskManagerTTLPostParams { + var () + return &TaskManagerTTLPostParams{ + HTTPClient: client, + } +} + +/* +TaskManagerTTLPostParams contains all the parameters to send to the API endpoint +for the task manager Ttl post operation typically these are written to a http.Request +*/ +type TaskManagerTTLPostParams struct { + + /*TTL + The number of seconds for which the tasks will be kept in memory after it finishes + + */ + TTL int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the task manager Ttl post params +func (o *TaskManagerTTLPostParams) WithTimeout(timeout time.Duration) *TaskManagerTTLPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the task manager Ttl post params +func (o *TaskManagerTTLPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the task manager Ttl post params +func (o *TaskManagerTTLPostParams) WithContext(ctx context.Context) *TaskManagerTTLPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the task manager Ttl post params +func (o *TaskManagerTTLPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the task manager Ttl post params +func (o *TaskManagerTTLPostParams) WithHTTPClient(client *http.Client) *TaskManagerTTLPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the task manager Ttl post params +func (o *TaskManagerTTLPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTTL adds the ttl to the task manager Ttl post params +func (o *TaskManagerTTLPostParams) WithTTL(ttl int64) *TaskManagerTTLPostParams { + o.SetTTL(ttl) + return o +} + +// SetTTL adds the ttl to the task manager Ttl post params +func (o *TaskManagerTTLPostParams) SetTTL(ttl int64) { + o.TTL = ttl +} + +// WriteToRequest writes these params to a swagger request +func (o *TaskManagerTTLPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param ttl + qrTTL := o.TTL + qTTL := swag.FormatInt64(qrTTL) + if qTTL != "" { + if err := r.SetQueryParam("ttl", qTTL); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_post_responses.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_post_responses.go new file mode 100644 index 0000000000..80d97579d1 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_post_responses.go @@ -0,0 +1,114 @@ +// 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" +) + +// TaskManagerTTLPostReader is a Reader for the TaskManagerTTLPost structure. +type TaskManagerTTLPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaskManagerTTLPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaskManagerTTLPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewTaskManagerTTLPostDefault(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 + } +} + +// NewTaskManagerTTLPostOK creates a TaskManagerTTLPostOK with default headers values +func NewTaskManagerTTLPostOK() *TaskManagerTTLPostOK { + return &TaskManagerTTLPostOK{} +} + +/* +TaskManagerTTLPostOK handles this case with default header values. + +Success +*/ +type TaskManagerTTLPostOK struct { + Payload int64 +} + +func (o *TaskManagerTTLPostOK) GetPayload() int64 { + return o.Payload +} + +func (o *TaskManagerTTLPostOK) 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 +} + +// NewTaskManagerTTLPostDefault creates a TaskManagerTTLPostDefault with default headers values +func NewTaskManagerTTLPostDefault(code int) *TaskManagerTTLPostDefault { + return &TaskManagerTTLPostDefault{ + _statusCode: code, + } +} + +/* +TaskManagerTTLPostDefault handles this case with default header values. + +internal server error +*/ +type TaskManagerTTLPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the task manager Ttl post default response +func (o *TaskManagerTTLPostDefault) Code() int { + return o._statusCode +} + +func (o *TaskManagerTTLPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *TaskManagerTTLPostDefault) 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 *TaskManagerTTLPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_wait_task_task_id_get_parameters.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_wait_task_task_id_get_parameters.go new file mode 100644 index 0000000000..d8b60778ff --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_wait_task_task_id_get_parameters.go @@ -0,0 +1,169 @@ +// 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/go-openapi/swag" +) + +// NewTaskManagerWaitTaskTaskIDGetParams creates a new TaskManagerWaitTaskTaskIDGetParams object +// with the default values initialized. +func NewTaskManagerWaitTaskTaskIDGetParams() *TaskManagerWaitTaskTaskIDGetParams { + var () + return &TaskManagerWaitTaskTaskIDGetParams{ + + requestTimeout: cr.DefaultTimeout, + } +} + +// NewTaskManagerWaitTaskTaskIDGetParamsWithTimeout creates a new TaskManagerWaitTaskTaskIDGetParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTaskManagerWaitTaskTaskIDGetParamsWithTimeout(timeout time.Duration) *TaskManagerWaitTaskTaskIDGetParams { + var () + return &TaskManagerWaitTaskTaskIDGetParams{ + + requestTimeout: timeout, + } +} + +// NewTaskManagerWaitTaskTaskIDGetParamsWithContext creates a new TaskManagerWaitTaskTaskIDGetParams object +// with the default values initialized, and the ability to set a context for a request +func NewTaskManagerWaitTaskTaskIDGetParamsWithContext(ctx context.Context) *TaskManagerWaitTaskTaskIDGetParams { + var () + return &TaskManagerWaitTaskTaskIDGetParams{ + + Context: ctx, + } +} + +// NewTaskManagerWaitTaskTaskIDGetParamsWithHTTPClient creates a new TaskManagerWaitTaskTaskIDGetParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTaskManagerWaitTaskTaskIDGetParamsWithHTTPClient(client *http.Client) *TaskManagerWaitTaskTaskIDGetParams { + var () + return &TaskManagerWaitTaskTaskIDGetParams{ + HTTPClient: client, + } +} + +/* +TaskManagerWaitTaskTaskIDGetParams contains all the parameters to send to the API endpoint +for the task manager wait task task Id get operation typically these are written to a http.Request +*/ +type TaskManagerWaitTaskTaskIDGetParams struct { + + /*TaskID + The uuid of a task to wait for + + */ + TaskID string + /*Timeout + Timeout for waiting; if times out, 408 status code is returned + + */ + Timeout *int64 + + requestTimeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithRequestTimeout adds the timeout to the task manager wait task task Id get params +func (o *TaskManagerWaitTaskTaskIDGetParams) WithRequestTimeout(timeout time.Duration) *TaskManagerWaitTaskTaskIDGetParams { + o.SetRequestTimeout(timeout) + return o +} + +// SetRequestTimeout adds the timeout to the task manager wait task task Id get params +func (o *TaskManagerWaitTaskTaskIDGetParams) SetRequestTimeout(timeout time.Duration) { + o.requestTimeout = timeout +} + +// WithContext adds the context to the task manager wait task task Id get params +func (o *TaskManagerWaitTaskTaskIDGetParams) WithContext(ctx context.Context) *TaskManagerWaitTaskTaskIDGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the task manager wait task task Id get params +func (o *TaskManagerWaitTaskTaskIDGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the task manager wait task task Id get params +func (o *TaskManagerWaitTaskTaskIDGetParams) WithHTTPClient(client *http.Client) *TaskManagerWaitTaskTaskIDGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the task manager wait task task Id get params +func (o *TaskManagerWaitTaskTaskIDGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithTaskID adds the taskID to the task manager wait task task Id get params +func (o *TaskManagerWaitTaskTaskIDGetParams) WithTaskID(taskID string) *TaskManagerWaitTaskTaskIDGetParams { + o.SetTaskID(taskID) + return o +} + +// SetTaskID adds the taskId to the task manager wait task task Id get params +func (o *TaskManagerWaitTaskTaskIDGetParams) SetTaskID(taskID string) { + o.TaskID = taskID +} + +// WithTimeout adds the timeout to the task manager wait task task Id get params +func (o *TaskManagerWaitTaskTaskIDGetParams) WithTimeout(timeout *int64) *TaskManagerWaitTaskTaskIDGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the task manager wait task task Id get params +func (o *TaskManagerWaitTaskTaskIDGetParams) SetTimeout(timeout *int64) { + o.Timeout = timeout +} + +// WriteToRequest writes these params to a swagger request +func (o *TaskManagerWaitTaskTaskIDGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.requestTimeout); err != nil { + return err + } + var res []error + + // path param task_id + if err := r.SetPathParam("task_id", o.TaskID); err != nil { + return err + } + + if o.Timeout != nil { + + // query param timeout + var qrTimeout int64 + if o.Timeout != nil { + qrTimeout = *o.Timeout + } + qTimeout := swag.FormatInt64(qrTimeout) + if qTimeout != "" { + if err := r.SetQueryParam("timeout", qTimeout); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/v3/swagger/gen/scylla/v1/client/operations/task_manager_wait_task_task_id_get_responses.go b/v3/swagger/gen/scylla/v1/client/operations/task_manager_wait_task_task_id_get_responses.go new file mode 100644 index 0000000000..a64e48d52b --- /dev/null +++ b/v3/swagger/gen/scylla/v1/client/operations/task_manager_wait_task_task_id_get_responses.go @@ -0,0 +1,116 @@ +// 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" +) + +// TaskManagerWaitTaskTaskIDGetReader is a Reader for the TaskManagerWaitTaskTaskIDGet structure. +type TaskManagerWaitTaskTaskIDGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TaskManagerWaitTaskTaskIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTaskManagerWaitTaskTaskIDGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewTaskManagerWaitTaskTaskIDGetDefault(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 + } +} + +// NewTaskManagerWaitTaskTaskIDGetOK creates a TaskManagerWaitTaskTaskIDGetOK with default headers values +func NewTaskManagerWaitTaskTaskIDGetOK() *TaskManagerWaitTaskTaskIDGetOK { + return &TaskManagerWaitTaskTaskIDGetOK{} +} + +/* +TaskManagerWaitTaskTaskIDGetOK handles this case with default header values. + +Success +*/ +type TaskManagerWaitTaskTaskIDGetOK struct { + Payload *models.TaskStatus +} + +func (o *TaskManagerWaitTaskTaskIDGetOK) GetPayload() *models.TaskStatus { + return o.Payload +} + +func (o *TaskManagerWaitTaskTaskIDGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TaskStatus) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewTaskManagerWaitTaskTaskIDGetDefault creates a TaskManagerWaitTaskTaskIDGetDefault with default headers values +func NewTaskManagerWaitTaskTaskIDGetDefault(code int) *TaskManagerWaitTaskTaskIDGetDefault { + return &TaskManagerWaitTaskTaskIDGetDefault{ + _statusCode: code, + } +} + +/* +TaskManagerWaitTaskTaskIDGetDefault handles this case with default header values. + +internal server error +*/ +type TaskManagerWaitTaskTaskIDGetDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the task manager wait task task Id get default response +func (o *TaskManagerWaitTaskTaskIDGetDefault) Code() int { + return o._statusCode +} + +func (o *TaskManagerWaitTaskTaskIDGetDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *TaskManagerWaitTaskTaskIDGetDefault) 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 *TaskManagerWaitTaskTaskIDGetDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/v3/swagger/gen/scylla/v1/models/task_identity.go b/v3/swagger/gen/scylla/v1/models/task_identity.go new file mode 100644 index 0000000000..eecba4c268 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/models/task_identity.go @@ -0,0 +1,48 @@ +// 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 ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TaskIdentity task_identity +// +// # Id and node of a task +// +// swagger:model task_identity +type TaskIdentity struct { + + // Address of a server on which a task is created + Node string `json:"node,omitempty"` + + // The uuid of a task + TaskID string `json:"task_id,omitempty"` +} + +// Validate validates this task identity +func (m *TaskIdentity) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TaskIdentity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskIdentity) UnmarshalBinary(b []byte) error { + var res TaskIdentity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/v3/swagger/gen/scylla/v1/models/task_stats.go b/v3/swagger/gen/scylla/v1/models/task_stats.go new file mode 100644 index 0000000000..ac10aefd25 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/models/task_stats.go @@ -0,0 +1,180 @@ +// 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 ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TaskStats task_stats +// +// # A task statistics object +// +// swagger:model task_stats +type TaskStats struct { + + // Task-specific entity description + Entity string `json:"entity,omitempty"` + + // The keyspace the task is working on (if applicable) + Keyspace string `json:"keyspace,omitempty"` + + // The kind of a task + // Enum: [node cluster] + Kind string `json:"kind,omitempty"` + + // The scope of the task + Scope string `json:"scope,omitempty"` + + // The running sequence number of the task + SequenceNumber int64 `json:"sequence_number,omitempty"` + + // The state of a task + // Enum: [created running done failed] + State string `json:"state,omitempty"` + + // The table the task is working on (if applicable) + Table string `json:"table,omitempty"` + + // The uuid of a task + TaskID string `json:"task_id,omitempty"` + + // The description of the task + Type string `json:"type,omitempty"` +} + +// Validate validates this task stats +func (m *TaskStats) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateKind(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var taskStatsTypeKindPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["node","cluster"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + taskStatsTypeKindPropEnum = append(taskStatsTypeKindPropEnum, v) + } +} + +const ( + + // TaskStatsKindNode captures enum value "node" + TaskStatsKindNode string = "node" + + // TaskStatsKindCluster captures enum value "cluster" + TaskStatsKindCluster string = "cluster" +) + +// prop value enum +func (m *TaskStats) validateKindEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, taskStatsTypeKindPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *TaskStats) validateKind(formats strfmt.Registry) error { + + if swag.IsZero(m.Kind) { // not required + return nil + } + + // value enum + if err := m.validateKindEnum("kind", "body", m.Kind); err != nil { + return err + } + + return nil +} + +var taskStatsTypeStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["created","running","done","failed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + taskStatsTypeStatePropEnum = append(taskStatsTypeStatePropEnum, v) + } +} + +const ( + + // TaskStatsStateCreated captures enum value "created" + TaskStatsStateCreated string = "created" + + // TaskStatsStateRunning captures enum value "running" + TaskStatsStateRunning string = "running" + + // TaskStatsStateDone captures enum value "done" + TaskStatsStateDone string = "done" + + // TaskStatsStateFailed captures enum value "failed" + TaskStatsStateFailed string = "failed" +) + +// prop value enum +func (m *TaskStats) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, taskStatsTypeStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *TaskStats) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + // value enum + if err := m.validateStateEnum("state", "body", m.State); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TaskStats) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskStats) UnmarshalBinary(b []byte) error { + var res TaskStats + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/v3/swagger/gen/scylla/v1/models/task_status.go b/v3/swagger/gen/scylla/v1/models/task_status.go new file mode 100644 index 0000000000..e53dd2c3e4 --- /dev/null +++ b/v3/swagger/gen/scylla/v1/models/task_status.go @@ -0,0 +1,276 @@ +// 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 ( + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TaskStatus task_status +// +// # A task status object +// +// swagger:model task_status +type TaskStatus struct { + + // Task identities of children of this task + ChildrenIds []*TaskIdentity `json:"children_ids"` + + // The end time of the task (unspecified when the task is not completed) + // Format: date-time + EndTime strfmt.DateTime `json:"end_time,omitempty"` + + // Task-specific entity description + Entity string `json:"entity,omitempty"` + + // Error string, if the task failed + Error string `json:"error,omitempty"` + + // The uuid of the task + ID string `json:"id,omitempty"` + + // Boolean flag indicating whether the task can be aborted + IsAbortable bool `json:"is_abortable,omitempty"` + + // The keyspace the task is working on (if applicable) + Keyspace string `json:"keyspace,omitempty"` + + // The kind of a task + // Enum: [node cluster] + Kind string `json:"kind,omitempty"` + + // The uuid of the parent task + ParentID string `json:"parent_id,omitempty"` + + // The number of units completed so far + ProgressCompleted float64 `json:"progress_completed,omitempty"` + + // The total number of units to complete for the task + ProgressTotal float64 `json:"progress_total,omitempty"` + + // A description of the progress units + ProgressUnits string `json:"progress_units,omitempty"` + + // The scope of the task + Scope string `json:"scope,omitempty"` + + // The running sequence number of the task + SequenceNumber int64 `json:"sequence_number,omitempty"` + + // The number of a shard the task is running on + Shard int64 `json:"shard,omitempty"` + + // The start time of the task + // Format: date-time + StartTime strfmt.DateTime `json:"start_time,omitempty"` + + // The state of the task + // Enum: [created running done failed] + State string `json:"state,omitempty"` + + // The table the task is working on (if applicable) + Table string `json:"table,omitempty"` + + // The description of the task + Type string `json:"type,omitempty"` +} + +// Validate validates this task status +func (m *TaskStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChildrenIds(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEndTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKind(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TaskStatus) validateChildrenIds(formats strfmt.Registry) error { + + if swag.IsZero(m.ChildrenIds) { // not required + return nil + } + + for i := 0; i < len(m.ChildrenIds); i++ { + if swag.IsZero(m.ChildrenIds[i]) { // not required + continue + } + + if m.ChildrenIds[i] != nil { + if err := m.ChildrenIds[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("children_ids" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *TaskStatus) validateEndTime(formats strfmt.Registry) error { + + if swag.IsZero(m.EndTime) { // not required + return nil + } + + if err := validate.FormatOf("end_time", "body", "date-time", m.EndTime.String(), formats); err != nil { + return err + } + + return nil +} + +var taskStatusTypeKindPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["node","cluster"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + taskStatusTypeKindPropEnum = append(taskStatusTypeKindPropEnum, v) + } +} + +const ( + + // TaskStatusKindNode captures enum value "node" + TaskStatusKindNode string = "node" + + // TaskStatusKindCluster captures enum value "cluster" + TaskStatusKindCluster string = "cluster" +) + +// prop value enum +func (m *TaskStatus) validateKindEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, taskStatusTypeKindPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *TaskStatus) validateKind(formats strfmt.Registry) error { + + if swag.IsZero(m.Kind) { // not required + return nil + } + + // value enum + if err := m.validateKindEnum("kind", "body", m.Kind); err != nil { + return err + } + + return nil +} + +func (m *TaskStatus) validateStartTime(formats strfmt.Registry) error { + + if swag.IsZero(m.StartTime) { // not required + return nil + } + + if err := validate.FormatOf("start_time", "body", "date-time", m.StartTime.String(), formats); err != nil { + return err + } + + return nil +} + +var taskStatusTypeStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["created","running","done","failed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + taskStatusTypeStatePropEnum = append(taskStatusTypeStatePropEnum, v) + } +} + +const ( + + // TaskStatusStateCreated captures enum value "created" + TaskStatusStateCreated string = "created" + + // TaskStatusStateRunning captures enum value "running" + TaskStatusStateRunning string = "running" + + // TaskStatusStateDone captures enum value "done" + TaskStatusStateDone string = "done" + + // TaskStatusStateFailed captures enum value "failed" + TaskStatusStateFailed string = "failed" +) + +// prop value enum +func (m *TaskStatus) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, taskStatusTypeStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *TaskStatus) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + // value enum + if err := m.validateStateEnum("state", "body", m.State); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TaskStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TaskStatus) UnmarshalBinary(b []byte) error { + var res TaskStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/v3/swagger/scylla_v1.json b/v3/swagger/scylla_v1.json index 574e8c2333..73e40cfb20 100644 --- a/v3/swagger/scylla_v1.json +++ b/v3/swagger/scylla_v1.json @@ -12521,6 +12521,296 @@ "security": [] } }, + "/task_manager/list_modules": { + "get": { + "description": "Get all modules names", + "summary": "get_modules", + "operationId": "TaskManagerListModulesGet", + "deprecated": false, + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "default": { + "description": "internal server error", + "schema": { + "$ref": "#/definitions/ErrorModel" + } + } + } + } + }, + "/task_manager/list_module_tasks/{module}": { + "get": { + "description": "Get a list of tasks", + "summary": "get_tasks", + "operationId": "TaskManagerListModuleTasksModuleGet", + "deprecated": false, + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "module", + "in": "path", + "required": true, + "type": "string", + "description": "The module to query about" + }, + { + "name": "internal", + "in": "query", + "required": false, + "type": "boolean", + "description": "Boolean flag indicating whether internal tasks should be shown (false by default)" + }, + { + "name": "keyspace", + "in": "query", + "required": false, + "type": "string", + "description": "The keyspace to query about" + }, + { + "name": "table", + "in": "query", + "required": false, + "type": "string", + "description": "The table to query about" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/task_stats" + } + } + }, + "default": { + "description": "internal server error", + "schema": { + "$ref": "#/definitions/ErrorModel" + } + } + } + } + }, + "/task_manager/task_status/{task_id}": { + "get": { + "description": "Get task status", + "summary": "get_task_status", + "operationId": "TaskManagerTaskStatusTaskIdGet", + "deprecated": false, + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "task_id", + "in": "path", + "required": true, + "type": "string", + "description": "The uuid of a task to query about" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/task_status" + } + }, + "default": { + "description": "internal server error", + "schema": { + "$ref": "#/definitions/ErrorModel" + } + } + } + } + }, + "/task_manager/abort_task/{task_id}": { + "post": { + "description": "Abort running task and its descendants", + "summary": "abort_task", + "operationId": "TaskManagerAbortTaskTaskIdPost", + "deprecated": false, + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "task_id", + "in": "path", + "required": true, + "type": "string", + "description": "The uuid of a task to abort; if the task is not abortable, 403 status code is returned" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "default": { + "description": "internal server error", + "schema": { + "$ref": "#/definitions/ErrorModel" + } + } + } + } + }, + "/task_manager/wait_task/{task_id}": { + "get": { + "description": "Wait for a task to complete", + "summary": "wait_task", + "operationId": "TaskManagerWaitTaskTaskIdGet", + "deprecated": false, + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "task_id", + "in": "path", + "required": true, + "type": "string", + "description": "The uuid of a task to wait for" + }, + { + "name": "timeout", + "in": "query", + "required": false, + "type": "integer", + "format": "int64", + "description": "Timeout for waiting; if times out, 408 status code is returned" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/task_status" + } + }, + "default": { + "description": "internal server error", + "schema": { + "$ref": "#/definitions/ErrorModel" + } + } + } + } + }, + "/task_manager/task_status_recursive/{task_id}": { + "get": { + "description": "Get statuses of the task and all its descendants", + "summary": "get_task_status_recursively", + "operationId": "TaskManagerTaskStatusRecursiveTaskIdGet", + "deprecated": false, + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "task_id", + "in": "path", + "required": true, + "type": "string", + "description": "The uuid of a task to query about" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/task_status" + } + } + }, + "default": { + "description": "internal server error", + "schema": { + "$ref": "#/definitions/ErrorModel" + } + } + } + } + }, + "/task_manager/ttl": { + "get": { + "description": "Get current ttl value", + "summary": "get_ttl", + "operationId": "TaskManagerTtlGet", + "deprecated": false, + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "integer", + "format": "int64" + } + }, + "default": { + "description": "internal server error", + "schema": { + "$ref": "#/definitions/ErrorModel" + } + } + } + }, + "post": { + "description":"Set ttl in seconds and get last value", + "summary":"get_and_update_ttl", + "operationId": "TaskManagerTtlPost", + "deprecated": false, + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "ttl", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "description": "The number of seconds for which the tasks will be kept in memory after it finishes" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "integer", + "format": "int64" + } + }, + "default": { + "description": "internal server error", + "schema": { + "$ref": "#/definitions/ErrorModel" + } + } + } + } + }, "/stream_manager/": { "get": { "description": "Returns the current state of all ongoing streams.", @@ -13643,6 +13933,177 @@ "GET_SCHEMA_VERSION" ] }, + "task_identity": { + "title": "task_identity", + "description": "Id and node of a task", + "type": "object", + "properties": { + "node": { + "description": "Address of a server on which a task is created", + "type": "string" + }, + "task_id": { + "description": "The uuid of a task", + "type": "string" + } + } + }, + "task_stats": { + "title": "task_stats", + "description": "A task statistics object", + "type": "object", + "properties": { + "entity": { + "description": "Task-specific entity description", + "type": "string" + }, + "keyspace": { + "description": "The keyspace the task is working on (if applicable)", + "type": "string" + }, + "kind": { + "description": "The kind of a task", + "enum": [ + "node", + "cluster" + ], + "type": "string" + }, + "scope": { + "description": "The scope of the task", + "type": "string" + }, + "sequence_number": { + "description": "The running sequence number of the task", + "type": "integer", + "format": "int64" + }, + "state": { + "description": "The state of a task", + "enum": [ + "created", + "running", + "done", + "failed" + ], + "type": "string" + }, + "table": { + "description": "The table the task is working on (if applicable)", + "type": "string" + }, + "task_id": { + "description": "The uuid of a task", + "type": "string" + }, + "type": { + "description": "The description of the task", + "type": "string" + } + } + }, + "task_status": { + "title": "task_status", + "description": "A task status object", + "type": "object", + "properties": { + "children_ids": { + "description": "Task identities of children of this task", + "type": "array", + "items": { + "$ref": "#/definitions/task_identity" + } + }, + "end_time": { + "description": "The end time of the task (unspecified when the task is not completed)", + "type": "string", + "format": "date-time" + }, + "entity": { + "description": "Task-specific entity description", + "type": "string" + }, + "error": { + "description": "Error string, if the task failed", + "type": "string" + }, + "id": { + "description": "The uuid of the task", + "type": "string" + }, + "is_abortable": { + "description": "Boolean flag indicating whether the task can be aborted", + "type": "boolean" + }, + "keyspace": { + "description": "The keyspace the task is working on (if applicable)", + "type": "string" + }, + "kind": { + "description": "The kind of a task", + "enum": [ + "node", + "cluster" + ], + "type": "string" + }, + "parent_id": { + "description": "The uuid of the parent task", + "type": "string" + }, + "progress_completed": { + "description": "The number of units completed so far", + "format": "double", + "type": "number" + }, + "progress_total": { + "description": "The total number of units to complete for the task", + "type": "number", + "format": "double" + }, + "progress_units": { + "description": "A description of the progress units", + "type": "string" + }, + "scope": { + "description": "The scope of the task", + "type": "string" + }, + "sequence_number": { + "description": "The running sequence number of the task", + "type": "integer", + "format": "int64" + }, + "shard": { + "description": "The number of a shard the task is running on", + "type": "integer", + "format": "int64" + }, + "start_time": { + "description": "The start time of the task", + "type": "string", + "format": "date-time" + }, + "state": { + "description": "The state of the task", + "enum": [ + "created", + "running", + "done", + "failed" + ], + "type": "string" + }, + "table": { + "description": "The table the task is working on (if applicable)", + "type": "string" + }, + "type": { + "description": "The description of the task", + "type": "string" + } + } + }, "ErrorModel": { "type": "object", "properties": {