-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement describe backup in CLI (#219)
- Loading branch information
Showing
12 changed files
with
528 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"data": { | ||
"spec": { | ||
"cluster_id": "d6954ca7-fc4f-4454-9ce2-8c2e10ed9deb", | ||
"retention_period_in_days": 1, | ||
"backup_type": "FULL", | ||
"description": null | ||
}, | ||
"info": { | ||
"id": "5574d58f-68f1-4762-baa1-c2421cdb38b0", | ||
"cluster_name": "mirthful-mole", | ||
"state": "SUCCEEDED", | ||
"action_type": "MANUAL", | ||
"keyspace_info": [ | ||
{ | ||
"table_type": "YSQL", | ||
"keyspaces": [ | ||
"yugabyte" | ||
] | ||
}, | ||
{ | ||
"table_type": "YCQL", | ||
"keyspaces": [ | ||
"my_keyspace" | ||
] | ||
} | ||
], | ||
"size_in_bytes": 1176035, | ||
"deleted_on": "2024-03-08T17:58:28.606890Z", | ||
"completed_on": "2024-03-07T17:58:28.606907Z", | ||
"num_incremental_backups": 0, | ||
"last_incremental_backup_completed_on": null, | ||
"last_full_backup_completed_on": "2024-03-06T20:56:34.214975Z", | ||
"backup_chain_size_in_bytes": 1176035, | ||
"backup_current_chain_size_in_bytes": 1176035, | ||
"tablespaces": [], | ||
"base_backup_id": null, | ||
"metadata": { | ||
"created_on": "2024-03-07T17:56:14.553Z", | ||
"updated_on": "2024-03-07T17:58:29.113Z" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## ybm backup describe | ||
|
||
Describe backup for a cluster in YugabyteDB Managed | ||
|
||
### Synopsis | ||
|
||
Describe backup for a cluster in YugabyteDB Managed | ||
|
||
``` | ||
ybm backup describe [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--backup-id string [REQUIRED] The backup ID. | ||
-h, --help help for describe | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
-a, --apiKey string YBM Api Key | ||
--config string config file (default is $HOME/.ybm-cli.yaml) | ||
--debug Use debug mode, same as --logLevel debug | ||
-l, --logLevel string Select the desired log level format(info). Default to info | ||
--no-color Disable colors in output , default to false | ||
-o, --output string Select the desired output format (table, json, pretty). Default to table | ||
--timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s) | ||
--wait Wait until the task is completed, otherwise it will exit immediately, default to false | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [ybm backup](ybm_backup.md) - Manage backup operations of a cluster | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## ybm db-audit-logs-exporter | ||
|
||
Manage DB Audit Logs | ||
|
||
### Synopsis | ||
|
||
Manage DB Audit Logs | ||
|
||
``` | ||
ybm db-audit-logs-exporter [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for db-audit-logs-exporter | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
-a, --apiKey string YBM Api Key | ||
--config string config file (default is $HOME/.ybm-cli.yaml) | ||
--debug Use debug mode, same as --logLevel debug | ||
-l, --logLevel string Select the desired log level format(info). Default to info | ||
--no-color Disable colors in output , default to false | ||
-o, --output string Select the desired output format (table, json, pretty). Default to table | ||
--timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s) | ||
--wait Wait until the task is completed, otherwise it will exit immediately, default to false | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [ybm](ybm.md) - ybm - Effortlessly manage your DB infrastructure on YugabyteDB Managed (DBaaS) from command line! | ||
* [ybm db-audit-logs-exporter assign](ybm_db-audit-logs-exporter_assign.md) - Assign DB Audit | ||
* [ybm db-audit-logs-exporter list](ybm_db-audit-logs-exporter_list.md) - List DB Audit Logs Export Config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
## ybm db-audit-logs-exporter assign | ||
|
||
Assign DB Audit | ||
|
||
### Synopsis | ||
|
||
Assign DB Audit Logs to a Cluster | ||
|
||
``` | ||
ybm db-audit-logs-exporter assign [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--telemetry-provider-id string [REQUIRED] The ID of the telemetry provider | ||
--ysql-config stringToString [REQUIRED] The ysql config to setup DB auditting | ||
Please provide key value pairs as follows: | ||
log_catalog=<boolean>,log_level=<LOG_LEVEL> (default []) | ||
--statement_classes string [REQUIRED] The ysql config statement classes | ||
Please provide key value pairs as follows: | ||
statement_classes=READ,WRITE,MISC | ||
--cluster-id string [REQUIRED] The cluster ID to assign DB auditting | ||
-h, --help help for assign | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
-a, --apiKey string YBM Api Key | ||
--config string config file (default is $HOME/.ybm-cli.yaml) | ||
--debug Use debug mode, same as --logLevel debug | ||
-l, --logLevel string Select the desired log level format(info). Default to info | ||
--no-color Disable colors in output , default to false | ||
-o, --output string Select the desired output format (table, json, pretty). Default to table | ||
--timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s) | ||
--wait Wait until the task is completed, otherwise it will exit immediately, default to false | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [ybm db-audit-logs-exporter](ybm_db-audit-logs-exporter.md) - Manage DB Audit Logs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## ybm db-audit-logs-exporter list | ||
|
||
List DB Audit Logs Export Config | ||
|
||
### Synopsis | ||
|
||
List DB Audit Logs Export Config | ||
|
||
``` | ||
ybm db-audit-logs-exporter list [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--cluster-id string [REQUIRED] The cluster ID to list DB audit export config | ||
-h, --help help for list | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
-a, --apiKey string YBM Api Key | ||
--config string config file (default is $HOME/.ybm-cli.yaml) | ||
--debug Use debug mode, same as --logLevel debug | ||
-l, --logLevel string Select the desired log level format(info). Default to info | ||
--no-color Disable colors in output , default to false | ||
-o, --output string Select the desired output format (table, json, pretty). Default to table | ||
--timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s) | ||
--wait Wait until the task is completed, otherwise it will exit immediately, default to false | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [ybm db-audit-logs-exporter](ybm_db-audit-logs-exporter.md) - Manage DB Audit Logs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Licensed to Yugabyte, Inc. under one or more contributor license | ||
// agreements. See the NOTICE file distributed with this work for | ||
// additional information regarding copyright ownership. Yugabyte | ||
// licenses this file to you under the Apache License, Version 2.0 | ||
// (the "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package backup | ||
|
||
import ( | ||
ybmclient "github.com/yugabyte/yugabytedb-managed-go-client-internal" | ||
) | ||
|
||
// This struct is an attempt to consilidate Backup information | ||
type FullBackup struct { | ||
Backup ybmclient.BackupData | ||
Databases []ybmclient.BackupKeyspaceInfo | ||
} | ||
|
||
func NewFullBackup(backupData ybmclient.BackupData) *FullBackup { | ||
fb := &FullBackup{ | ||
Backup: backupData, | ||
Databases: backupData.Info.GetKeyspaceInfo(), | ||
} | ||
return fb | ||
} |
Oops, something went wrong.