From b1ba8287ff49ebc8434795885de1ee9693c3e96f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Leszczy=C5=84ski?= <2000michal@wp.pl> Date: Wed, 13 Nov 2024 10:40:15 +0100 Subject: [PATCH 1/3] chore(go.mod): bump SM submodules versions --- go.mod | 6 +- go.sum | 12 +- v3/pkg/managerclient/go.mod | 4 +- v3/pkg/managerclient/go.sum | 8 +- .../v1/client/operations/operations_client.go | 407 ++++++++++++++++++ .../raft_read_barrier_post_parameters.go | 180 ++++++++ .../raft_read_barrier_post_responses.go | 104 +++++ .../storage_service_backup_post_parameters.go | 272 ++++++++++++ .../storage_service_backup_post_responses.go | 114 +++++ ...storage_service_restore_post_parameters.go | 262 +++++++++++ .../storage_service_restore_post_responses.go | 114 +++++ ...ager_abort_task_task_id_post_parameters.go | 136 ++++++ ...nager_abort_task_task_id_post_responses.go | 104 +++++ ...list_module_tasks_module_get_parameters.go | 233 ++++++++++ ..._list_module_tasks_module_get_responses.go | 114 +++++ ...ask_manager_list_modules_get_parameters.go | 113 +++++ ...task_manager_list_modules_get_responses.go | 114 +++++ ...status_recursive_task_id_get_parameters.go | 136 ++++++ ..._status_recursive_task_id_get_responses.go | 114 +++++ ...ager_task_status_task_id_get_parameters.go | 136 ++++++ ...nager_task_status_task_id_get_responses.go | 116 +++++ .../task_manager_ttl_get_parameters.go | 113 +++++ .../task_manager_ttl_get_responses.go | 114 +++++ .../task_manager_ttl_post_parameters.go | 141 ++++++ .../task_manager_ttl_post_responses.go | 114 +++++ ...anager_wait_task_task_id_get_parameters.go | 169 ++++++++ ...manager_wait_task_task_id_get_responses.go | 116 +++++ .../gen/scylla/v1/models/task_identity.go | 48 +++ .../gen/scylla/v1/models/task_stats.go | 180 ++++++++ .../gen/scylla/v1/models/task_status.go | 276 ++++++++++++ vendor/modules.txt | 12 +- 31 files changed, 4061 insertions(+), 21 deletions(-) create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/raft_read_barrier_post_parameters.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/raft_read_barrier_post_responses.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_backup_post_parameters.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_backup_post_responses.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_restore_post_parameters.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_restore_post_responses.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_abort_task_task_id_post_parameters.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_abort_task_task_id_post_responses.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_module_tasks_module_get_parameters.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_module_tasks_module_get_responses.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_modules_get_parameters.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_modules_get_responses.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_recursive_task_id_get_parameters.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_recursive_task_id_get_responses.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_task_id_get_parameters.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_task_id_get_responses.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_get_parameters.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_get_responses.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_post_parameters.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_post_responses.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_wait_task_task_id_get_parameters.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_wait_task_task_id_get_responses.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/task_identity.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/task_stats.go create mode 100644 vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/task_status.go diff --git a/go.mod b/go.mod index cd0b751863..b0441f9ac6 100644 --- a/go.mod +++ b/go.mod @@ -29,9 +29,9 @@ require ( github.com/scylladb/go-reflectx v1.0.1 github.com/scylladb/go-set v1.0.2 github.com/scylladb/gocqlx/v2 v2.8.0 - github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20241104134613-aba35605c28b - github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241104134613-aba35605c28b - github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241104134613-aba35605c28b + github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20241113064359-18103e06f366 + github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241113064359-18103e06f366 + github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241113064359-18103e06f366 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/stoewer/go-strcase v1.3.0 diff --git a/go.sum b/go.sum index e1d5ec998e..06215593db 100644 --- a/go.sum +++ b/go.sum @@ -1053,12 +1053,12 @@ github.com/scylladb/google-api-go-client v0.34.1-patched h1:DW+T0HA+74o6FDr3TFzV github.com/scylladb/google-api-go-client v0.34.1-patched/go.mod h1:RriRmS2wJXH+2yd9PRTEcR380U9AXmurWwznqVhzsSc= github.com/scylladb/rclone v1.54.1-0.20240312172628-afe1fd2aa65e h1:lJRphCtu+nKd+mfo8whOTeFkgjMWvk8iCSlqgibKSa8= github.com/scylladb/rclone v1.54.1-0.20240312172628-afe1fd2aa65e/go.mod h1:JGZp4EvCUK+6AM1Fe1dye5xvihTc/Bk0WnHHSCJOePM= -github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20241104134613-aba35605c28b h1:JRDV1d1FIiH0TIyHVmTAILAjQ2f8O4t7ZtZ/S+fT2sY= -github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20241104134613-aba35605c28b/go.mod h1:Tss7a99vrgds+B70w8ZFG3Skxfr9Br3kAzrKP2b3CmQ= -github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241104134613-aba35605c28b h1:7CHNmPrQqSdApaEh5nkRL+D52KFHaOHVBBVDvytHEOY= -github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241104134613-aba35605c28b/go.mod h1:+sPCx2oaOXmMpy/ODNNEDGJ7vCghBeKP4S7xEfMI+eA= -github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241104134613-aba35605c28b h1:kKMaQhh+ThnPRmCbcatvvfBtglYEFrs5bKaBRIKL/bM= -github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241104134613-aba35605c28b/go.mod h1:Oxfuz1XcXi9iV4ggSGfQdn+p6gPz6djPOegRMMe/6/s= +github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20241113064359-18103e06f366 h1:Vg4xD0sfXT6OoTHZZ10vQQ20Kyjpxna9H1JJJ1Er2lg= +github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20241113064359-18103e06f366/go.mod h1:7+yHDmds+qO/8b0w4xTptCLh/Gr/hXyAjIIZkMj4KHk= +github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241113064359-18103e06f366 h1:4r8mRYxPDDFQYuMIAniCJLSA+ZgdSJfCWb6dflr56CY= +github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241113064359-18103e06f366/go.mod h1:VKqHSrDj9zfgCKilpbdpmqV1TjmSglt/df79eIg6wuI= +github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241113064359-18103e06f366 h1:jHTOgp7WDhvNwmrqZk2J6PNRPDU52L3lEHUH4MAAceA= +github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241113064359-18103e06f366/go.mod h1:nCN5P0jiWL0W7jbcZ9p0ndtZAPoyEWXefddx/nbyFes= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4 h1:8qmTC5ByIXO3GP/IzBkxcZ/99VITvnIETDhdFz/om7A= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg= github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= diff --git a/v3/pkg/managerclient/go.mod b/v3/pkg/managerclient/go.mod index d0f7a7ca70..8c83aa19e3 100644 --- a/v3/pkg/managerclient/go.mod +++ b/v3/pkg/managerclient/go.mod @@ -10,8 +10,8 @@ require ( github.com/lnquy/cron v1.1.1 github.com/pkg/errors v0.9.1 github.com/scylladb/go-set v1.0.2 - github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241030073626-e409ae491c83 - github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241030073626-e409ae491c83 + github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241113064359-18103e06f366 + github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241113064359-18103e06f366 github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4 ) diff --git a/v3/pkg/managerclient/go.sum b/v3/pkg/managerclient/go.sum index 1ecdbc4ef5..c254e79e74 100644 --- a/v3/pkg/managerclient/go.sum +++ b/v3/pkg/managerclient/go.sum @@ -84,10 +84,10 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/scylladb/go-set v1.0.2 h1:SkvlMCKhP0wyyct6j+0IHJkBkSZL+TDzZ4E7f7BCcRE= github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs= -github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241030073626-e409ae491c83 h1:6kyuL5XXRTPbBSUessmfz6TxhYgOiIHCwC63wvDExgQ= -github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241030073626-e409ae491c83/go.mod h1:+sPCx2oaOXmMpy/ODNNEDGJ7vCghBeKP4S7xEfMI+eA= -github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241030073626-e409ae491c83 h1:+2wvERSjYAhGushwWpqw8EemmntHOIcCjHCWzEdpXcM= -github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241030073626-e409ae491c83/go.mod h1:Oxfuz1XcXi9iV4ggSGfQdn+p6gPz6djPOegRMMe/6/s= +github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241113064359-18103e06f366 h1:4r8mRYxPDDFQYuMIAniCJLSA+ZgdSJfCWb6dflr56CY= +github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241113064359-18103e06f366/go.mod h1:VKqHSrDj9zfgCKilpbdpmqV1TjmSglt/df79eIg6wuI= +github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241113064359-18103e06f366 h1:jHTOgp7WDhvNwmrqZk2J6PNRPDU52L3lEHUH4MAAceA= +github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241113064359-18103e06f366/go.mod h1:nCN5P0jiWL0W7jbcZ9p0ndtZAPoyEWXefddx/nbyFes= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4 h1:8qmTC5ByIXO3GP/IzBkxcZ/99VITvnIETDhdFz/om7A= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/operations_client.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/operations_client.go index 0e9a09324d..cea2dd1b85 100644 --- a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/operations_client.go +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/operations_client.go @@ -469,6 +469,8 @@ type ClientService interface { MessagingServiceVersionGet(params *MessagingServiceVersionGetParams) (*MessagingServiceVersionGetOK, error) + RaftReadBarrierPost(params *RaftReadBarrierPostParams) (*RaftReadBarrierPostOK, error) + SnitchDatacenterGet(params *SnitchDatacenterGetParams) (*SnitchDatacenterGetOK, error) SnitchNameGet(params *SnitchNameGetParams) (*SnitchNameGetOK, error) @@ -607,6 +609,8 @@ type ClientService interface { StorageServiceAutoCompactionByKeyspacePost(params *StorageServiceAutoCompactionByKeyspacePostParams) (*StorageServiceAutoCompactionByKeyspacePostOK, error) + StorageServiceBackupPost(params *StorageServiceBackupPostParams) (*StorageServiceBackupPostOK, error) + StorageServiceBatchSizeFailureThresholdGet(params *StorageServiceBatchSizeFailureThresholdGetParams) (*StorageServiceBatchSizeFailureThresholdGetOK, error) StorageServiceBatchSizeFailureThresholdPost(params *StorageServiceBatchSizeFailureThresholdPostParams) (*StorageServiceBatchSizeFailureThresholdPostOK, error) @@ -741,6 +745,8 @@ type ClientService interface { StorageServiceRescheduleFailedDeletionsPost(params *StorageServiceRescheduleFailedDeletionsPostParams) (*StorageServiceRescheduleFailedDeletionsPostOK, error) + StorageServiceRestorePost(params *StorageServiceRestorePostParams) (*StorageServiceRestorePostOK, error) + StorageServiceRPCServerDelete(params *StorageServiceRPCServerDeleteParams) (*StorageServiceRPCServerDeleteOK, error) StorageServiceRPCServerGet(params *StorageServiceRPCServerGetParams) (*StorageServiceRPCServerGetOK, error) @@ -821,6 +827,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) } @@ -8594,6 +8616,41 @@ func (a *Client) MessagingServiceVersionGet(params *MessagingServiceVersionGetPa return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +RaftReadBarrierPost reads barrier + +Triggers read barrier for the given Raft group to wait for previously committed commands in this group to be applied locally. For example, can be used on group 0 to wait for the node to obtain latest schema changes. +*/ +func (a *Client) RaftReadBarrierPost(params *RaftReadBarrierPostParams) (*RaftReadBarrierPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRaftReadBarrierPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "RaftReadBarrierPost", + Method: "POST", + PathPattern: "/raft/read_barrier", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &RaftReadBarrierPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*RaftReadBarrierPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*RaftReadBarrierPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* SnitchDatacenterGet gets datacenter @@ -11009,6 +11066,41 @@ func (a *Client) StorageServiceAutoCompactionByKeyspacePost(params *StorageServi return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +StorageServiceBackupPost starts backup + +Starts copying SSTables from a specified keyspace to a designated bucket in object storage +*/ +func (a *Client) StorageServiceBackupPost(params *StorageServiceBackupPostParams) (*StorageServiceBackupPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceBackupPostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceBackupPost", + Method: "POST", + PathPattern: "/storage_service/backup", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceBackupPostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceBackupPostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceBackupPostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* StorageServiceBatchSizeFailureThresholdGet gets batch size failure threshold @@ -13348,6 +13440,41 @@ func (a *Client) StorageServiceRescheduleFailedDeletionsPost(params *StorageServ return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +StorageServiceRestorePost starts restore + +Starts copying SSTables from a designated bucket in object storage to a specified keyspace +*/ +func (a *Client) StorageServiceRestorePost(params *StorageServiceRestorePostParams) (*StorageServiceRestorePostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewStorageServiceRestorePostParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "StorageServiceRestorePost", + Method: "POST", + PathPattern: "/storage_service/restore", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &StorageServiceRestorePostReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*StorageServiceRestorePostOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*StorageServiceRestorePostDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* StorageServiceRPCServerDelete stops rpc server @@ -14744,6 +14871,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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/raft_read_barrier_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/raft_read_barrier_post_parameters.go new file mode 100644 index 0000000000..a6204e93ae --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/raft_read_barrier_post_parameters.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "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" +) + +// NewRaftReadBarrierPostParams creates a new RaftReadBarrierPostParams object +// with the default values initialized. +func NewRaftReadBarrierPostParams() *RaftReadBarrierPostParams { + var () + return &RaftReadBarrierPostParams{ + + requestTimeout: cr.DefaultTimeout, + } +} + +// NewRaftReadBarrierPostParamsWithTimeout creates a new RaftReadBarrierPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewRaftReadBarrierPostParamsWithTimeout(timeout time.Duration) *RaftReadBarrierPostParams { + var () + return &RaftReadBarrierPostParams{ + + requestTimeout: timeout, + } +} + +// NewRaftReadBarrierPostParamsWithContext creates a new RaftReadBarrierPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewRaftReadBarrierPostParamsWithContext(ctx context.Context) *RaftReadBarrierPostParams { + var () + return &RaftReadBarrierPostParams{ + + Context: ctx, + } +} + +// NewRaftReadBarrierPostParamsWithHTTPClient creates a new RaftReadBarrierPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewRaftReadBarrierPostParamsWithHTTPClient(client *http.Client) *RaftReadBarrierPostParams { + var () + return &RaftReadBarrierPostParams{ + HTTPClient: client, + } +} + +/* +RaftReadBarrierPostParams contains all the parameters to send to the API endpoint +for the raft read barrier post operation typically these are written to a http.Request +*/ +type RaftReadBarrierPostParams struct { + + /*GroupID + The ID of the group. When absent, group0 is used. + + */ + GroupID *string + /*Timeout + Timeout in seconds after which the endpoint returns a failure. If not provided, 60s is used. + + */ + Timeout *int64 + + requestTimeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithRequestTimeout adds the timeout to the raft read barrier post params +func (o *RaftReadBarrierPostParams) WithRequestTimeout(timeout time.Duration) *RaftReadBarrierPostParams { + o.SetRequestTimeout(timeout) + return o +} + +// SetRequestTimeout adds the timeout to the raft read barrier post params +func (o *RaftReadBarrierPostParams) SetRequestTimeout(timeout time.Duration) { + o.requestTimeout = timeout +} + +// WithContext adds the context to the raft read barrier post params +func (o *RaftReadBarrierPostParams) WithContext(ctx context.Context) *RaftReadBarrierPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the raft read barrier post params +func (o *RaftReadBarrierPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the raft read barrier post params +func (o *RaftReadBarrierPostParams) WithHTTPClient(client *http.Client) *RaftReadBarrierPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the raft read barrier post params +func (o *RaftReadBarrierPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGroupID adds the groupID to the raft read barrier post params +func (o *RaftReadBarrierPostParams) WithGroupID(groupID *string) *RaftReadBarrierPostParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the raft read barrier post params +func (o *RaftReadBarrierPostParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithTimeout adds the timeout to the raft read barrier post params +func (o *RaftReadBarrierPostParams) WithTimeout(timeout *int64) *RaftReadBarrierPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the raft read barrier post params +func (o *RaftReadBarrierPostParams) SetTimeout(timeout *int64) { + o.Timeout = timeout +} + +// WriteToRequest writes these params to a swagger request +func (o *RaftReadBarrierPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.requestTimeout); err != nil { + return err + } + var res []error + + if o.GroupID != nil { + + // query param group_id + var qrGroupID string + if o.GroupID != nil { + qrGroupID = *o.GroupID + } + qGroupID := qrGroupID + if qGroupID != "" { + if err := r.SetQueryParam("group_id", qGroupID); 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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/raft_read_barrier_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/raft_read_barrier_post_responses.go new file mode 100644 index 0000000000..3fb1b9e3fb --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/raft_read_barrier_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" +) + +// RaftReadBarrierPostReader is a Reader for the RaftReadBarrierPost structure. +type RaftReadBarrierPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RaftReadBarrierPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRaftReadBarrierPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewRaftReadBarrierPostDefault(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 + } +} + +// NewRaftReadBarrierPostOK creates a RaftReadBarrierPostOK with default headers values +func NewRaftReadBarrierPostOK() *RaftReadBarrierPostOK { + return &RaftReadBarrierPostOK{} +} + +/* +RaftReadBarrierPostOK handles this case with default header values. + +Success +*/ +type RaftReadBarrierPostOK struct { +} + +func (o *RaftReadBarrierPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewRaftReadBarrierPostDefault creates a RaftReadBarrierPostDefault with default headers values +func NewRaftReadBarrierPostDefault(code int) *RaftReadBarrierPostDefault { + return &RaftReadBarrierPostDefault{ + _statusCode: code, + } +} + +/* +RaftReadBarrierPostDefault handles this case with default header values. + +internal server error +*/ +type RaftReadBarrierPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the raft read barrier post default response +func (o *RaftReadBarrierPostDefault) Code() int { + return o._statusCode +} + +func (o *RaftReadBarrierPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *RaftReadBarrierPostDefault) 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 *RaftReadBarrierPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_backup_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_backup_post_parameters.go new file mode 100644 index 0000000000..97afbd5278 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_backup_post_parameters.go @@ -0,0 +1,272 @@ +// 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" +) + +// NewStorageServiceBackupPostParams creates a new StorageServiceBackupPostParams object +// with the default values initialized. +func NewStorageServiceBackupPostParams() *StorageServiceBackupPostParams { + var () + return &StorageServiceBackupPostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceBackupPostParamsWithTimeout creates a new StorageServiceBackupPostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceBackupPostParamsWithTimeout(timeout time.Duration) *StorageServiceBackupPostParams { + var () + return &StorageServiceBackupPostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceBackupPostParamsWithContext creates a new StorageServiceBackupPostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceBackupPostParamsWithContext(ctx context.Context) *StorageServiceBackupPostParams { + var () + return &StorageServiceBackupPostParams{ + + Context: ctx, + } +} + +// NewStorageServiceBackupPostParamsWithHTTPClient creates a new StorageServiceBackupPostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceBackupPostParamsWithHTTPClient(client *http.Client) *StorageServiceBackupPostParams { + var () + return &StorageServiceBackupPostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceBackupPostParams contains all the parameters to send to the API endpoint +for the storage service backup post operation typically these are written to a http.Request +*/ +type StorageServiceBackupPostParams struct { + + /*Bucket + Name of the bucket to backup sstables to + + */ + Bucket string + /*Endpoint + ID of the configured object storage endpoint to copy sstables to + + */ + Endpoint string + /*Keyspace + Name of a keyspace to copy sstables from + + */ + Keyspace string + /*Prefix + The prefix of the objects for the backuped sstables + + */ + Prefix string + /*Snapshot + Name of a snapshot to copy sstables from + + */ + Snapshot *string + /*Table + Name of a table to copy sstables from + + */ + Table string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service backup post params +func (o *StorageServiceBackupPostParams) WithTimeout(timeout time.Duration) *StorageServiceBackupPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service backup post params +func (o *StorageServiceBackupPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service backup post params +func (o *StorageServiceBackupPostParams) WithContext(ctx context.Context) *StorageServiceBackupPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service backup post params +func (o *StorageServiceBackupPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service backup post params +func (o *StorageServiceBackupPostParams) WithHTTPClient(client *http.Client) *StorageServiceBackupPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service backup post params +func (o *StorageServiceBackupPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucket adds the bucket to the storage service backup post params +func (o *StorageServiceBackupPostParams) WithBucket(bucket string) *StorageServiceBackupPostParams { + o.SetBucket(bucket) + return o +} + +// SetBucket adds the bucket to the storage service backup post params +func (o *StorageServiceBackupPostParams) SetBucket(bucket string) { + o.Bucket = bucket +} + +// WithEndpoint adds the endpoint to the storage service backup post params +func (o *StorageServiceBackupPostParams) WithEndpoint(endpoint string) *StorageServiceBackupPostParams { + o.SetEndpoint(endpoint) + return o +} + +// SetEndpoint adds the endpoint to the storage service backup post params +func (o *StorageServiceBackupPostParams) SetEndpoint(endpoint string) { + o.Endpoint = endpoint +} + +// WithKeyspace adds the keyspace to the storage service backup post params +func (o *StorageServiceBackupPostParams) WithKeyspace(keyspace string) *StorageServiceBackupPostParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service backup post params +func (o *StorageServiceBackupPostParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WithPrefix adds the prefix to the storage service backup post params +func (o *StorageServiceBackupPostParams) WithPrefix(prefix string) *StorageServiceBackupPostParams { + o.SetPrefix(prefix) + return o +} + +// SetPrefix adds the prefix to the storage service backup post params +func (o *StorageServiceBackupPostParams) SetPrefix(prefix string) { + o.Prefix = prefix +} + +// WithSnapshot adds the snapshot to the storage service backup post params +func (o *StorageServiceBackupPostParams) WithSnapshot(snapshot *string) *StorageServiceBackupPostParams { + o.SetSnapshot(snapshot) + return o +} + +// SetSnapshot adds the snapshot to the storage service backup post params +func (o *StorageServiceBackupPostParams) SetSnapshot(snapshot *string) { + o.Snapshot = snapshot +} + +// WithTable adds the table to the storage service backup post params +func (o *StorageServiceBackupPostParams) WithTable(table string) *StorageServiceBackupPostParams { + o.SetTable(table) + return o +} + +// SetTable adds the table to the storage service backup post params +func (o *StorageServiceBackupPostParams) SetTable(table string) { + o.Table = table +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceBackupPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param bucket + qrBucket := o.Bucket + qBucket := qrBucket + if qBucket != "" { + if err := r.SetQueryParam("bucket", qBucket); err != nil { + return err + } + } + + // query param endpoint + qrEndpoint := o.Endpoint + qEndpoint := qrEndpoint + if qEndpoint != "" { + if err := r.SetQueryParam("endpoint", qEndpoint); err != nil { + return err + } + } + + // query param keyspace + qrKeyspace := o.Keyspace + qKeyspace := qrKeyspace + if qKeyspace != "" { + if err := r.SetQueryParam("keyspace", qKeyspace); err != nil { + return err + } + } + + // query param prefix + qrPrefix := o.Prefix + qPrefix := qrPrefix + if qPrefix != "" { + if err := r.SetQueryParam("prefix", qPrefix); err != nil { + return err + } + } + + if o.Snapshot != nil { + + // query param snapshot + var qrSnapshot string + if o.Snapshot != nil { + qrSnapshot = *o.Snapshot + } + qSnapshot := qrSnapshot + if qSnapshot != "" { + if err := r.SetQueryParam("snapshot", qSnapshot); err != nil { + return err + } + } + + } + + // query param table + 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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_backup_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_backup_post_responses.go new file mode 100644 index 0000000000..4b82870cf0 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_backup_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" +) + +// StorageServiceBackupPostReader is a Reader for the StorageServiceBackupPost structure. +type StorageServiceBackupPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceBackupPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceBackupPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceBackupPostDefault(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 + } +} + +// NewStorageServiceBackupPostOK creates a StorageServiceBackupPostOK with default headers values +func NewStorageServiceBackupPostOK() *StorageServiceBackupPostOK { + return &StorageServiceBackupPostOK{} +} + +/* +StorageServiceBackupPostOK handles this case with default header values. + +Task ID that can be used with Task Manager service +*/ +type StorageServiceBackupPostOK struct { + Payload string +} + +func (o *StorageServiceBackupPostOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceBackupPostOK) 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 +} + +// NewStorageServiceBackupPostDefault creates a StorageServiceBackupPostDefault with default headers values +func NewStorageServiceBackupPostDefault(code int) *StorageServiceBackupPostDefault { + return &StorageServiceBackupPostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceBackupPostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceBackupPostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service backup post default response +func (o *StorageServiceBackupPostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceBackupPostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceBackupPostDefault) 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 *StorageServiceBackupPostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_restore_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_restore_post_parameters.go new file mode 100644 index 0000000000..9f82be72e7 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_restore_post_parameters.go @@ -0,0 +1,262 @@ +// 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" +) + +// NewStorageServiceRestorePostParams creates a new StorageServiceRestorePostParams object +// with the default values initialized. +func NewStorageServiceRestorePostParams() *StorageServiceRestorePostParams { + var () + return &StorageServiceRestorePostParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewStorageServiceRestorePostParamsWithTimeout creates a new StorageServiceRestorePostParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewStorageServiceRestorePostParamsWithTimeout(timeout time.Duration) *StorageServiceRestorePostParams { + var () + return &StorageServiceRestorePostParams{ + + timeout: timeout, + } +} + +// NewStorageServiceRestorePostParamsWithContext creates a new StorageServiceRestorePostParams object +// with the default values initialized, and the ability to set a context for a request +func NewStorageServiceRestorePostParamsWithContext(ctx context.Context) *StorageServiceRestorePostParams { + var () + return &StorageServiceRestorePostParams{ + + Context: ctx, + } +} + +// NewStorageServiceRestorePostParamsWithHTTPClient creates a new StorageServiceRestorePostParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewStorageServiceRestorePostParamsWithHTTPClient(client *http.Client) *StorageServiceRestorePostParams { + var () + return &StorageServiceRestorePostParams{ + HTTPClient: client, + } +} + +/* +StorageServiceRestorePostParams contains all the parameters to send to the API endpoint +for the storage service restore post operation typically these are written to a http.Request +*/ +type StorageServiceRestorePostParams struct { + + /*Bucket + Name of the bucket to read SSTables from + + */ + Bucket string + /*Endpoint + ID of the configured object storage endpoint to copy SSTables from + + */ + Endpoint string + /*Keyspace + Name of a keyspace to copy SSTables to + + */ + Keyspace string + /*Prefix + The prefix of the object keys for the backuped SSTables + + */ + Prefix string + /*Sstables + The list of the object keys of the TOC component of the SSTables to be restored + + */ + Sstables []string + /*Table + Name of a table to copy SSTables to + + */ + Table string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the storage service restore post params +func (o *StorageServiceRestorePostParams) WithTimeout(timeout time.Duration) *StorageServiceRestorePostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the storage service restore post params +func (o *StorageServiceRestorePostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the storage service restore post params +func (o *StorageServiceRestorePostParams) WithContext(ctx context.Context) *StorageServiceRestorePostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the storage service restore post params +func (o *StorageServiceRestorePostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the storage service restore post params +func (o *StorageServiceRestorePostParams) WithHTTPClient(client *http.Client) *StorageServiceRestorePostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the storage service restore post params +func (o *StorageServiceRestorePostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBucket adds the bucket to the storage service restore post params +func (o *StorageServiceRestorePostParams) WithBucket(bucket string) *StorageServiceRestorePostParams { + o.SetBucket(bucket) + return o +} + +// SetBucket adds the bucket to the storage service restore post params +func (o *StorageServiceRestorePostParams) SetBucket(bucket string) { + o.Bucket = bucket +} + +// WithEndpoint adds the endpoint to the storage service restore post params +func (o *StorageServiceRestorePostParams) WithEndpoint(endpoint string) *StorageServiceRestorePostParams { + o.SetEndpoint(endpoint) + return o +} + +// SetEndpoint adds the endpoint to the storage service restore post params +func (o *StorageServiceRestorePostParams) SetEndpoint(endpoint string) { + o.Endpoint = endpoint +} + +// WithKeyspace adds the keyspace to the storage service restore post params +func (o *StorageServiceRestorePostParams) WithKeyspace(keyspace string) *StorageServiceRestorePostParams { + o.SetKeyspace(keyspace) + return o +} + +// SetKeyspace adds the keyspace to the storage service restore post params +func (o *StorageServiceRestorePostParams) SetKeyspace(keyspace string) { + o.Keyspace = keyspace +} + +// WithPrefix adds the prefix to the storage service restore post params +func (o *StorageServiceRestorePostParams) WithPrefix(prefix string) *StorageServiceRestorePostParams { + o.SetPrefix(prefix) + return o +} + +// SetPrefix adds the prefix to the storage service restore post params +func (o *StorageServiceRestorePostParams) SetPrefix(prefix string) { + o.Prefix = prefix +} + +// WithSstables adds the sstables to the storage service restore post params +func (o *StorageServiceRestorePostParams) WithSstables(sstables []string) *StorageServiceRestorePostParams { + o.SetSstables(sstables) + return o +} + +// SetSstables adds the sstables to the storage service restore post params +func (o *StorageServiceRestorePostParams) SetSstables(sstables []string) { + o.Sstables = sstables +} + +// WithTable adds the table to the storage service restore post params +func (o *StorageServiceRestorePostParams) WithTable(table string) *StorageServiceRestorePostParams { + o.SetTable(table) + return o +} + +// SetTable adds the table to the storage service restore post params +func (o *StorageServiceRestorePostParams) SetTable(table string) { + o.Table = table +} + +// WriteToRequest writes these params to a swagger request +func (o *StorageServiceRestorePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // query param bucket + qrBucket := o.Bucket + qBucket := qrBucket + if qBucket != "" { + if err := r.SetQueryParam("bucket", qBucket); err != nil { + return err + } + } + + // query param endpoint + qrEndpoint := o.Endpoint + qEndpoint := qrEndpoint + if qEndpoint != "" { + if err := r.SetQueryParam("endpoint", qEndpoint); err != nil { + return err + } + } + + // query param keyspace + qrKeyspace := o.Keyspace + qKeyspace := qrKeyspace + if qKeyspace != "" { + if err := r.SetQueryParam("keyspace", qKeyspace); err != nil { + return err + } + } + + // query param prefix + qrPrefix := o.Prefix + qPrefix := qrPrefix + if qPrefix != "" { + if err := r.SetQueryParam("prefix", qPrefix); err != nil { + return err + } + } + + if o.Sstables != nil { + if err := r.SetBodyParam(o.Sstables); err != nil { + return err + } + } + + // query param table + 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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_restore_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_restore_post_responses.go new file mode 100644 index 0000000000..10edb2f607 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/storage_service_restore_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" +) + +// StorageServiceRestorePostReader is a Reader for the StorageServiceRestorePost structure. +type StorageServiceRestorePostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *StorageServiceRestorePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewStorageServiceRestorePostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewStorageServiceRestorePostDefault(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 + } +} + +// NewStorageServiceRestorePostOK creates a StorageServiceRestorePostOK with default headers values +func NewStorageServiceRestorePostOK() *StorageServiceRestorePostOK { + return &StorageServiceRestorePostOK{} +} + +/* +StorageServiceRestorePostOK handles this case with default header values. + +Task ID that can be used with Task Manager service +*/ +type StorageServiceRestorePostOK struct { + Payload string +} + +func (o *StorageServiceRestorePostOK) GetPayload() string { + return o.Payload +} + +func (o *StorageServiceRestorePostOK) 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 +} + +// NewStorageServiceRestorePostDefault creates a StorageServiceRestorePostDefault with default headers values +func NewStorageServiceRestorePostDefault(code int) *StorageServiceRestorePostDefault { + return &StorageServiceRestorePostDefault{ + _statusCode: code, + } +} + +/* +StorageServiceRestorePostDefault handles this case with default header values. + +internal server error +*/ +type StorageServiceRestorePostDefault struct { + _statusCode int + + Payload *models.ErrorModel +} + +// Code gets the status code for the storage service restore post default response +func (o *StorageServiceRestorePostDefault) Code() int { + return o._statusCode +} + +func (o *StorageServiceRestorePostDefault) GetPayload() *models.ErrorModel { + return o.Payload +} + +func (o *StorageServiceRestorePostDefault) 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 *StorageServiceRestorePostDefault) Error() string { + return fmt.Sprintf("agent [HTTP %d] %s", o._statusCode, strings.TrimRight(o.Payload.Message, ".")) +} diff --git a/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_abort_task_task_id_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_abort_task_task_id_post_responses.go b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_module_tasks_module_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_module_tasks_module_get_responses.go b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_modules_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_modules_get_parameters.go new file mode 100644 index 0000000000..3898feaaa5 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_modules_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_list_modules_get_responses.go new file mode 100644 index 0000000000..09b42c8fb8 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_recursive_task_id_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_recursive_task_id_get_responses.go b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_task_id_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_task_status_task_id_get_responses.go b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_get_parameters.go new file mode 100644 index 0000000000..71753eba22 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_get_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_get_responses.go new file mode 100644 index 0000000000..8fcb7ea5bf --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_post_parameters.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_post_parameters.go new file mode 100644 index 0000000000..fa6b2326a2 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_post_responses.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_ttl_post_responses.go new file mode 100644 index 0000000000..80d97579d1 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_wait_task_task_id_get_parameters.go b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/client/operations/task_manager_wait_task_task_id_get_responses.go b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/task_identity.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/task_identity.go new file mode 100644 index 0000000000..eecba4c268 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/task_stats.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/task_stats.go new file mode 100644 index 0000000000..ac10aefd25 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/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/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/task_status.go b/vendor/github.com/scylladb/scylla-manager/v3/swagger/gen/scylla/v1/models/task_status.go new file mode 100644 index 0000000000..e53dd2c3e4 --- /dev/null +++ b/vendor/github.com/scylladb/scylla-manager/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/vendor/modules.txt b/vendor/modules.txt index d95e1dfa51..5714a7746f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -395,12 +395,12 @@ github.com/scylladb/gocqlx/v2/dbutil github.com/scylladb/gocqlx/v2/migrate github.com/scylladb/gocqlx/v2/qb github.com/scylladb/gocqlx/v2/table -# github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20241104134613-aba35605c28b -## explicit; go 1.21.1 +# github.com/scylladb/scylla-manager/v3/pkg/managerclient v0.0.0-20241113064359-18103e06f366 +## explicit; go 1.23.2 github.com/scylladb/scylla-manager/v3/pkg/managerclient github.com/scylladb/scylla-manager/v3/pkg/managerclient/table -# github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241104134613-aba35605c28b -## explicit; go 1.21.1 +# github.com/scylladb/scylla-manager/v3/pkg/util v0.0.0-20241113064359-18103e06f366 +## explicit; go 1.23.2 github.com/scylladb/scylla-manager/v3/pkg/util github.com/scylladb/scylla-manager/v3/pkg/util/certutil github.com/scylladb/scylla-manager/v3/pkg/util/cfgutil @@ -431,8 +431,8 @@ github.com/scylladb/scylla-manager/v3/pkg/util/timeutc github.com/scylladb/scylla-manager/v3/pkg/util/uuid github.com/scylladb/scylla-manager/v3/pkg/util/version github.com/scylladb/scylla-manager/v3/pkg/util/workerpool -# github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241104134613-aba35605c28b -## explicit; go 1.21.1 +# github.com/scylladb/scylla-manager/v3/swagger v0.0.0-20241113064359-18103e06f366 +## explicit; go 1.23.2 github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client github.com/scylladb/scylla-manager/v3/swagger/gen/agent/client/operations github.com/scylladb/scylla-manager/v3/swagger/gen/agent/models From 2ee9dcadf31bf5dd8437ab5d653f279d955739c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Leszczy=C5=84ski?= <2000michal@wp.pl> Date: Wed, 13 Nov 2024 09:57:46 +0100 Subject: [PATCH 2/3] feat(testing): configure Scylla object storage (minio) For Scylla to access object storage, it needs to be configured in the 'object_storage.yaml' config file. --- testing/Makefile | 1 + testing/docker-compose.yaml | 24 +++++++++++++++++++++++ testing/scylla/.gitignore | 3 ++- testing/scylla/config/object_storage.yaml | 8 ++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 testing/scylla/config/object_storage.yaml diff --git a/testing/Makefile b/testing/Makefile index 3d9b888f3e..ff042e2bed 100644 --- a/testing/Makefile +++ b/testing/Makefile @@ -63,6 +63,7 @@ up: @cd scylla/certs && ./generate.sh @echo "==> Generating Scylla configuration" @cp scylla/config/scylla.yaml scylla/scylla.yaml + @cp scylla/config/object_storage.yaml scylla/object_storage.yaml @cp scylla/config/cqlshrc scylla/cqlshrc ifeq ($(RAFT_SCHEMA),enabled) @$(YQ) write -i scylla/scylla.yaml 'consistent_cluster_management' true diff --git a/testing/docker-compose.yaml b/testing/docker-compose.yaml index 03acfd961f..498014d555 100644 --- a/testing/docker-compose.yaml +++ b/testing/docker-compose.yaml @@ -9,6 +9,9 @@ services: - type: bind source: ./scylla/scylla.yaml target: /etc/scylla/scylla.yaml + - type: bind + source: ./scylla/object_storage.yaml + target: /etc/scylla/object_storage.yaml - type: bind source: ./scylla/certs/ target: /etc/scylla/certs @@ -29,6 +32,9 @@ services: - type: bind source: ./scylla/scylla.yaml target: /etc/scylla/scylla.yaml + - type: bind + source: ./scylla/object_storage.yaml + target: /etc/scylla/object_storage.yaml - type: bind source: ./scylla/certs/ target: /etc/scylla/certs @@ -49,6 +55,9 @@ services: - type: bind source: ./scylla/scylla.yaml target: /etc/scylla/scylla.yaml + - type: bind + source: ./scylla/object_storage.yaml + target: /etc/scylla/object_storage.yaml - type: bind source: ./scylla/certs/ target: /etc/scylla/certs/ @@ -69,6 +78,9 @@ services: - type: bind source: ./scylla/scylla.yaml target: /etc/scylla/scylla.yaml + - type: bind + source: ./scylla/object_storage.yaml + target: /etc/scylla/object_storage.yaml - type: bind source: ./scylla/certs/ target: /etc/scylla/certs @@ -89,6 +101,9 @@ services: - type: bind source: ./scylla/scylla.yaml target: /etc/scylla/scylla.yaml + - type: bind + source: ./scylla/object_storage.yaml + target: /etc/scylla/object_storage.yaml - type: bind source: ./scylla/certs/ target: /etc/scylla/certs @@ -109,6 +124,9 @@ services: - type: bind source: ./scylla/scylla.yaml target: /etc/scylla/scylla.yaml + - type: bind + source: ./scylla/object_storage.yaml + target: /etc/scylla/object_storage.yaml - type: bind source: ./scylla/certs/ target: /etc/scylla/certs @@ -129,6 +147,9 @@ services: - type: bind source: ./scylla/scylla-second-cluster.yaml target: /etc/scylla/scylla.yaml + - type: bind + source: ./scylla/object_storage.yaml + target: /etc/scylla/object_storage.yaml - type: bind source: ./scylla/certs/ target: /etc/scylla/certs @@ -149,6 +170,9 @@ services: - type: bind source: ./scylla/scylla-second-cluster.yaml target: /etc/scylla/scylla.yaml + - type: bind + source: ./scylla/object_storage.yaml + target: /etc/scylla/object_storage.yaml - type: bind source: ./scylla/certs/ target: /etc/scylla/certs diff --git a/testing/scylla/.gitignore b/testing/scylla/.gitignore index 941f753aa7..18e8660edb 100644 --- a/testing/scylla/.gitignore +++ b/testing/scylla/.gitignore @@ -1,3 +1,4 @@ /cqlshrc /scylla.yaml -/scylla-second-cluster.yaml \ No newline at end of file +/scylla-second-cluster.yaml +/object_storage.yaml \ No newline at end of file diff --git a/testing/scylla/config/object_storage.yaml b/testing/scylla/config/object_storage.yaml new file mode 100644 index 0000000000..91968a795a --- /dev/null +++ b/testing/scylla/config/object_storage.yaml @@ -0,0 +1,8 @@ +# Scylla dev docs: https://github.com/scylladb/scylladb/blob/92db2eca0b8ab0a4fa2571666a7fe2d2b07c697b/docs/dev/object_storage.md?plain=1#L29-L39 +endpoints: + - name: 192.168.200.99 + port: 9000 + https: true + aws_region: us-east-1 + aws_access_key_id: miniouser + aws_secret_access_key: minio1234 \ No newline at end of file From 46904406378043a4d003dd168e2fe97de715d5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Leszczy=C5=84ski?= <2000michal@wp.pl> Date: Wed, 13 Nov 2024 10:34:19 +0100 Subject: [PATCH 3/3] tmp: test backup with scylla api --- pkg/scyllaclient/client_scylla.go | 27 ++++++++++++++++++++ pkg/service/backup/worker_upload.go | 39 +++++++++++++++++++++-------- 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/pkg/scyllaclient/client_scylla.go b/pkg/scyllaclient/client_scylla.go index 022a7b7f4a..103ef58366 100644 --- a/pkg/scyllaclient/client_scylla.go +++ b/pkg/scyllaclient/client_scylla.go @@ -1125,6 +1125,33 @@ func (c *Client) ControlTabletLoadBalancing(ctx context.Context, enabled bool) e return err } +func (c *Client) Backup(ctx context.Context, host, endpoint, bucket, prefix, keyspace, table, snapshotTag string) (string, error) { + resp, err := c.scyllaOps.StorageServiceBackupPost(&operations.StorageServiceBackupPostParams{ + Context: forceHost(ctx, host), + Endpoint: endpoint, + Bucket: bucket, + Prefix: prefix, + Keyspace: keyspace, + Table: table, + Snapshot: &snapshotTag, + }) + if err != nil { + return "", err + } + return resp.GetPayload(), nil +} + +func (c *Client) WaitTask(ctx context.Context, host, id string) (*models.TaskStatus, error) { + resp, err := c.scyllaOps.TaskManagerWaitTaskTaskIDGet(&operations.TaskManagerWaitTaskTaskIDGetParams{ + Context: forceHost(ctx, host), + TaskID: id, + }) + if err != nil { + return nil, err + } + return resp.GetPayload(), nil +} + // ToCanonicalIP replaces ":0:0" in IPv6 addresses with "::" // ToCanonicalIP("192.168.0.1") -> "192.168.0.1" // ToCanonicalIP("100:200:0:0:0:0:0:1") -> "100:200::1". diff --git a/pkg/service/backup/worker_upload.go b/pkg/service/backup/worker_upload.go index d57a57c07d..5191999d5e 100644 --- a/pkg/service/backup/worker_upload.go +++ b/pkg/service/backup/worker_upload.go @@ -185,19 +185,36 @@ func (w *worker) uploadSnapshotDir(ctx context.Context, h hostInfo, d snapshotDi } func (w *worker) uploadDataDir(ctx context.Context, hi hostInfo, dst, src string, d snapshotDir) error { - // Ensure file versioning during upload - id, err := w.Client.RcloneMoveDir(ctx, d.Host, hi.Transfers, hi.RateLimit.Limit, dst, src, VersionedFileExt(w.SnapshotTag)) + //// Ensure file versioning during upload + //id, err := w.Client.RcloneMoveDir(ctx, d.Host, hi.Transfers, hi.RateLimit.Limit, dst, src, VersionedFileExt(w.SnapshotTag)) + //if err != nil { + // return err + //} + // + //w.Logger.Info(ctx, "Uploading dir", "host", d.Host, "from", src, "to", dst, "job_id", id) + //d.Progress.AgentJobID = id + //w.onRunProgress(ctx, d.Progress) + // + //if err := w.waitJob(ctx, id, d); err != nil { + // w.Logger.Error(ctx, "Upload dir failed", "host", d.Host, "from", src, "to", dst, "error", err) + // return err + //} + //return nil + + dstt := w.remoteSSTableDir(hi, d) + // TODO: resolve endpoint either by: + // - making agent return endpoint information to SM + // - allowing for specifying endpoint instead of backed in --location flag + id, err := w.Client.Backup(ctx, hi.IP, "192.168.200.99", hi.Location.Path, dstt, d.Keyspace, d.Table, w.SnapshotTag) if err != nil { - return err + return errors.Wrap(err, "backup") } - - w.Logger.Info(ctx, "Uploading dir", "host", d.Host, "from", src, "to", dst, "job_id", id) - d.Progress.AgentJobID = id - w.onRunProgress(ctx, d.Progress) - - if err := w.waitJob(ctx, id, d); err != nil { - w.Logger.Error(ctx, "Upload dir failed", "host", d.Host, "from", src, "to", dst, "error", err) - return err + status, err := w.Client.WaitTask(ctx, hi.IP, id) + if err != nil { + return errors.Wrap(err, "wait task") + } + if status.State != "done" { + return errors.New(status.Error) } return nil }