Summary:
Adding CLI support for attach/detach APIs. The commands are currently under the PREVIEW feature flag.
This implementation uses the v2 APIs:
```
POST- /api/v2/customers/:cUUID/universes/:uniUUID/detach
POST- /api/v2/customers/:cUUID/universes/:uniUUID/attach
DELETE- /api/v2/customers/:cUUID/universes/:uniUUID/attach-detach-metadata
```
Detach:
```
Synopsis
Detach a universe from a YugabyteDB Anywhere by exporting its metadata and locking it.
yba universe detach [flags]
Examples
yba universe detach --name <universe-name> --path <spec-file-path> --skip-releases=false
Options
-n, --name string [Required] Name of the universe to be detached.
--path string [Optional] The custom directory path to save the detached universe metadata. If not provided, the metadata will be saved in the path provided in "directory".
-s, --skip-releases [Optional] Whether to skip ybdb and ybc releases from being included in the metadata.
-h, --help help for detach
```
Delete Metadata:
```
Synopsis
Delete metadata of a universe from a YugabyteDB Anywhere. Metadata shared by other universes is not deleted.
yba universe delete-metadata [flags]
Examples
yba universe delete-metadata --name <universe-name>
Options
-n, --name string [Required] Name of the universe whose metadata is to be deleted, at the source YugabyteDB Anywhere.
-h, --help help for delete-metadata
```
Attach:
```
Synopsis
Attach a previously detached universe to this YugabyteDB Anywhere using its metadata spec (tar.gz) file.
yba universe attach [flags]
Examples
yba universe attach --name <universe-name> --path <spec-file-path>
Options
-n, --name string [Required] Name of the universe to be attached.
--path string [Optional] The custom directory path or file path to the universe metadata file. If not provided, the CLI will look for 'yb-detached-universe-<universe-name>.tar.gz' in the directory specified by --directory.
-h, --help help for attach
```
Test Plan:
Manually tested the CLI commands:
`yba universe detach --name <universe-name> --path <spec-file-path> --skip-releases=<true/false>`
`yba universe delete-metadata --name <universe-name>`
`yba universe attach --name <universe-name> --path <spec-file-path>`
Note: Tested that duplicate universes on the same YBA are not allowed (i.e. 2 universes with same names)
Reviewers: dkumar
Reviewed By: dkumar
Subscribers: dkumar
Differential Revision: https://phorge.dev.yugabyte.com/D44126