From c29d5c0ef17c8933e3c6758be4a2174279bdc0d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Miku=C5=A1?= Date: Tue, 13 Jul 2021 15:04:36 +0200 Subject: [PATCH] PMM-8155 Backup scheduling (#748) * PMM-8155 Backup scheduling * PMM-8155 Add vendor and data model * PMM-8155 Add comment to duration * Schedule -> scheduled * PMM-8155 Removed retries --- api/managementpb/backup/backups.pb.go | 1198 ++++++++++++++++- api/managementpb/backup/backups.pb.gw.go | 326 ++++- api/managementpb/backup/backups.proto | 148 +- .../backup/backups.validator.pb.go | 96 ++ api/managementpb/backup/json/backup.json | 438 +++++- .../json/client/backups/backups_client.go | 142 +- .../change_scheduled_backup_parameters.go | 131 ++ .../change_scheduled_backup_responses.go | 298 ++++ .../list_scheduled_backups_parameters.go | 133 ++ .../list_scheduled_backups_responses.go | 448 ++++++ .../remove_scheduled_backup_parameters.go | 131 ++ .../remove_scheduled_backup_responses.go | 223 +++ .../backups/restore_backup_responses.go | 36 - .../backups/schedule_backup_parameters.go | 131 ++ .../backups/schedule_backup_responses.go | 303 +++++ .../client/backups/start_backup_responses.go | 4 +- api/swagger/swagger-dev.json | 438 +++++- 17 files changed, 4516 insertions(+), 108 deletions(-) create mode 100644 api/managementpb/backup/json/client/backups/change_scheduled_backup_parameters.go create mode 100644 api/managementpb/backup/json/client/backups/change_scheduled_backup_responses.go create mode 100644 api/managementpb/backup/json/client/backups/list_scheduled_backups_parameters.go create mode 100644 api/managementpb/backup/json/client/backups/list_scheduled_backups_responses.go create mode 100644 api/managementpb/backup/json/client/backups/remove_scheduled_backup_parameters.go create mode 100644 api/managementpb/backup/json/client/backups/remove_scheduled_backup_responses.go create mode 100644 api/managementpb/backup/json/client/backups/schedule_backup_parameters.go create mode 100644 api/managementpb/backup/json/client/backups/schedule_backup_responses.go diff --git a/api/managementpb/backup/backups.pb.go b/api/managementpb/backup/backups.pb.go index 284a4534f5..bf9808bd89 100644 --- a/api/managementpb/backup/backups.pb.go +++ b/api/managementpb/backup/backups.pb.go @@ -9,6 +9,8 @@ package backupv1beta1 import ( context "context" proto "github.com/golang/protobuf/proto" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + wrappers "github.com/golang/protobuf/ptypes/wrappers" _ "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" @@ -309,6 +311,630 @@ func (x *RestoreBackupResponse) GetRestoreId() string { return "" } +// ScheduledBackup represents scheduled task for backup. +type ScheduledBackup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Machine-readable ID. + ScheduledBackupId string `protobuf:"bytes,1,opt,name=scheduled_backup_id,json=scheduledBackupId,proto3" json:"scheduled_backup_id,omitempty"` + // Machine-readable service ID. + ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + // Service name. + ServiceName string `protobuf:"bytes,3,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + // Machine-readable location ID. + LocationId string `protobuf:"bytes,4,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` + // Location name. + LocationName string `protobuf:"bytes,5,opt,name=location_name,json=locationName,proto3" json:"location_name,omitempty"` + // How often backup will be run in cron format. + CronExpression string `protobuf:"bytes,6,opt,name=cron_expression,json=cronExpression,proto3" json:"cron_expression,omitempty"` + // First backup wouldn't happen before this time. + StartTime *timestamp.Timestamp `protobuf:"bytes,7,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // Artifact name. + Name string `protobuf:"bytes,8,opt,name=name,proto3" json:"name,omitempty"` + // Description. + Description string `protobuf:"bytes,9,opt,name=description,proto3" json:"description,omitempty"` + // Retry mode. + //RetryMode retry_mode = 10; + // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. + //google.protobuf.Duration retry_interval = 11; + // How many times to retry a failed backup before giving up. + //uint32 retry_times = 12; + // If scheduling is enabled. + Enabled bool `protobuf:"varint,13,opt,name=enabled,proto3" json:"enabled,omitempty"` + // Backup data model. + DataModel DataModel `protobuf:"varint,14,opt,name=data_model,json=dataModel,proto3,enum=backup.v1beta1.DataModel" json:"data_model,omitempty"` + // Database vendor e.g. PostgreSQL, MongoDB, MySQL. + Vendor string `protobuf:"bytes,15,opt,name=vendor,proto3" json:"vendor,omitempty"` + // Last run. + LastRun *timestamp.Timestamp `protobuf:"bytes,16,opt,name=last_run,json=lastRun,proto3" json:"last_run,omitempty"` + // Next run. + NextRun *timestamp.Timestamp `protobuf:"bytes,17,opt,name=next_run,json=nextRun,proto3" json:"next_run,omitempty"` +} + +func (x *ScheduledBackup) Reset() { + *x = ScheduledBackup{} + if protoimpl.UnsafeEnabled { + mi := &file_managementpb_backup_backups_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduledBackup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduledBackup) ProtoMessage() {} + +func (x *ScheduledBackup) ProtoReflect() protoreflect.Message { + mi := &file_managementpb_backup_backups_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduledBackup.ProtoReflect.Descriptor instead. +func (*ScheduledBackup) Descriptor() ([]byte, []int) { + return file_managementpb_backup_backups_proto_rawDescGZIP(), []int{4} +} + +func (x *ScheduledBackup) GetScheduledBackupId() string { + if x != nil { + return x.ScheduledBackupId + } + return "" +} + +func (x *ScheduledBackup) GetServiceId() string { + if x != nil { + return x.ServiceId + } + return "" +} + +func (x *ScheduledBackup) GetServiceName() string { + if x != nil { + return x.ServiceName + } + return "" +} + +func (x *ScheduledBackup) GetLocationId() string { + if x != nil { + return x.LocationId + } + return "" +} + +func (x *ScheduledBackup) GetLocationName() string { + if x != nil { + return x.LocationName + } + return "" +} + +func (x *ScheduledBackup) GetCronExpression() string { + if x != nil { + return x.CronExpression + } + return "" +} + +func (x *ScheduledBackup) GetStartTime() *timestamp.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *ScheduledBackup) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ScheduledBackup) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *ScheduledBackup) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *ScheduledBackup) GetDataModel() DataModel { + if x != nil { + return x.DataModel + } + return DataModel_DATA_MODEL_INVALID +} + +func (x *ScheduledBackup) GetVendor() string { + if x != nil { + return x.Vendor + } + return "" +} + +func (x *ScheduledBackup) GetLastRun() *timestamp.Timestamp { + if x != nil { + return x.LastRun + } + return nil +} + +func (x *ScheduledBackup) GetNextRun() *timestamp.Timestamp { + if x != nil { + return x.NextRun + } + return nil +} + +type ScheduleBackupRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Service identifier where backup should be performed. + ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + // Machine-readable location ID. + LocationId string `protobuf:"bytes,2,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` + // How often backup should be run in cron format. + CronExpression string `protobuf:"bytes,3,opt,name=cron_expression,json=cronExpression,proto3" json:"cron_expression,omitempty"` + // First backup wouldn't happen before this time. + StartTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // Name of backup. + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + // Human-readable description. + Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` + // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. + //google.protobuf.Duration retry_interval = 7; + // How many times to retry a failed backup before giving up. + //uint32 retry_times = 8; + // If scheduling is enabled. + Enabled bool `protobuf:"varint,9,opt,name=enabled,proto3" json:"enabled,omitempty"` +} + +func (x *ScheduleBackupRequest) Reset() { + *x = ScheduleBackupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_managementpb_backup_backups_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduleBackupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleBackupRequest) ProtoMessage() {} + +func (x *ScheduleBackupRequest) ProtoReflect() protoreflect.Message { + mi := &file_managementpb_backup_backups_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleBackupRequest.ProtoReflect.Descriptor instead. +func (*ScheduleBackupRequest) Descriptor() ([]byte, []int) { + return file_managementpb_backup_backups_proto_rawDescGZIP(), []int{5} +} + +func (x *ScheduleBackupRequest) GetServiceId() string { + if x != nil { + return x.ServiceId + } + return "" +} + +func (x *ScheduleBackupRequest) GetLocationId() string { + if x != nil { + return x.LocationId + } + return "" +} + +func (x *ScheduleBackupRequest) GetCronExpression() string { + if x != nil { + return x.CronExpression + } + return "" +} + +func (x *ScheduleBackupRequest) GetStartTime() *timestamp.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *ScheduleBackupRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ScheduleBackupRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *ScheduleBackupRequest) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +type ScheduleBackupResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ScheduledBackupId string `protobuf:"bytes,1,opt,name=scheduled_backup_id,json=scheduledBackupId,proto3" json:"scheduled_backup_id,omitempty"` +} + +func (x *ScheduleBackupResponse) Reset() { + *x = ScheduleBackupResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_managementpb_backup_backups_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScheduleBackupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleBackupResponse) ProtoMessage() {} + +func (x *ScheduleBackupResponse) ProtoReflect() protoreflect.Message { + mi := &file_managementpb_backup_backups_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleBackupResponse.ProtoReflect.Descriptor instead. +func (*ScheduleBackupResponse) Descriptor() ([]byte, []int) { + return file_managementpb_backup_backups_proto_rawDescGZIP(), []int{6} +} + +func (x *ScheduleBackupResponse) GetScheduledBackupId() string { + if x != nil { + return x.ScheduledBackupId + } + return "" +} + +type ListScheduledBackupsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListScheduledBackupsRequest) Reset() { + *x = ListScheduledBackupsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_managementpb_backup_backups_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListScheduledBackupsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListScheduledBackupsRequest) ProtoMessage() {} + +func (x *ListScheduledBackupsRequest) ProtoReflect() protoreflect.Message { + mi := &file_managementpb_backup_backups_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListScheduledBackupsRequest.ProtoReflect.Descriptor instead. +func (*ListScheduledBackupsRequest) Descriptor() ([]byte, []int) { + return file_managementpb_backup_backups_proto_rawDescGZIP(), []int{7} +} + +type ListScheduledBackupsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ScheduledBackups []*ScheduledBackup `protobuf:"bytes,1,rep,name=scheduled_backups,json=scheduledBackups,proto3" json:"scheduled_backups,omitempty"` +} + +func (x *ListScheduledBackupsResponse) Reset() { + *x = ListScheduledBackupsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_managementpb_backup_backups_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListScheduledBackupsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListScheduledBackupsResponse) ProtoMessage() {} + +func (x *ListScheduledBackupsResponse) ProtoReflect() protoreflect.Message { + mi := &file_managementpb_backup_backups_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListScheduledBackupsResponse.ProtoReflect.Descriptor instead. +func (*ListScheduledBackupsResponse) Descriptor() ([]byte, []int) { + return file_managementpb_backup_backups_proto_rawDescGZIP(), []int{8} +} + +func (x *ListScheduledBackupsResponse) GetScheduledBackups() []*ScheduledBackup { + if x != nil { + return x.ScheduledBackups + } + return nil +} + +type ChangeScheduledBackupRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ScheduledBackupId string `protobuf:"bytes,1,opt,name=scheduled_backup_id,json=scheduledBackupId,proto3" json:"scheduled_backup_id,omitempty"` + Enabled *wrappers.BoolValue `protobuf:"bytes,2,opt,name=enabled,proto3" json:"enabled,omitempty"` + // How often backup should be run in cron format. + CronExpression *wrappers.StringValue `protobuf:"bytes,3,opt,name=cron_expression,json=cronExpression,proto3" json:"cron_expression,omitempty"` + // First backup wouldn't happen before this time. + StartTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // Name of backup. + Name *wrappers.StringValue `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + // Human-readable description. + Description *wrappers.StringValue `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *ChangeScheduledBackupRequest) Reset() { + *x = ChangeScheduledBackupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_managementpb_backup_backups_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeScheduledBackupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeScheduledBackupRequest) ProtoMessage() {} + +func (x *ChangeScheduledBackupRequest) ProtoReflect() protoreflect.Message { + mi := &file_managementpb_backup_backups_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeScheduledBackupRequest.ProtoReflect.Descriptor instead. +func (*ChangeScheduledBackupRequest) Descriptor() ([]byte, []int) { + return file_managementpb_backup_backups_proto_rawDescGZIP(), []int{9} +} + +func (x *ChangeScheduledBackupRequest) GetScheduledBackupId() string { + if x != nil { + return x.ScheduledBackupId + } + return "" +} + +func (x *ChangeScheduledBackupRequest) GetEnabled() *wrappers.BoolValue { + if x != nil { + return x.Enabled + } + return nil +} + +func (x *ChangeScheduledBackupRequest) GetCronExpression() *wrappers.StringValue { + if x != nil { + return x.CronExpression + } + return nil +} + +func (x *ChangeScheduledBackupRequest) GetStartTime() *timestamp.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *ChangeScheduledBackupRequest) GetName() *wrappers.StringValue { + if x != nil { + return x.Name + } + return nil +} + +func (x *ChangeScheduledBackupRequest) GetDescription() *wrappers.StringValue { + if x != nil { + return x.Description + } + return nil +} + +type ChangeScheduledBackupResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChangeScheduledBackupResponse) Reset() { + *x = ChangeScheduledBackupResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_managementpb_backup_backups_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeScheduledBackupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeScheduledBackupResponse) ProtoMessage() {} + +func (x *ChangeScheduledBackupResponse) ProtoReflect() protoreflect.Message { + mi := &file_managementpb_backup_backups_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeScheduledBackupResponse.ProtoReflect.Descriptor instead. +func (*ChangeScheduledBackupResponse) Descriptor() ([]byte, []int) { + return file_managementpb_backup_backups_proto_rawDescGZIP(), []int{10} +} + +type RemoveScheduledBackupRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ScheduledBackupId string `protobuf:"bytes,1,opt,name=scheduled_backup_id,json=scheduledBackupId,proto3" json:"scheduled_backup_id,omitempty"` +} + +func (x *RemoveScheduledBackupRequest) Reset() { + *x = RemoveScheduledBackupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_managementpb_backup_backups_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveScheduledBackupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveScheduledBackupRequest) ProtoMessage() {} + +func (x *RemoveScheduledBackupRequest) ProtoReflect() protoreflect.Message { + mi := &file_managementpb_backup_backups_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveScheduledBackupRequest.ProtoReflect.Descriptor instead. +func (*RemoveScheduledBackupRequest) Descriptor() ([]byte, []int) { + return file_managementpb_backup_backups_proto_rawDescGZIP(), []int{11} +} + +func (x *RemoveScheduledBackupRequest) GetScheduledBackupId() string { + if x != nil { + return x.ScheduledBackupId + } + return "" +} + +type RemoveScheduledBackupResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RemoveScheduledBackupResponse) Reset() { + *x = RemoveScheduledBackupResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_managementpb_backup_backups_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveScheduledBackupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveScheduledBackupResponse) ProtoMessage() {} + +func (x *RemoveScheduledBackupResponse) ProtoReflect() protoreflect.Message { + mi := &file_managementpb_backup_backups_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveScheduledBackupResponse.ProtoReflect.Descriptor instead. +func (*RemoveScheduledBackupResponse) Descriptor() ([]byte, []int) { + return file_managementpb_backup_backups_proto_rawDescGZIP(), []int{12} +} + var File_managementpb_backup_backups_proto protoreflect.FileDescriptor var file_managementpb_backup_backups_proto_rawDesc = []byte{ @@ -320,56 +946,205 @@ var file_managementpb_backup_backups_proto_rawDesc = []byte{ 0x2d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x01, 0x0a, 0x12, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x09, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0b, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, - 0x1f, 0x02, 0x58, 0x01, 0x52, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x36, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x49, 0x64, 0x22, 0x66, - 0x0a, 0x14, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, - 0x58, 0x01, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x27, 0x0a, - 0x0b, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x0a, 0x61, 0x72, 0x74, 0x69, - 0x66, 0x61, 0x63, 0x74, 0x49, 0x64, 0x22, 0x36, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x49, 0x64, 0x2a, 0x39, - 0x0a, 0x09, 0x52, 0x65, 0x74, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x52, - 0x45, 0x54, 0x52, 0x59, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, - 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x55, 0x54, 0x4f, 0x10, 0x01, 0x12, 0x0a, 0x0a, - 0x06, 0x4d, 0x41, 0x4e, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x32, 0xa9, 0x02, 0x0a, 0x07, 0x42, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x22, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, + 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x01, 0x0a, + 0x12, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, + 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0b, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x36, 0x0a, 0x13, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x49, + 0x64, 0x22, 0x66, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, + 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, + 0x12, 0x27, 0x0a, 0x0b, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x0a, 0x61, + 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x49, 0x64, 0x22, 0x36, 0x0a, 0x15, 0x52, 0x65, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x49, + 0x64, 0x22, 0xbd, 0x04, 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2e, 0x0a, 0x13, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x64, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x11, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, + 0x0f, 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x72, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x72, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x12, 0x38, 0x0a, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x6f, 0x64, 0x65, 0x6c, + 0x52, 0x09, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x76, + 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x65, 0x6e, + 0x64, 0x6f, 0x72, 0x12, 0x35, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x72, 0x75, 0x6e, 0x18, + 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x07, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x75, 0x6e, 0x12, 0x35, 0x0a, 0x08, 0x6e, 0x65, + 0x78, 0x74, 0x5f, 0x72, 0x75, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x6e, 0x65, 0x78, 0x74, 0x52, 0x75, + 0x6e, 0x22, 0xa3, 0x02, 0x0a, 0x15, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, + 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x0f, 0x63, + 0x72, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x0e, 0x63, 0x72, + 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0a, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x48, 0x0a, 0x16, 0x53, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x62, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x49, + 0x64, 0x22, 0x1d, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x6c, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4c, 0x0a, 0x11, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x62, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x10, 0x73, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x22, 0x80, + 0x03, 0x0a, 0x1c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x36, 0x0a, 0x13, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, + 0x1f, 0x02, 0x58, 0x01, 0x52, 0x11, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, + 0x61, 0x63, 0x6b, 0x75, 0x70, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x45, 0x0a, + 0x0f, 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x63, 0x72, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x30, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x1f, 0x0a, 0x1d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x56, 0x0a, 0x1c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x36, 0x0a, 0x13, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x5f, + 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x11, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x49, 0x64, 0x22, 0x1f, 0x0a, 0x1d, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x39, 0x0a, 0x09, 0x52, + 0x65, 0x74, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x54, 0x52, + 0x59, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, + 0x12, 0x08, 0x0a, 0x04, 0x41, 0x55, 0x54, 0x4f, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x41, + 0x4e, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x32, 0xc6, 0x07, 0x0a, 0x07, 0x42, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x73, 0x12, 0x86, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x12, 0x22, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x28, 0x22, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x42, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x73, 0x2f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x8e, 0x01, 0x0a, 0x0d, + 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x24, 0x2e, + 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, + 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, + 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2a, 0x22, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x73, 0x2f, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x92, 0x01, 0x0a, + 0x0e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, + 0x25, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x42, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x73, 0x2f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x75, - 0x70, 0x3a, 0x01, 0x2a, 0x12, 0x8e, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x24, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x62, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x22, 0x25, 0x2f, 0x76, 0x31, - 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x62, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x2f, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x2f, 0x52, 0x65, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x3a, 0x01, 0x2a, 0x42, 0x27, 0x5a, 0x25, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x3b, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6b, 0x75, 0x70, 0x73, 0x2f, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x01, + 0x2a, 0x12, 0xa9, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x12, 0x2b, 0x2e, 0x62, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x22, 0x2b, 0x2f, + 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x62, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x2f, 0x4c, 0x69, 0x73, + 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x3a, 0x01, 0x2a, 0x12, 0xae, 0x01, + 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2c, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x2d, 0x2f, 0x76, + 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x62, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x2f, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x2f, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x3a, 0x01, 0x2a, 0x12, 0xae, + 0x01, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x2c, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x2d, 0x2f, + 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x62, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x73, 0x2f, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x3a, 0x01, 0x2a, 0x42, + 0x27, 0x5a, 0x25, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x70, 0x62, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x3b, 0x62, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -385,24 +1160,56 @@ func file_managementpb_backup_backups_proto_rawDescGZIP() []byte { } var file_managementpb_backup_backups_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_managementpb_backup_backups_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_managementpb_backup_backups_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_managementpb_backup_backups_proto_goTypes = []interface{}{ - (RetryMode)(0), // 0: backup.v1beta1.RetryMode - (*StartBackupRequest)(nil), // 1: backup.v1beta1.StartBackupRequest - (*StartBackupResponse)(nil), // 2: backup.v1beta1.StartBackupResponse - (*RestoreBackupRequest)(nil), // 3: backup.v1beta1.RestoreBackupRequest - (*RestoreBackupResponse)(nil), // 4: backup.v1beta1.RestoreBackupResponse + (RetryMode)(0), // 0: backup.v1beta1.RetryMode + (*StartBackupRequest)(nil), // 1: backup.v1beta1.StartBackupRequest + (*StartBackupResponse)(nil), // 2: backup.v1beta1.StartBackupResponse + (*RestoreBackupRequest)(nil), // 3: backup.v1beta1.RestoreBackupRequest + (*RestoreBackupResponse)(nil), // 4: backup.v1beta1.RestoreBackupResponse + (*ScheduledBackup)(nil), // 5: backup.v1beta1.ScheduledBackup + (*ScheduleBackupRequest)(nil), // 6: backup.v1beta1.ScheduleBackupRequest + (*ScheduleBackupResponse)(nil), // 7: backup.v1beta1.ScheduleBackupResponse + (*ListScheduledBackupsRequest)(nil), // 8: backup.v1beta1.ListScheduledBackupsRequest + (*ListScheduledBackupsResponse)(nil), // 9: backup.v1beta1.ListScheduledBackupsResponse + (*ChangeScheduledBackupRequest)(nil), // 10: backup.v1beta1.ChangeScheduledBackupRequest + (*ChangeScheduledBackupResponse)(nil), // 11: backup.v1beta1.ChangeScheduledBackupResponse + (*RemoveScheduledBackupRequest)(nil), // 12: backup.v1beta1.RemoveScheduledBackupRequest + (*RemoveScheduledBackupResponse)(nil), // 13: backup.v1beta1.RemoveScheduledBackupResponse + (*timestamp.Timestamp)(nil), // 14: google.protobuf.Timestamp + (DataModel)(0), // 15: backup.v1beta1.DataModel + (*wrappers.BoolValue)(nil), // 16: google.protobuf.BoolValue + (*wrappers.StringValue)(nil), // 17: google.protobuf.StringValue } var file_managementpb_backup_backups_proto_depIdxs = []int32{ - 1, // 0: backup.v1beta1.Backups.StartBackup:input_type -> backup.v1beta1.StartBackupRequest - 3, // 1: backup.v1beta1.Backups.RestoreBackup:input_type -> backup.v1beta1.RestoreBackupRequest - 2, // 2: backup.v1beta1.Backups.StartBackup:output_type -> backup.v1beta1.StartBackupResponse - 4, // 3: backup.v1beta1.Backups.RestoreBackup:output_type -> backup.v1beta1.RestoreBackupResponse - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 14, // 0: backup.v1beta1.ScheduledBackup.start_time:type_name -> google.protobuf.Timestamp + 15, // 1: backup.v1beta1.ScheduledBackup.data_model:type_name -> backup.v1beta1.DataModel + 14, // 2: backup.v1beta1.ScheduledBackup.last_run:type_name -> google.protobuf.Timestamp + 14, // 3: backup.v1beta1.ScheduledBackup.next_run:type_name -> google.protobuf.Timestamp + 14, // 4: backup.v1beta1.ScheduleBackupRequest.start_time:type_name -> google.protobuf.Timestamp + 5, // 5: backup.v1beta1.ListScheduledBackupsResponse.scheduled_backups:type_name -> backup.v1beta1.ScheduledBackup + 16, // 6: backup.v1beta1.ChangeScheduledBackupRequest.enabled:type_name -> google.protobuf.BoolValue + 17, // 7: backup.v1beta1.ChangeScheduledBackupRequest.cron_expression:type_name -> google.protobuf.StringValue + 14, // 8: backup.v1beta1.ChangeScheduledBackupRequest.start_time:type_name -> google.protobuf.Timestamp + 17, // 9: backup.v1beta1.ChangeScheduledBackupRequest.name:type_name -> google.protobuf.StringValue + 17, // 10: backup.v1beta1.ChangeScheduledBackupRequest.description:type_name -> google.protobuf.StringValue + 1, // 11: backup.v1beta1.Backups.StartBackup:input_type -> backup.v1beta1.StartBackupRequest + 3, // 12: backup.v1beta1.Backups.RestoreBackup:input_type -> backup.v1beta1.RestoreBackupRequest + 6, // 13: backup.v1beta1.Backups.ScheduleBackup:input_type -> backup.v1beta1.ScheduleBackupRequest + 8, // 14: backup.v1beta1.Backups.ListScheduledBackups:input_type -> backup.v1beta1.ListScheduledBackupsRequest + 10, // 15: backup.v1beta1.Backups.ChangeScheduledBackup:input_type -> backup.v1beta1.ChangeScheduledBackupRequest + 12, // 16: backup.v1beta1.Backups.RemoveScheduledBackup:input_type -> backup.v1beta1.RemoveScheduledBackupRequest + 2, // 17: backup.v1beta1.Backups.StartBackup:output_type -> backup.v1beta1.StartBackupResponse + 4, // 18: backup.v1beta1.Backups.RestoreBackup:output_type -> backup.v1beta1.RestoreBackupResponse + 7, // 19: backup.v1beta1.Backups.ScheduleBackup:output_type -> backup.v1beta1.ScheduleBackupResponse + 9, // 20: backup.v1beta1.Backups.ListScheduledBackups:output_type -> backup.v1beta1.ListScheduledBackupsResponse + 11, // 21: backup.v1beta1.Backups.ChangeScheduledBackup:output_type -> backup.v1beta1.ChangeScheduledBackupResponse + 13, // 22: backup.v1beta1.Backups.RemoveScheduledBackup:output_type -> backup.v1beta1.RemoveScheduledBackupResponse + 17, // [17:23] is the sub-list for method output_type + 11, // [11:17] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_managementpb_backup_backups_proto_init() } @@ -410,6 +1217,7 @@ func file_managementpb_backup_backups_proto_init() { if File_managementpb_backup_backups_proto != nil { return } + file_managementpb_backup_common_proto_init() if !protoimpl.UnsafeEnabled { file_managementpb_backup_backups_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StartBackupRequest); i { @@ -459,6 +1267,114 @@ func file_managementpb_backup_backups_proto_init() { return nil } } + file_managementpb_backup_backups_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduledBackup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_managementpb_backup_backups_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduleBackupRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_managementpb_backup_backups_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScheduleBackupResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_managementpb_backup_backups_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListScheduledBackupsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_managementpb_backup_backups_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListScheduledBackupsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_managementpb_backup_backups_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeScheduledBackupRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_managementpb_backup_backups_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeScheduledBackupResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_managementpb_backup_backups_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveScheduledBackupRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_managementpb_backup_backups_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveScheduledBackupResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -466,7 +1382,7 @@ func file_managementpb_backup_backups_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_managementpb_backup_backups_proto_rawDesc, NumEnums: 1, - NumMessages: 4, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, @@ -497,6 +1413,14 @@ type BackupsClient interface { StartBackup(ctx context.Context, in *StartBackupRequest, opts ...grpc.CallOption) (*StartBackupResponse, error) // RestoreBackup requests the backup restore. RestoreBackup(ctx context.Context, in *RestoreBackupRequest, opts ...grpc.CallOption) (*RestoreBackupResponse, error) + // ScheduleBackup schedules repeated backup. + ScheduleBackup(ctx context.Context, in *ScheduleBackupRequest, opts ...grpc.CallOption) (*ScheduleBackupResponse, error) + // ListScheduledBackups returns all scheduled backups. + ListScheduledBackups(ctx context.Context, in *ListScheduledBackupsRequest, opts ...grpc.CallOption) (*ListScheduledBackupsResponse, error) + // ChangeScheduledBackup changes existing scheduled backup. + ChangeScheduledBackup(ctx context.Context, in *ChangeScheduledBackupRequest, opts ...grpc.CallOption) (*ChangeScheduledBackupResponse, error) + // RemoveScheduledBackup removes existing scheduled backup. + RemoveScheduledBackup(ctx context.Context, in *RemoveScheduledBackupRequest, opts ...grpc.CallOption) (*RemoveScheduledBackupResponse, error) } type backupsClient struct { @@ -525,12 +1449,56 @@ func (c *backupsClient) RestoreBackup(ctx context.Context, in *RestoreBackupRequ return out, nil } +func (c *backupsClient) ScheduleBackup(ctx context.Context, in *ScheduleBackupRequest, opts ...grpc.CallOption) (*ScheduleBackupResponse, error) { + out := new(ScheduleBackupResponse) + err := c.cc.Invoke(ctx, "/backup.v1beta1.Backups/ScheduleBackup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *backupsClient) ListScheduledBackups(ctx context.Context, in *ListScheduledBackupsRequest, opts ...grpc.CallOption) (*ListScheduledBackupsResponse, error) { + out := new(ListScheduledBackupsResponse) + err := c.cc.Invoke(ctx, "/backup.v1beta1.Backups/ListScheduledBackups", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *backupsClient) ChangeScheduledBackup(ctx context.Context, in *ChangeScheduledBackupRequest, opts ...grpc.CallOption) (*ChangeScheduledBackupResponse, error) { + out := new(ChangeScheduledBackupResponse) + err := c.cc.Invoke(ctx, "/backup.v1beta1.Backups/ChangeScheduledBackup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *backupsClient) RemoveScheduledBackup(ctx context.Context, in *RemoveScheduledBackupRequest, opts ...grpc.CallOption) (*RemoveScheduledBackupResponse, error) { + out := new(RemoveScheduledBackupResponse) + err := c.cc.Invoke(ctx, "/backup.v1beta1.Backups/RemoveScheduledBackup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // BackupsServer is the server API for Backups service. type BackupsServer interface { // StartBackup request backup specified service to location. StartBackup(context.Context, *StartBackupRequest) (*StartBackupResponse, error) // RestoreBackup requests the backup restore. RestoreBackup(context.Context, *RestoreBackupRequest) (*RestoreBackupResponse, error) + // ScheduleBackup schedules repeated backup. + ScheduleBackup(context.Context, *ScheduleBackupRequest) (*ScheduleBackupResponse, error) + // ListScheduledBackups returns all scheduled backups. + ListScheduledBackups(context.Context, *ListScheduledBackupsRequest) (*ListScheduledBackupsResponse, error) + // ChangeScheduledBackup changes existing scheduled backup. + ChangeScheduledBackup(context.Context, *ChangeScheduledBackupRequest) (*ChangeScheduledBackupResponse, error) + // RemoveScheduledBackup removes existing scheduled backup. + RemoveScheduledBackup(context.Context, *RemoveScheduledBackupRequest) (*RemoveScheduledBackupResponse, error) } // UnimplementedBackupsServer can be embedded to have forward compatible implementations. @@ -543,6 +1511,18 @@ func (*UnimplementedBackupsServer) StartBackup(context.Context, *StartBackupRequ func (*UnimplementedBackupsServer) RestoreBackup(context.Context, *RestoreBackupRequest) (*RestoreBackupResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RestoreBackup not implemented") } +func (*UnimplementedBackupsServer) ScheduleBackup(context.Context, *ScheduleBackupRequest) (*ScheduleBackupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ScheduleBackup not implemented") +} +func (*UnimplementedBackupsServer) ListScheduledBackups(context.Context, *ListScheduledBackupsRequest) (*ListScheduledBackupsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListScheduledBackups not implemented") +} +func (*UnimplementedBackupsServer) ChangeScheduledBackup(context.Context, *ChangeScheduledBackupRequest) (*ChangeScheduledBackupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChangeScheduledBackup not implemented") +} +func (*UnimplementedBackupsServer) RemoveScheduledBackup(context.Context, *RemoveScheduledBackupRequest) (*RemoveScheduledBackupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveScheduledBackup not implemented") +} func RegisterBackupsServer(s *grpc.Server, srv BackupsServer) { s.RegisterService(&_Backups_serviceDesc, srv) @@ -584,6 +1564,78 @@ func _Backups_RestoreBackup_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Backups_ScheduleBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ScheduleBackupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BackupsServer).ScheduleBackup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/backup.v1beta1.Backups/ScheduleBackup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BackupsServer).ScheduleBackup(ctx, req.(*ScheduleBackupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Backups_ListScheduledBackups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListScheduledBackupsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BackupsServer).ListScheduledBackups(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/backup.v1beta1.Backups/ListScheduledBackups", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BackupsServer).ListScheduledBackups(ctx, req.(*ListScheduledBackupsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Backups_ChangeScheduledBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangeScheduledBackupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BackupsServer).ChangeScheduledBackup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/backup.v1beta1.Backups/ChangeScheduledBackup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BackupsServer).ChangeScheduledBackup(ctx, req.(*ChangeScheduledBackupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Backups_RemoveScheduledBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveScheduledBackupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BackupsServer).RemoveScheduledBackup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/backup.v1beta1.Backups/RemoveScheduledBackup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BackupsServer).RemoveScheduledBackup(ctx, req.(*RemoveScheduledBackupRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Backups_serviceDesc = grpc.ServiceDesc{ ServiceName: "backup.v1beta1.Backups", HandlerType: (*BackupsServer)(nil), @@ -596,6 +1648,22 @@ var _Backups_serviceDesc = grpc.ServiceDesc{ MethodName: "RestoreBackup", Handler: _Backups_RestoreBackup_Handler, }, + { + MethodName: "ScheduleBackup", + Handler: _Backups_ScheduleBackup_Handler, + }, + { + MethodName: "ListScheduledBackups", + Handler: _Backups_ListScheduledBackups_Handler, + }, + { + MethodName: "ChangeScheduledBackup", + Handler: _Backups_ChangeScheduledBackup_Handler, + }, + { + MethodName: "RemoveScheduledBackup", + Handler: _Backups_RemoveScheduledBackup_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "managementpb/backup/backups.proto", diff --git a/api/managementpb/backup/backups.pb.gw.go b/api/managementpb/backup/backups.pb.gw.go index 009d6c04e8..bbd4591b2a 100644 --- a/api/managementpb/backup/backups.pb.gw.go +++ b/api/managementpb/backup/backups.pb.gw.go @@ -101,6 +101,142 @@ func local_request_Backups_RestoreBackup_0(ctx context.Context, marshaler runtim } +func request_Backups_ScheduleBackup_0(ctx context.Context, marshaler runtime.Marshaler, client BackupsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ScheduleBackupRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ScheduleBackup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Backups_ScheduleBackup_0(ctx context.Context, marshaler runtime.Marshaler, server BackupsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ScheduleBackupRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ScheduleBackup(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Backups_ListScheduledBackups_0(ctx context.Context, marshaler runtime.Marshaler, client BackupsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListScheduledBackupsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListScheduledBackups(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Backups_ListScheduledBackups_0(ctx context.Context, marshaler runtime.Marshaler, server BackupsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListScheduledBackupsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListScheduledBackups(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Backups_ChangeScheduledBackup_0(ctx context.Context, marshaler runtime.Marshaler, client BackupsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ChangeScheduledBackupRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ChangeScheduledBackup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Backups_ChangeScheduledBackup_0(ctx context.Context, marshaler runtime.Marshaler, server BackupsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ChangeScheduledBackupRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ChangeScheduledBackup(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Backups_RemoveScheduledBackup_0(ctx context.Context, marshaler runtime.Marshaler, client BackupsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RemoveScheduledBackupRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RemoveScheduledBackup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Backups_RemoveScheduledBackup_0(ctx context.Context, marshaler runtime.Marshaler, server BackupsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RemoveScheduledBackupRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RemoveScheduledBackup(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterBackupsHandlerServer registers the http handlers for service Backups to "mux". // UnaryRPC :call BackupsServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -153,6 +289,98 @@ func RegisterBackupsHandlerServer(ctx context.Context, mux *runtime.ServeMux, se }) + mux.Handle("POST", pattern_Backups_ScheduleBackup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Backups_ScheduleBackup_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Backups_ScheduleBackup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Backups_ListScheduledBackups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Backups_ListScheduledBackups_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Backups_ListScheduledBackups_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Backups_ChangeScheduledBackup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Backups_ChangeScheduledBackup_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Backups_ChangeScheduledBackup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Backups_RemoveScheduledBackup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Backups_RemoveScheduledBackup_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Backups_RemoveScheduledBackup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -234,17 +462,113 @@ func RegisterBackupsHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl }) + mux.Handle("POST", pattern_Backups_ScheduleBackup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Backups_ScheduleBackup_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Backups_ScheduleBackup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Backups_ListScheduledBackups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Backups_ListScheduledBackups_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Backups_ListScheduledBackups_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Backups_ChangeScheduledBackup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Backups_ChangeScheduledBackup_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Backups_ChangeScheduledBackup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Backups_RemoveScheduledBackup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Backups_RemoveScheduledBackup_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Backups_RemoveScheduledBackup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( - pattern_Backups_StartBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "backup", "Backups", "StartBackup"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Backups_StartBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "backup", "Backups", "Start"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Backups_RestoreBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "backup", "Backups", "Restore"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Backups_ScheduleBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "backup", "Backups", "Schedule"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Backups_ListScheduledBackups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "backup", "Backups", "ListScheduled"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Backups_ChangeScheduledBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "backup", "Backups", "ChangeScheduled"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Backups_RemoveScheduledBackup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "management", "backup", "Backups", "RemoveScheduled"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( forward_Backups_StartBackup_0 = runtime.ForwardResponseMessage forward_Backups_RestoreBackup_0 = runtime.ForwardResponseMessage + + forward_Backups_ScheduleBackup_0 = runtime.ForwardResponseMessage + + forward_Backups_ListScheduledBackups_0 = runtime.ForwardResponseMessage + + forward_Backups_ChangeScheduledBackup_0 = runtime.ForwardResponseMessage + + forward_Backups_RemoveScheduledBackup_0 = runtime.ForwardResponseMessage ) diff --git a/api/managementpb/backup/backups.proto b/api/managementpb/backup/backups.proto index 196eed19e4..3c9a783cef 100644 --- a/api/managementpb/backup/backups.proto +++ b/api/managementpb/backup/backups.proto @@ -6,6 +6,9 @@ option go_package = "api/managementpb/backup;backupv1beta1"; import "github.com/mwitkow/go-proto-validators/validator.proto"; import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "managementpb/backup/common.proto"; // RetryMode specifies how backup should retry in case of failure. enum RetryMode { @@ -58,12 +61,127 @@ message RestoreBackupResponse { string restore_id = 1; } +// ScheduledBackup represents scheduled task for backup. +message ScheduledBackup { + // Machine-readable ID. + string scheduled_backup_id = 1; + // Machine-readable service ID. + string service_id = 2; + // Service name. + string service_name = 3; + // Machine-readable location ID. + string location_id = 4; + // Location name. + string location_name = 5; + // How often backup will be run in cron format. + string cron_expression = 6; + // First backup wouldn't happen before this time. + google.protobuf.Timestamp start_time = 7; + // Artifact name. + string name = 8; + // Description. + string description = 9; + // Retry mode. + //RetryMode retry_mode = 10; + // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. + //google.protobuf.Duration retry_interval = 11; + // How many times to retry a failed backup before giving up. + //uint32 retry_times = 12; + // If scheduling is enabled. + bool enabled = 13; + // Backup data model. + DataModel data_model = 14; + // Database vendor e.g. PostgreSQL, MongoDB, MySQL. + string vendor = 15; + // Last run. + google.protobuf.Timestamp last_run = 16; + // Next run. + google.protobuf.Timestamp next_run = 17; +} + +message ScheduleBackupRequest { + // Service identifier where backup should be performed. + string service_id = 1 [ + (validator.field) = { + string_not_empty: true + } + ]; + // Machine-readable location ID. + string location_id = 2 [ + (validator.field) = { + string_not_empty: true + } + ]; + // How often backup should be run in cron format. + string cron_expression = 3 [ + (validator.field) = { + string_not_empty: true + } + ]; + // First backup wouldn't happen before this time. + google.protobuf.Timestamp start_time = 4; + // Name of backup. + string name = 5; + // Human-readable description. + string description = 6; + // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. + //google.protobuf.Duration retry_interval = 7; + // How many times to retry a failed backup before giving up. + //uint32 retry_times = 8; + // If scheduling is enabled. + bool enabled = 9; +} + +message ScheduleBackupResponse { + string scheduled_backup_id = 1; +} + +message ListScheduledBackupsRequest {} + +message ListScheduledBackupsResponse { + repeated ScheduledBackup scheduled_backups = 1; +} + +message ChangeScheduledBackupRequest { + string scheduled_backup_id = 1 [ + (validator.field) = { + string_not_empty: true + } + ]; + google.protobuf.BoolValue enabled = 2; + // How often backup should be run in cron format. + google.protobuf.StringValue cron_expression = 3; + // First backup wouldn't happen before this time. + google.protobuf.Timestamp start_time = 4; + // Name of backup. + google.protobuf.StringValue name = 5; + // Human-readable description. + google.protobuf.StringValue description = 6; + // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. + //google.protobuf.Duration retry_interval = 7; + // How many times to retry a failed backup before giving up. + //google.protobuf.UInt32Value retry_times = 8; + +} + +message ChangeScheduledBackupResponse {} + +message RemoveScheduledBackupRequest { + string scheduled_backup_id = 1 [ + (validator.field) = { + string_not_empty: true + } + ]; +} + +message RemoveScheduledBackupResponse {} + // Backups service handles backup operations to DB. service Backups { // StartBackup request backup specified service to location. rpc StartBackup(StartBackupRequest) returns (StartBackupResponse) { option (google.api.http) = { - post: "/v1/management/backup/Backups/StartBackup" + post: "/v1/management/backup/Backups/Start" body: "*" }; } @@ -74,4 +192,32 @@ service Backups { body: "*" }; } + // ScheduleBackup schedules repeated backup. + rpc ScheduleBackup(ScheduleBackupRequest) returns (ScheduleBackupResponse) { + option (google.api.http) = { + post: "/v1/management/backup/Backups/Schedule" + body: "*" + }; + } + // ListScheduledBackups returns all scheduled backups. + rpc ListScheduledBackups(ListScheduledBackupsRequest) returns (ListScheduledBackupsResponse) { + option (google.api.http) = { + post: "/v1/management/backup/Backups/ListScheduled" + body: "*" + }; + } + // ChangeScheduledBackup changes existing scheduled backup. + rpc ChangeScheduledBackup(ChangeScheduledBackupRequest) returns (ChangeScheduledBackupResponse) { + option (google.api.http) = { + post: "/v1/management/backup/Backups/ChangeScheduled" + body: "*" + }; + } + // RemoveScheduledBackup removes existing scheduled backup. + rpc RemoveScheduledBackup(RemoveScheduledBackupRequest) returns (RemoveScheduledBackupResponse) { + option (google.api.http) = { + post: "/v1/management/backup/Backups/RemoveScheduled" + body: "*" + }; + } } diff --git a/api/managementpb/backup/backups.validator.pb.go b/api/managementpb/backup/backups.validator.pb.go index 12ae086d4e..757dfc1130 100644 --- a/api/managementpb/backup/backups.validator.pb.go +++ b/api/managementpb/backup/backups.validator.pb.go @@ -6,6 +6,8 @@ package backupv1beta1 import ( fmt "fmt" proto "github.com/golang/protobuf/proto" + _ "github.com/golang/protobuf/ptypes/timestamp" + _ "github.com/golang/protobuf/ptypes/wrappers" _ "github.com/mwitkow/go-proto-validators" github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -41,3 +43,97 @@ func (this *RestoreBackupRequest) Validate() error { func (this *RestoreBackupResponse) Validate() error { return nil } +func (this *ScheduledBackup) Validate() error { + if this.StartTime != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.StartTime); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("StartTime", err) + } + } + if this.LastRun != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.LastRun); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("LastRun", err) + } + } + if this.NextRun != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NextRun); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("NextRun", err) + } + } + return nil +} +func (this *ScheduleBackupRequest) Validate() error { + if this.ServiceId == "" { + return github_com_mwitkow_go_proto_validators.FieldError("ServiceId", fmt.Errorf(`value '%v' must not be an empty string`, this.ServiceId)) + } + if this.LocationId == "" { + return github_com_mwitkow_go_proto_validators.FieldError("LocationId", fmt.Errorf(`value '%v' must not be an empty string`, this.LocationId)) + } + if this.CronExpression == "" { + return github_com_mwitkow_go_proto_validators.FieldError("CronExpression", fmt.Errorf(`value '%v' must not be an empty string`, this.CronExpression)) + } + if this.StartTime != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.StartTime); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("StartTime", err) + } + } + return nil +} +func (this *ScheduleBackupResponse) Validate() error { + return nil +} +func (this *ListScheduledBackupsRequest) Validate() error { + return nil +} +func (this *ListScheduledBackupsResponse) Validate() error { + for _, item := range this.ScheduledBackups { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("ScheduledBackups", err) + } + } + } + return nil +} +func (this *ChangeScheduledBackupRequest) Validate() error { + if this.ScheduledBackupId == "" { + return github_com_mwitkow_go_proto_validators.FieldError("ScheduledBackupId", fmt.Errorf(`value '%v' must not be an empty string`, this.ScheduledBackupId)) + } + if this.Enabled != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Enabled); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Enabled", err) + } + } + if this.CronExpression != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.CronExpression); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("CronExpression", err) + } + } + if this.StartTime != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.StartTime); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("StartTime", err) + } + } + if this.Name != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Name); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Name", err) + } + } + if this.Description != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Description); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Description", err) + } + } + return nil +} +func (this *ChangeScheduledBackupResponse) Validate() error { + return nil +} +func (this *RemoveScheduledBackupRequest) Validate() error { + if this.ScheduledBackupId == "" { + return github_com_mwitkow_go_proto_validators.FieldError("ScheduledBackupId", fmt.Errorf(`value '%v' must not be an empty string`, this.ScheduledBackupId)) + } + return nil +} +func (this *RemoveScheduledBackupResponse) Validate() error { + return nil +} diff --git a/api/managementpb/backup/json/backup.json b/api/managementpb/backup/json/backup.json index 60ea293666..b952f6b0f7 100644 --- a/api/managementpb/backup/json/backup.json +++ b/api/managementpb/backup/json/backup.json @@ -159,6 +159,332 @@ } } }, + "/v1/management/backup/Backups/ChangeScheduled": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ChangeScheduledBackup changes existing scheduled backup.", + "operationId": "ChangeScheduledBackup", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "cron_expression": { + "description": "How often backup should be run in cron format.", + "type": "string", + "x-order": 2 + }, + "description": { + "description": "Human-readable description.", + "type": "string", + "x-order": 5 + }, + "enabled": { + "type": "boolean", + "x-order": 1 + }, + "name": { + "description": "Name of backup.", + "type": "string", + "x-order": 4 + }, + "scheduled_backup_id": { + "type": "string", + "x-order": 0 + }, + "start_time": { + "description": "First backup wouldn't happen before this time.", + "type": "string", + "format": "date-time", + "x-order": 3 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + }, + "error": { + "type": "string", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 2 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/ListScheduled": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ListScheduledBackups returns all scheduled backups.", + "operationId": "ListScheduledBackups", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "scheduled_backups": { + "type": "array", + "items": { + "description": "ScheduledBackup represents scheduled task for backup.", + "type": "object", + "properties": { + "cron_expression": { + "description": "How often backup will be run in cron format.", + "type": "string", + "x-order": 5 + }, + "data_model": { + "description": "DataModel is a model used for performing a backup.", + "type": "string", + "default": "DATA_MODEL_INVALID", + "enum": [ + "DATA_MODEL_INVALID", + "PHYSICAL", + "LOGICAL" + ], + "x-order": 10 + }, + "description": { + "description": "Description.", + "type": "string", + "x-order": 8 + }, + "enabled": { + "description": "Retry mode.\nRetryMode retry_mode = 10;\nDelay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.\ngoogle.protobuf.Duration retry_interval = 11;\nHow many times to retry a failed backup before giving up.\nuint32 retry_times = 12;\nIf scheduling is enabled.", + "type": "boolean", + "x-order": 9 + }, + "last_run": { + "description": "Last run.", + "type": "string", + "format": "date-time", + "x-order": 12 + }, + "location_id": { + "description": "Machine-readable location ID.", + "type": "string", + "x-order": 3 + }, + "location_name": { + "description": "Location name.", + "type": "string", + "x-order": 4 + }, + "name": { + "description": "Artifact name.", + "type": "string", + "x-order": 7 + }, + "next_run": { + "description": "Next run.", + "type": "string", + "format": "date-time", + "x-order": 13 + }, + "scheduled_backup_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "service_id": { + "description": "Machine-readable service ID.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Service name.", + "type": "string", + "x-order": 2 + }, + "start_time": { + "description": "First backup wouldn't happen before this time.", + "type": "string", + "format": "date-time", + "x-order": 6 + }, + "vendor": { + "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", + "type": "string", + "x-order": 11 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + }, + "error": { + "type": "string", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 2 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/RemoveScheduled": { + "post": { + "tags": [ + "Backups" + ], + "summary": "RemoveScheduledBackup removes existing scheduled backup.", + "operationId": "RemoveScheduledBackup", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "scheduled_backup_id": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + }, + "error": { + "type": "string", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 2 + } + } + } + } + } + } + }, "/v1/management/backup/Backups/Restore": { "post": { "tags": [ @@ -244,7 +570,117 @@ } } }, - "/v1/management/backup/Backups/StartBackup": { + "/v1/management/backup/Backups/Schedule": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ScheduleBackup schedules repeated backup.", + "operationId": "ScheduleBackup", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "cron_expression": { + "description": "How often backup should be run in cron format.", + "type": "string", + "x-order": 2 + }, + "description": { + "description": "Human-readable description.", + "type": "string", + "x-order": 5 + }, + "enabled": { + "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.\ngoogle.protobuf.Duration retry_interval = 7;\nHow many times to retry a failed backup before giving up.\nuint32 retry_times = 8;\nIf scheduling is enabled.", + "type": "boolean", + "x-order": 6 + }, + "location_id": { + "description": "Machine-readable location ID.", + "type": "string", + "x-order": 1 + }, + "name": { + "description": "Name of backup.", + "type": "string", + "x-order": 4 + }, + "service_id": { + "description": "Service identifier where backup should be performed.", + "type": "string", + "x-order": 0 + }, + "start_time": { + "description": "First backup wouldn't happen before this time.", + "type": "string", + "format": "date-time", + "x-order": 3 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "scheduled_backup_id": { + "type": "string", + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + }, + "error": { + "type": "string", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 2 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/Start": { "post": { "tags": [ "Backups" diff --git a/api/managementpb/backup/json/client/backups/backups_client.go b/api/managementpb/backup/json/client/backups/backups_client.go index abe6359a77..3c1de5f224 100644 --- a/api/managementpb/backup/json/client/backups/backups_client.go +++ b/api/managementpb/backup/json/client/backups/backups_client.go @@ -25,13 +25,120 @@ type Client struct { // ClientService is the interface for Client methods type ClientService interface { + ChangeScheduledBackup(params *ChangeScheduledBackupParams) (*ChangeScheduledBackupOK, error) + + ListScheduledBackups(params *ListScheduledBackupsParams) (*ListScheduledBackupsOK, error) + + RemoveScheduledBackup(params *RemoveScheduledBackupParams) (*RemoveScheduledBackupOK, error) + RestoreBackup(params *RestoreBackupParams) (*RestoreBackupOK, error) + ScheduleBackup(params *ScheduleBackupParams) (*ScheduleBackupOK, error) + StartBackup(params *StartBackupParams) (*StartBackupOK, error) SetTransport(transport runtime.ClientTransport) } +/* + ChangeScheduledBackup changes scheduled backup changes existing scheduled backup +*/ +func (a *Client) ChangeScheduledBackup(params *ChangeScheduledBackupParams) (*ChangeScheduledBackupOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewChangeScheduledBackupParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ChangeScheduledBackup", + Method: "POST", + PathPattern: "/v1/management/backup/Backups/ChangeScheduled", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ChangeScheduledBackupReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ChangeScheduledBackupOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ChangeScheduledBackupDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + ListScheduledBackups lists scheduled backups returns all scheduled backups +*/ +func (a *Client) ListScheduledBackups(params *ListScheduledBackupsParams) (*ListScheduledBackupsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListScheduledBackupsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ListScheduledBackups", + Method: "POST", + PathPattern: "/v1/management/backup/Backups/ListScheduled", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ListScheduledBackupsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListScheduledBackupsOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ListScheduledBackupsDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* + RemoveScheduledBackup removes scheduled backup removes existing scheduled backup +*/ +func (a *Client) RemoveScheduledBackup(params *RemoveScheduledBackupParams) (*RemoveScheduledBackupOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRemoveScheduledBackupParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "RemoveScheduledBackup", + Method: "POST", + PathPattern: "/v1/management/backup/Backups/RemoveScheduled", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RemoveScheduledBackupReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*RemoveScheduledBackupOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*RemoveScheduledBackupDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* RestoreBackup restores backup requests the backup restore */ @@ -65,6 +172,39 @@ func (a *Client) RestoreBackup(params *RestoreBackupParams) (*RestoreBackupOK, e return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* + ScheduleBackup schedules backup schedules repeated backup +*/ +func (a *Client) ScheduleBackup(params *ScheduleBackupParams) (*ScheduleBackupOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewScheduleBackupParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ScheduleBackup", + Method: "POST", + PathPattern: "/v1/management/backup/Backups/Schedule", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ScheduleBackupReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ScheduleBackupOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ScheduleBackupDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* StartBackup starts backup request backup specified service to location */ @@ -77,7 +217,7 @@ func (a *Client) StartBackup(params *StartBackupParams) (*StartBackupOK, error) result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "StartBackup", Method: "POST", - PathPattern: "/v1/management/backup/Backups/StartBackup", + PathPattern: "/v1/management/backup/Backups/Start", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, diff --git a/api/managementpb/backup/json/client/backups/change_scheduled_backup_parameters.go b/api/managementpb/backup/json/client/backups/change_scheduled_backup_parameters.go new file mode 100644 index 0000000000..ea18740d67 --- /dev/null +++ b/api/managementpb/backup/json/client/backups/change_scheduled_backup_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backups + +// 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" +) + +// NewChangeScheduledBackupParams creates a new ChangeScheduledBackupParams object +// with the default values initialized. +func NewChangeScheduledBackupParams() *ChangeScheduledBackupParams { + var () + return &ChangeScheduledBackupParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewChangeScheduledBackupParamsWithTimeout creates a new ChangeScheduledBackupParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewChangeScheduledBackupParamsWithTimeout(timeout time.Duration) *ChangeScheduledBackupParams { + var () + return &ChangeScheduledBackupParams{ + + timeout: timeout, + } +} + +// NewChangeScheduledBackupParamsWithContext creates a new ChangeScheduledBackupParams object +// with the default values initialized, and the ability to set a context for a request +func NewChangeScheduledBackupParamsWithContext(ctx context.Context) *ChangeScheduledBackupParams { + var () + return &ChangeScheduledBackupParams{ + + Context: ctx, + } +} + +// NewChangeScheduledBackupParamsWithHTTPClient creates a new ChangeScheduledBackupParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewChangeScheduledBackupParamsWithHTTPClient(client *http.Client) *ChangeScheduledBackupParams { + var () + return &ChangeScheduledBackupParams{ + HTTPClient: client, + } +} + +/*ChangeScheduledBackupParams contains all the parameters to send to the API endpoint +for the change scheduled backup operation typically these are written to a http.Request +*/ +type ChangeScheduledBackupParams struct { + + /*Body*/ + Body ChangeScheduledBackupBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the change scheduled backup params +func (o *ChangeScheduledBackupParams) WithTimeout(timeout time.Duration) *ChangeScheduledBackupParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the change scheduled backup params +func (o *ChangeScheduledBackupParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the change scheduled backup params +func (o *ChangeScheduledBackupParams) WithContext(ctx context.Context) *ChangeScheduledBackupParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the change scheduled backup params +func (o *ChangeScheduledBackupParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the change scheduled backup params +func (o *ChangeScheduledBackupParams) WithHTTPClient(client *http.Client) *ChangeScheduledBackupParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the change scheduled backup params +func (o *ChangeScheduledBackupParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the change scheduled backup params +func (o *ChangeScheduledBackupParams) WithBody(body ChangeScheduledBackupBody) *ChangeScheduledBackupParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the change scheduled backup params +func (o *ChangeScheduledBackupParams) SetBody(body ChangeScheduledBackupBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ChangeScheduledBackupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/managementpb/backup/json/client/backups/change_scheduled_backup_responses.go b/api/managementpb/backup/json/client/backups/change_scheduled_backup_responses.go new file mode 100644 index 0000000000..e31e85897d --- /dev/null +++ b/api/managementpb/backup/json/client/backups/change_scheduled_backup_responses.go @@ -0,0 +1,298 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backups + +// 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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ChangeScheduledBackupReader is a Reader for the ChangeScheduledBackup structure. +type ChangeScheduledBackupReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ChangeScheduledBackupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewChangeScheduledBackupOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewChangeScheduledBackupDefault(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 + } +} + +// NewChangeScheduledBackupOK creates a ChangeScheduledBackupOK with default headers values +func NewChangeScheduledBackupOK() *ChangeScheduledBackupOK { + return &ChangeScheduledBackupOK{} +} + +/*ChangeScheduledBackupOK handles this case with default header values. + +A successful response. +*/ +type ChangeScheduledBackupOK struct { + Payload interface{} +} + +func (o *ChangeScheduledBackupOK) Error() string { + return fmt.Sprintf("[POST /v1/management/backup/Backups/ChangeScheduled][%d] changeScheduledBackupOk %+v", 200, o.Payload) +} + +func (o *ChangeScheduledBackupOK) GetPayload() interface{} { + return o.Payload +} + +func (o *ChangeScheduledBackupOK) 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 +} + +// NewChangeScheduledBackupDefault creates a ChangeScheduledBackupDefault with default headers values +func NewChangeScheduledBackupDefault(code int) *ChangeScheduledBackupDefault { + return &ChangeScheduledBackupDefault{ + _statusCode: code, + } +} + +/*ChangeScheduledBackupDefault handles this case with default header values. + +An unexpected error response. +*/ +type ChangeScheduledBackupDefault struct { + _statusCode int + + Payload *ChangeScheduledBackupDefaultBody +} + +// Code gets the status code for the change scheduled backup default response +func (o *ChangeScheduledBackupDefault) Code() int { + return o._statusCode +} + +func (o *ChangeScheduledBackupDefault) Error() string { + return fmt.Sprintf("[POST /v1/management/backup/Backups/ChangeScheduled][%d] ChangeScheduledBackup default %+v", o._statusCode, o.Payload) +} + +func (o *ChangeScheduledBackupDefault) GetPayload() *ChangeScheduledBackupDefaultBody { + return o.Payload +} + +func (o *ChangeScheduledBackupDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ChangeScheduledBackupDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*ChangeScheduledBackupBody change scheduled backup body +swagger:model ChangeScheduledBackupBody +*/ +type ChangeScheduledBackupBody struct { + + // scheduled backup id + ScheduledBackupID string `json:"scheduled_backup_id,omitempty"` + + // enabled + Enabled bool `json:"enabled,omitempty"` + + // How often backup should be run in cron format. + CronExpression string `json:"cron_expression,omitempty"` + + // First backup wouldn't happen before this time. + // Format: date-time + StartTime strfmt.DateTime `json:"start_time,omitempty"` + + // Name of backup. + Name string `json:"name,omitempty"` + + // Human-readable description. + Description string `json:"description,omitempty"` +} + +// Validate validates this change scheduled backup body +func (o *ChangeScheduledBackupBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateStartTime(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeScheduledBackupBody) validateStartTime(formats strfmt.Registry) error { + + if swag.IsZero(o.StartTime) { // not required + return nil + } + + if err := validate.FormatOf("body"+"."+"start_time", "body", "date-time", o.StartTime.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeScheduledBackupBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeScheduledBackupBody) UnmarshalBinary(b []byte) error { + var res ChangeScheduledBackupBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ChangeScheduledBackupDefaultBody change scheduled backup default body +swagger:model ChangeScheduledBackupDefaultBody +*/ +type ChangeScheduledBackupDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*DetailsItems0 `json:"details"` +} + +// Validate validates this change scheduled backup default body +func (o *ChangeScheduledBackupDefaultBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ChangeScheduledBackupDefaultBody) validateDetails(formats strfmt.Registry) error { + + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ChangeScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ChangeScheduledBackupDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ChangeScheduledBackupDefaultBody) UnmarshalBinary(b []byte) error { + var res ChangeScheduledBackupDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*DetailsItems0 details items0 +swagger:model DetailsItems0 +*/ +type DetailsItems0 struct { + + // type url + TypeURL string `json:"type_url,omitempty"` + + // value + // Format: byte + Value strfmt.Base64 `json:"value,omitempty"` +} + +// Validate validates this details items0 +func (o *DetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *DetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DetailsItems0) UnmarshalBinary(b []byte) error { + var res DetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/backup/json/client/backups/list_scheduled_backups_parameters.go b/api/managementpb/backup/json/client/backups/list_scheduled_backups_parameters.go new file mode 100644 index 0000000000..103f90dd1f --- /dev/null +++ b/api/managementpb/backup/json/client/backups/list_scheduled_backups_parameters.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backups + +// 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" +) + +// NewListScheduledBackupsParams creates a new ListScheduledBackupsParams object +// with the default values initialized. +func NewListScheduledBackupsParams() *ListScheduledBackupsParams { + var () + return &ListScheduledBackupsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListScheduledBackupsParamsWithTimeout creates a new ListScheduledBackupsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListScheduledBackupsParamsWithTimeout(timeout time.Duration) *ListScheduledBackupsParams { + var () + return &ListScheduledBackupsParams{ + + timeout: timeout, + } +} + +// NewListScheduledBackupsParamsWithContext creates a new ListScheduledBackupsParams object +// with the default values initialized, and the ability to set a context for a request +func NewListScheduledBackupsParamsWithContext(ctx context.Context) *ListScheduledBackupsParams { + var () + return &ListScheduledBackupsParams{ + + Context: ctx, + } +} + +// NewListScheduledBackupsParamsWithHTTPClient creates a new ListScheduledBackupsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListScheduledBackupsParamsWithHTTPClient(client *http.Client) *ListScheduledBackupsParams { + var () + return &ListScheduledBackupsParams{ + HTTPClient: client, + } +} + +/*ListScheduledBackupsParams contains all the parameters to send to the API endpoint +for the list scheduled backups operation typically these are written to a http.Request +*/ +type ListScheduledBackupsParams struct { + + /*Body*/ + Body interface{} + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list scheduled backups params +func (o *ListScheduledBackupsParams) WithTimeout(timeout time.Duration) *ListScheduledBackupsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list scheduled backups params +func (o *ListScheduledBackupsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list scheduled backups params +func (o *ListScheduledBackupsParams) WithContext(ctx context.Context) *ListScheduledBackupsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list scheduled backups params +func (o *ListScheduledBackupsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list scheduled backups params +func (o *ListScheduledBackupsParams) WithHTTPClient(client *http.Client) *ListScheduledBackupsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list scheduled backups params +func (o *ListScheduledBackupsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the list scheduled backups params +func (o *ListScheduledBackupsParams) WithBody(body interface{}) *ListScheduledBackupsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the list scheduled backups params +func (o *ListScheduledBackupsParams) SetBody(body interface{}) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ListScheduledBackupsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/managementpb/backup/json/client/backups/list_scheduled_backups_responses.go b/api/managementpb/backup/json/client/backups/list_scheduled_backups_responses.go new file mode 100644 index 0000000000..1058dd4cdd --- /dev/null +++ b/api/managementpb/backup/json/client/backups/list_scheduled_backups_responses.go @@ -0,0 +1,448 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backups + +// 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" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ListScheduledBackupsReader is a Reader for the ListScheduledBackups structure. +type ListScheduledBackupsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListScheduledBackupsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListScheduledBackupsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewListScheduledBackupsDefault(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 + } +} + +// NewListScheduledBackupsOK creates a ListScheduledBackupsOK with default headers values +func NewListScheduledBackupsOK() *ListScheduledBackupsOK { + return &ListScheduledBackupsOK{} +} + +/*ListScheduledBackupsOK handles this case with default header values. + +A successful response. +*/ +type ListScheduledBackupsOK struct { + Payload *ListScheduledBackupsOKBody +} + +func (o *ListScheduledBackupsOK) Error() string { + return fmt.Sprintf("[POST /v1/management/backup/Backups/ListScheduled][%d] listScheduledBackupsOk %+v", 200, o.Payload) +} + +func (o *ListScheduledBackupsOK) GetPayload() *ListScheduledBackupsOKBody { + return o.Payload +} + +func (o *ListScheduledBackupsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ListScheduledBackupsOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListScheduledBackupsDefault creates a ListScheduledBackupsDefault with default headers values +func NewListScheduledBackupsDefault(code int) *ListScheduledBackupsDefault { + return &ListScheduledBackupsDefault{ + _statusCode: code, + } +} + +/*ListScheduledBackupsDefault handles this case with default header values. + +An unexpected error response. +*/ +type ListScheduledBackupsDefault struct { + _statusCode int + + Payload *ListScheduledBackupsDefaultBody +} + +// Code gets the status code for the list scheduled backups default response +func (o *ListScheduledBackupsDefault) Code() int { + return o._statusCode +} + +func (o *ListScheduledBackupsDefault) Error() string { + return fmt.Sprintf("[POST /v1/management/backup/Backups/ListScheduled][%d] ListScheduledBackups default %+v", o._statusCode, o.Payload) +} + +func (o *ListScheduledBackupsDefault) GetPayload() *ListScheduledBackupsDefaultBody { + return o.Payload +} + +func (o *ListScheduledBackupsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ListScheduledBackupsDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*ListScheduledBackupsDefaultBody list scheduled backups default body +swagger:model ListScheduledBackupsDefaultBody +*/ +type ListScheduledBackupsDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*DetailsItems0 `json:"details"` +} + +// Validate validates this list scheduled backups default body +func (o *ListScheduledBackupsDefaultBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListScheduledBackupsDefaultBody) validateDetails(formats strfmt.Registry) error { + + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ListScheduledBackups default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ListScheduledBackupsDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListScheduledBackupsDefaultBody) UnmarshalBinary(b []byte) error { + var res ListScheduledBackupsDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ListScheduledBackupsOKBody list scheduled backups OK body +swagger:model ListScheduledBackupsOKBody +*/ +type ListScheduledBackupsOKBody struct { + + // scheduled backups + ScheduledBackups []*ScheduledBackupsItems0 `json:"scheduled_backups"` +} + +// Validate validates this list scheduled backups OK body +func (o *ListScheduledBackupsOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateScheduledBackups(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ListScheduledBackupsOKBody) validateScheduledBackups(formats strfmt.Registry) error { + + if swag.IsZero(o.ScheduledBackups) { // not required + return nil + } + + for i := 0; i < len(o.ScheduledBackups); i++ { + if swag.IsZero(o.ScheduledBackups[i]) { // not required + continue + } + + if o.ScheduledBackups[i] != nil { + if err := o.ScheduledBackups[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("listScheduledBackupsOk" + "." + "scheduled_backups" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ListScheduledBackupsOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ListScheduledBackupsOKBody) UnmarshalBinary(b []byte) error { + var res ListScheduledBackupsOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ScheduledBackupsItems0 ScheduledBackup represents scheduled task for backup. +swagger:model ScheduledBackupsItems0 +*/ +type ScheduledBackupsItems0 struct { + + // Machine-readable ID. + ScheduledBackupID string `json:"scheduled_backup_id,omitempty"` + + // Machine-readable service ID. + ServiceID string `json:"service_id,omitempty"` + + // Service name. + ServiceName string `json:"service_name,omitempty"` + + // Machine-readable location ID. + LocationID string `json:"location_id,omitempty"` + + // Location name. + LocationName string `json:"location_name,omitempty"` + + // How often backup will be run in cron format. + CronExpression string `json:"cron_expression,omitempty"` + + // First backup wouldn't happen before this time. + // Format: date-time + StartTime strfmt.DateTime `json:"start_time,omitempty"` + + // Artifact name. + Name string `json:"name,omitempty"` + + // Description. + Description string `json:"description,omitempty"` + + // Retry mode. + // RetryMode retry_mode = 10; + // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. + // google.protobuf.Duration retry_interval = 11; + // How many times to retry a failed backup before giving up. + // uint32 retry_times = 12; + // If scheduling is enabled. + Enabled bool `json:"enabled,omitempty"` + + // DataModel is a model used for performing a backup. + // Enum: [DATA_MODEL_INVALID PHYSICAL LOGICAL] + DataModel *string `json:"data_model,omitempty"` + + // Database vendor e.g. PostgreSQL, MongoDB, MySQL. + Vendor string `json:"vendor,omitempty"` + + // Last run. + // Format: date-time + LastRun strfmt.DateTime `json:"last_run,omitempty"` + + // Next run. + // Format: date-time + NextRun strfmt.DateTime `json:"next_run,omitempty"` +} + +// Validate validates this scheduled backups items0 +func (o *ScheduledBackupsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateStartTime(formats); err != nil { + res = append(res, err) + } + + if err := o.validateDataModel(formats); err != nil { + res = append(res, err) + } + + if err := o.validateLastRun(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNextRun(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ScheduledBackupsItems0) validateStartTime(formats strfmt.Registry) error { + + if swag.IsZero(o.StartTime) { // not required + return nil + } + + if err := validate.FormatOf("start_time", "body", "date-time", o.StartTime.String(), formats); err != nil { + return err + } + + return nil +} + +var scheduledBackupsItems0TypeDataModelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DATA_MODEL_INVALID","PHYSICAL","LOGICAL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + scheduledBackupsItems0TypeDataModelPropEnum = append(scheduledBackupsItems0TypeDataModelPropEnum, v) + } +} + +const ( + + // ScheduledBackupsItems0DataModelDATAMODELINVALID captures enum value "DATA_MODEL_INVALID" + ScheduledBackupsItems0DataModelDATAMODELINVALID string = "DATA_MODEL_INVALID" + + // ScheduledBackupsItems0DataModelPHYSICAL captures enum value "PHYSICAL" + ScheduledBackupsItems0DataModelPHYSICAL string = "PHYSICAL" + + // ScheduledBackupsItems0DataModelLOGICAL captures enum value "LOGICAL" + ScheduledBackupsItems0DataModelLOGICAL string = "LOGICAL" +) + +// prop value enum +func (o *ScheduledBackupsItems0) validateDataModelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, scheduledBackupsItems0TypeDataModelPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *ScheduledBackupsItems0) validateDataModel(formats strfmt.Registry) error { + + if swag.IsZero(o.DataModel) { // not required + return nil + } + + // value enum + if err := o.validateDataModelEnum("data_model", "body", *o.DataModel); err != nil { + return err + } + + return nil +} + +func (o *ScheduledBackupsItems0) validateLastRun(formats strfmt.Registry) error { + + if swag.IsZero(o.LastRun) { // not required + return nil + } + + if err := validate.FormatOf("last_run", "body", "date-time", o.LastRun.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ScheduledBackupsItems0) validateNextRun(formats strfmt.Registry) error { + + if swag.IsZero(o.NextRun) { // not required + return nil + } + + if err := validate.FormatOf("next_run", "body", "date-time", o.NextRun.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ScheduledBackupsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ScheduledBackupsItems0) UnmarshalBinary(b []byte) error { + var res ScheduledBackupsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/backup/json/client/backups/remove_scheduled_backup_parameters.go b/api/managementpb/backup/json/client/backups/remove_scheduled_backup_parameters.go new file mode 100644 index 0000000000..d9c8b4b2f1 --- /dev/null +++ b/api/managementpb/backup/json/client/backups/remove_scheduled_backup_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backups + +// 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" +) + +// NewRemoveScheduledBackupParams creates a new RemoveScheduledBackupParams object +// with the default values initialized. +func NewRemoveScheduledBackupParams() *RemoveScheduledBackupParams { + var () + return &RemoveScheduledBackupParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewRemoveScheduledBackupParamsWithTimeout creates a new RemoveScheduledBackupParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewRemoveScheduledBackupParamsWithTimeout(timeout time.Duration) *RemoveScheduledBackupParams { + var () + return &RemoveScheduledBackupParams{ + + timeout: timeout, + } +} + +// NewRemoveScheduledBackupParamsWithContext creates a new RemoveScheduledBackupParams object +// with the default values initialized, and the ability to set a context for a request +func NewRemoveScheduledBackupParamsWithContext(ctx context.Context) *RemoveScheduledBackupParams { + var () + return &RemoveScheduledBackupParams{ + + Context: ctx, + } +} + +// NewRemoveScheduledBackupParamsWithHTTPClient creates a new RemoveScheduledBackupParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewRemoveScheduledBackupParamsWithHTTPClient(client *http.Client) *RemoveScheduledBackupParams { + var () + return &RemoveScheduledBackupParams{ + HTTPClient: client, + } +} + +/*RemoveScheduledBackupParams contains all the parameters to send to the API endpoint +for the remove scheduled backup operation typically these are written to a http.Request +*/ +type RemoveScheduledBackupParams struct { + + /*Body*/ + Body RemoveScheduledBackupBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the remove scheduled backup params +func (o *RemoveScheduledBackupParams) WithTimeout(timeout time.Duration) *RemoveScheduledBackupParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the remove scheduled backup params +func (o *RemoveScheduledBackupParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the remove scheduled backup params +func (o *RemoveScheduledBackupParams) WithContext(ctx context.Context) *RemoveScheduledBackupParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the remove scheduled backup params +func (o *RemoveScheduledBackupParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the remove scheduled backup params +func (o *RemoveScheduledBackupParams) WithHTTPClient(client *http.Client) *RemoveScheduledBackupParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the remove scheduled backup params +func (o *RemoveScheduledBackupParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the remove scheduled backup params +func (o *RemoveScheduledBackupParams) WithBody(body RemoveScheduledBackupBody) *RemoveScheduledBackupParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the remove scheduled backup params +func (o *RemoveScheduledBackupParams) SetBody(body RemoveScheduledBackupBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *RemoveScheduledBackupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/managementpb/backup/json/client/backups/remove_scheduled_backup_responses.go b/api/managementpb/backup/json/client/backups/remove_scheduled_backup_responses.go new file mode 100644 index 0000000000..f26560eb24 --- /dev/null +++ b/api/managementpb/backup/json/client/backups/remove_scheduled_backup_responses.go @@ -0,0 +1,223 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backups + +// 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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RemoveScheduledBackupReader is a Reader for the RemoveScheduledBackup structure. +type RemoveScheduledBackupReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RemoveScheduledBackupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewRemoveScheduledBackupOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewRemoveScheduledBackupDefault(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 + } +} + +// NewRemoveScheduledBackupOK creates a RemoveScheduledBackupOK with default headers values +func NewRemoveScheduledBackupOK() *RemoveScheduledBackupOK { + return &RemoveScheduledBackupOK{} +} + +/*RemoveScheduledBackupOK handles this case with default header values. + +A successful response. +*/ +type RemoveScheduledBackupOK struct { + Payload interface{} +} + +func (o *RemoveScheduledBackupOK) Error() string { + return fmt.Sprintf("[POST /v1/management/backup/Backups/RemoveScheduled][%d] removeScheduledBackupOk %+v", 200, o.Payload) +} + +func (o *RemoveScheduledBackupOK) GetPayload() interface{} { + return o.Payload +} + +func (o *RemoveScheduledBackupOK) 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 +} + +// NewRemoveScheduledBackupDefault creates a RemoveScheduledBackupDefault with default headers values +func NewRemoveScheduledBackupDefault(code int) *RemoveScheduledBackupDefault { + return &RemoveScheduledBackupDefault{ + _statusCode: code, + } +} + +/*RemoveScheduledBackupDefault handles this case with default header values. + +An unexpected error response. +*/ +type RemoveScheduledBackupDefault struct { + _statusCode int + + Payload *RemoveScheduledBackupDefaultBody +} + +// Code gets the status code for the remove scheduled backup default response +func (o *RemoveScheduledBackupDefault) Code() int { + return o._statusCode +} + +func (o *RemoveScheduledBackupDefault) Error() string { + return fmt.Sprintf("[POST /v1/management/backup/Backups/RemoveScheduled][%d] RemoveScheduledBackup default %+v", o._statusCode, o.Payload) +} + +func (o *RemoveScheduledBackupDefault) GetPayload() *RemoveScheduledBackupDefaultBody { + return o.Payload +} + +func (o *RemoveScheduledBackupDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(RemoveScheduledBackupDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*RemoveScheduledBackupBody remove scheduled backup body +swagger:model RemoveScheduledBackupBody +*/ +type RemoveScheduledBackupBody struct { + + // scheduled backup id + ScheduledBackupID string `json:"scheduled_backup_id,omitempty"` +} + +// Validate validates this remove scheduled backup body +func (o *RemoveScheduledBackupBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *RemoveScheduledBackupBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RemoveScheduledBackupBody) UnmarshalBinary(b []byte) error { + var res RemoveScheduledBackupBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*RemoveScheduledBackupDefaultBody remove scheduled backup default body +swagger:model RemoveScheduledBackupDefaultBody +*/ +type RemoveScheduledBackupDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*DetailsItems0 `json:"details"` +} + +// Validate validates this remove scheduled backup default body +func (o *RemoveScheduledBackupDefaultBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *RemoveScheduledBackupDefaultBody) validateDetails(formats strfmt.Registry) error { + + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("RemoveScheduledBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *RemoveScheduledBackupDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *RemoveScheduledBackupDefaultBody) UnmarshalBinary(b []byte) error { + var res RemoveScheduledBackupDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/backup/json/client/backups/restore_backup_responses.go b/api/managementpb/backup/json/client/backups/restore_backup_responses.go index 52977e4d58..601f84a71d 100644 --- a/api/managementpb/backup/json/client/backups/restore_backup_responses.go +++ b/api/managementpb/backup/json/client/backups/restore_backup_responses.go @@ -117,42 +117,6 @@ func (o *RestoreBackupDefault) readResponse(response runtime.ClientResponse, con return nil } -/*DetailsItems0 details items0 -swagger:model DetailsItems0 -*/ -type DetailsItems0 struct { - - // type url - TypeURL string `json:"type_url,omitempty"` - - // value - // Format: byte - Value strfmt.Base64 `json:"value,omitempty"` -} - -// Validate validates this details items0 -func (o *DetailsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DetailsItems0) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DetailsItems0) UnmarshalBinary(b []byte) error { - var res DetailsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} - /*RestoreBackupBody restore backup body swagger:model RestoreBackupBody */ diff --git a/api/managementpb/backup/json/client/backups/schedule_backup_parameters.go b/api/managementpb/backup/json/client/backups/schedule_backup_parameters.go new file mode 100644 index 0000000000..016015242c --- /dev/null +++ b/api/managementpb/backup/json/client/backups/schedule_backup_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backups + +// 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" +) + +// NewScheduleBackupParams creates a new ScheduleBackupParams object +// with the default values initialized. +func NewScheduleBackupParams() *ScheduleBackupParams { + var () + return &ScheduleBackupParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewScheduleBackupParamsWithTimeout creates a new ScheduleBackupParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewScheduleBackupParamsWithTimeout(timeout time.Duration) *ScheduleBackupParams { + var () + return &ScheduleBackupParams{ + + timeout: timeout, + } +} + +// NewScheduleBackupParamsWithContext creates a new ScheduleBackupParams object +// with the default values initialized, and the ability to set a context for a request +func NewScheduleBackupParamsWithContext(ctx context.Context) *ScheduleBackupParams { + var () + return &ScheduleBackupParams{ + + Context: ctx, + } +} + +// NewScheduleBackupParamsWithHTTPClient creates a new ScheduleBackupParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewScheduleBackupParamsWithHTTPClient(client *http.Client) *ScheduleBackupParams { + var () + return &ScheduleBackupParams{ + HTTPClient: client, + } +} + +/*ScheduleBackupParams contains all the parameters to send to the API endpoint +for the schedule backup operation typically these are written to a http.Request +*/ +type ScheduleBackupParams struct { + + /*Body*/ + Body ScheduleBackupBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the schedule backup params +func (o *ScheduleBackupParams) WithTimeout(timeout time.Duration) *ScheduleBackupParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the schedule backup params +func (o *ScheduleBackupParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the schedule backup params +func (o *ScheduleBackupParams) WithContext(ctx context.Context) *ScheduleBackupParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the schedule backup params +func (o *ScheduleBackupParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the schedule backup params +func (o *ScheduleBackupParams) WithHTTPClient(client *http.Client) *ScheduleBackupParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the schedule backup params +func (o *ScheduleBackupParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the schedule backup params +func (o *ScheduleBackupParams) WithBody(body ScheduleBackupBody) *ScheduleBackupParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the schedule backup params +func (o *ScheduleBackupParams) SetBody(body ScheduleBackupBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ScheduleBackupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/managementpb/backup/json/client/backups/schedule_backup_responses.go b/api/managementpb/backup/json/client/backups/schedule_backup_responses.go new file mode 100644 index 0000000000..1a22c20e69 --- /dev/null +++ b/api/managementpb/backup/json/client/backups/schedule_backup_responses.go @@ -0,0 +1,303 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backups + +// 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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ScheduleBackupReader is a Reader for the ScheduleBackup structure. +type ScheduleBackupReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ScheduleBackupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewScheduleBackupOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewScheduleBackupDefault(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 + } +} + +// NewScheduleBackupOK creates a ScheduleBackupOK with default headers values +func NewScheduleBackupOK() *ScheduleBackupOK { + return &ScheduleBackupOK{} +} + +/*ScheduleBackupOK handles this case with default header values. + +A successful response. +*/ +type ScheduleBackupOK struct { + Payload *ScheduleBackupOKBody +} + +func (o *ScheduleBackupOK) Error() string { + return fmt.Sprintf("[POST /v1/management/backup/Backups/Schedule][%d] scheduleBackupOk %+v", 200, o.Payload) +} + +func (o *ScheduleBackupOK) GetPayload() *ScheduleBackupOKBody { + return o.Payload +} + +func (o *ScheduleBackupOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ScheduleBackupOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewScheduleBackupDefault creates a ScheduleBackupDefault with default headers values +func NewScheduleBackupDefault(code int) *ScheduleBackupDefault { + return &ScheduleBackupDefault{ + _statusCode: code, + } +} + +/*ScheduleBackupDefault handles this case with default header values. + +An unexpected error response. +*/ +type ScheduleBackupDefault struct { + _statusCode int + + Payload *ScheduleBackupDefaultBody +} + +// Code gets the status code for the schedule backup default response +func (o *ScheduleBackupDefault) Code() int { + return o._statusCode +} + +func (o *ScheduleBackupDefault) Error() string { + return fmt.Sprintf("[POST /v1/management/backup/Backups/Schedule][%d] ScheduleBackup default %+v", o._statusCode, o.Payload) +} + +func (o *ScheduleBackupDefault) GetPayload() *ScheduleBackupDefaultBody { + return o.Payload +} + +func (o *ScheduleBackupDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ScheduleBackupDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*ScheduleBackupBody schedule backup body +swagger:model ScheduleBackupBody +*/ +type ScheduleBackupBody struct { + + // Service identifier where backup should be performed. + ServiceID string `json:"service_id,omitempty"` + + // Machine-readable location ID. + LocationID string `json:"location_id,omitempty"` + + // How often backup should be run in cron format. + CronExpression string `json:"cron_expression,omitempty"` + + // First backup wouldn't happen before this time. + // Format: date-time + StartTime strfmt.DateTime `json:"start_time,omitempty"` + + // Name of backup. + Name string `json:"name,omitempty"` + + // Human-readable description. + Description string `json:"description,omitempty"` + + // Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h. + // google.protobuf.Duration retry_interval = 7; + // How many times to retry a failed backup before giving up. + // uint32 retry_times = 8; + // If scheduling is enabled. + Enabled bool `json:"enabled,omitempty"` +} + +// Validate validates this schedule backup body +func (o *ScheduleBackupBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateStartTime(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ScheduleBackupBody) validateStartTime(formats strfmt.Registry) error { + + if swag.IsZero(o.StartTime) { // not required + return nil + } + + if err := validate.FormatOf("body"+"."+"start_time", "body", "date-time", o.StartTime.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ScheduleBackupBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ScheduleBackupBody) UnmarshalBinary(b []byte) error { + var res ScheduleBackupBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ScheduleBackupDefaultBody schedule backup default body +swagger:model ScheduleBackupDefaultBody +*/ +type ScheduleBackupDefaultBody struct { + + // error + Error string `json:"error,omitempty"` + + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*DetailsItems0 `json:"details"` +} + +// Validate validates this schedule backup default body +func (o *ScheduleBackupDefaultBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ScheduleBackupDefaultBody) validateDetails(formats strfmt.Registry) error { + + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ScheduleBackup default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ScheduleBackupDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ScheduleBackupDefaultBody) UnmarshalBinary(b []byte) error { + var res ScheduleBackupDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/*ScheduleBackupOKBody schedule backup OK body +swagger:model ScheduleBackupOKBody +*/ +type ScheduleBackupOKBody struct { + + // scheduled backup id + ScheduledBackupID string `json:"scheduled_backup_id,omitempty"` +} + +// Validate validates this schedule backup OK body +func (o *ScheduleBackupOKBody) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ScheduleBackupOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ScheduleBackupOKBody) UnmarshalBinary(b []byte) error { + var res ScheduleBackupOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/managementpb/backup/json/client/backups/start_backup_responses.go b/api/managementpb/backup/json/client/backups/start_backup_responses.go index 6129614197..f0fced1a84 100644 --- a/api/managementpb/backup/json/client/backups/start_backup_responses.go +++ b/api/managementpb/backup/json/client/backups/start_backup_responses.go @@ -56,7 +56,7 @@ type StartBackupOK struct { } func (o *StartBackupOK) Error() string { - return fmt.Sprintf("[POST /v1/management/backup/Backups/StartBackup][%d] startBackupOk %+v", 200, o.Payload) + return fmt.Sprintf("[POST /v1/management/backup/Backups/Start][%d] startBackupOk %+v", 200, o.Payload) } func (o *StartBackupOK) GetPayload() *StartBackupOKBody { @@ -98,7 +98,7 @@ func (o *StartBackupDefault) Code() int { } func (o *StartBackupDefault) Error() string { - return fmt.Sprintf("[POST /v1/management/backup/Backups/StartBackup][%d] StartBackup default %+v", o._statusCode, o.Payload) + return fmt.Sprintf("[POST /v1/management/backup/Backups/Start][%d] StartBackup default %+v", o._statusCode, o.Payload) } func (o *StartBackupDefault) GetPayload() *StartBackupDefaultBody { diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json index e3a1185190..1096cf0717 100644 --- a/api/swagger/swagger-dev.json +++ b/api/swagger/swagger-dev.json @@ -24660,6 +24660,332 @@ } } }, + "/v1/management/backup/Backups/ChangeScheduled": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ChangeScheduledBackup changes existing scheduled backup.", + "operationId": "ChangeScheduledBackup", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "scheduled_backup_id": { + "type": "string", + "x-order": 0 + }, + "enabled": { + "type": "boolean", + "x-order": 1 + }, + "cron_expression": { + "description": "How often backup should be run in cron format.", + "type": "string", + "x-order": 2 + }, + "start_time": { + "description": "First backup wouldn't happen before this time.", + "type": "string", + "format": "date-time", + "x-order": 3 + }, + "name": { + "description": "Name of backup.", + "type": "string", + "x-order": 4 + }, + "description": { + "description": "Human-readable description.", + "type": "string", + "x-order": 5 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/ListScheduled": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ListScheduledBackups returns all scheduled backups.", + "operationId": "ListScheduledBackups", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "scheduled_backups": { + "type": "array", + "items": { + "description": "ScheduledBackup represents scheduled task for backup.", + "type": "object", + "properties": { + "scheduled_backup_id": { + "description": "Machine-readable ID.", + "type": "string", + "x-order": 0 + }, + "service_id": { + "description": "Machine-readable service ID.", + "type": "string", + "x-order": 1 + }, + "service_name": { + "description": "Service name.", + "type": "string", + "x-order": 2 + }, + "location_id": { + "description": "Machine-readable location ID.", + "type": "string", + "x-order": 3 + }, + "location_name": { + "description": "Location name.", + "type": "string", + "x-order": 4 + }, + "cron_expression": { + "description": "How often backup will be run in cron format.", + "type": "string", + "x-order": 5 + }, + "start_time": { + "description": "First backup wouldn't happen before this time.", + "type": "string", + "format": "date-time", + "x-order": 6 + }, + "name": { + "description": "Artifact name.", + "type": "string", + "x-order": 7 + }, + "description": { + "description": "Description.", + "type": "string", + "x-order": 8 + }, + "enabled": { + "description": "Retry mode.\nRetryMode retry_mode = 10;\nDelay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.\ngoogle.protobuf.Duration retry_interval = 11;\nHow many times to retry a failed backup before giving up.\nuint32 retry_times = 12;\nIf scheduling is enabled.", + "type": "boolean", + "x-order": 9 + }, + "data_model": { + "description": "DataModel is a model used for performing a backup.", + "type": "string", + "default": "DATA_MODEL_INVALID", + "enum": [ + "DATA_MODEL_INVALID", + "PHYSICAL", + "LOGICAL" + ], + "x-order": 10 + }, + "vendor": { + "description": "Database vendor e.g. PostgreSQL, MongoDB, MySQL.", + "type": "string", + "x-order": 11 + }, + "last_run": { + "description": "Last run.", + "type": "string", + "format": "date-time", + "x-order": 12 + }, + "next_run": { + "description": "Next run.", + "type": "string", + "format": "date-time", + "x-order": 13 + } + } + }, + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/RemoveScheduled": { + "post": { + "tags": [ + "Backups" + ], + "summary": "RemoveScheduledBackup removes existing scheduled backup.", + "operationId": "RemoveScheduledBackup", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "scheduled_backup_id": { + "type": "string", + "x-order": 0 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, "/v1/management/backup/Backups/Restore": { "post": { "tags": [ @@ -24745,7 +25071,117 @@ } } }, - "/v1/management/backup/Backups/StartBackup": { + "/v1/management/backup/Backups/Schedule": { + "post": { + "tags": [ + "Backups" + ], + "summary": "ScheduleBackup schedules repeated backup.", + "operationId": "ScheduleBackup", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "service_id": { + "description": "Service identifier where backup should be performed.", + "type": "string", + "x-order": 0 + }, + "location_id": { + "description": "Machine-readable location ID.", + "type": "string", + "x-order": 1 + }, + "cron_expression": { + "description": "How often backup should be run in cron format.", + "type": "string", + "x-order": 2 + }, + "start_time": { + "description": "First backup wouldn't happen before this time.", + "type": "string", + "format": "date-time", + "x-order": 3 + }, + "name": { + "description": "Name of backup.", + "type": "string", + "x-order": 4 + }, + "description": { + "description": "Human-readable description.", + "type": "string", + "x-order": 5 + }, + "enabled": { + "description": "Delay between each retry. Should have a suffix in JSON: 1s, 1m, 1h.\ngoogle.protobuf.Duration retry_interval = 7;\nHow many times to retry a failed backup before giving up.\nuint32 retry_times = 8;\nIf scheduling is enabled.", + "type": "boolean", + "x-order": 6 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "scheduled_backup_id": { + "type": "string", + "x-order": 0 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string", + "x-order": 0 + }, + "code": { + "type": "integer", + "format": "int32", + "x-order": 1 + }, + "message": { + "type": "string", + "x-order": 2 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type_url": { + "type": "string", + "x-order": 0 + }, + "value": { + "type": "string", + "format": "byte", + "x-order": 1 + } + } + }, + "x-order": 3 + } + } + } + } + } + } + }, + "/v1/management/backup/Backups/Start": { "post": { "tags": [ "Backups"