Commands
Commands
Exploring the CLI
You can explore the CLI using the help command. Help option can be used on any command:
vgs --help
vgs <COMMAND> --help
Authentication
Login
Authenticate with your personal VGS account:
vgs login
You may be asked to allow storing data in your OS key management system (Mac OS Keychain, Linux Secret Service, Windows Credential Vault).
Logout
Sessions automatically expire after 30 minutes of inactivity. You can also log out manually:
vgs logout
Service Account
Please check the Service Account page for more info.
Generate
Generate the service account configuration from the vgs-cli template and store it to the service_account.yaml file:
vgs generate service-account -t vgs-cli > service_account.yaml
Apply
To apply the service account configuration stored in the service_account.yaml file with your organization ID and execute:
vgs apply service-account -O <ORGANIZATION_ID> -f service_account.yaml
Delete
To delete the service account, specify your organization ID, service account client ID and execute:
vgs delete service-account -O <ORGANIZATION_ID> <SERVICE_ACCOUNT_CLIENT_ID>
Access Credentials
VGS CLI can be used to manage access credentials of the vault.
Generate
Generate a new set of access credentials to the vault
vgs generate access-credentials --vault <VAULT_ID>
Get
List all access credentials in the vault
vgs get access-credentials --vault <VAULT_ID>
Routes
VGS CLI can be used to manage route configurations of the vault.
Routes Payload Reference
Get
Get details of your routes in YAML format:
vgs get routes --vault <VAULT_ID>
Please refer to the documentation for more information.
To write route details to a file:
vgs get routes --vault <VAULT_ID> > routes.yaml
Please refer to the documentation for more information.
Apply
Create or update the route:
vgs apply routes --vault <VAULT_ID> -f routes.yaml
Please refer to the documentation for more information.
Vaults
Generate
Print an empty template to create a new vault from:
vgs generate vault > vault.yaml
Apply
Create a new vault from a template file:
vgs apply vault -O <ORGANIZATION_ID> -f vault.yaml
Make sure to save generated user credentials as they're only shown once.
Get
Get details of your vaults in a YAML format:
vgs get vaults
Organizations
Get
Get details of your organizations in a YAML format:
vgs get organizations
Logs
Access
Print access logs for the vault. Log records are grouped by 30 items by default if --tail
option is not specified or larger than 30. Could be fetched up to 1020 rows at a time:
vgs logs access [OPTIONS]
Options
--vault, -V
Set target vault to get logs (e.g. tnt23f12a3g).
--since
Print logs newer than a relative duration (e.g. 30s, 5m, or 3h) or after a specific RFC 3339 date.
--until
Print logs older than a relative duration (e.g. 30s, 5m, or 3h) or before a specific RFC 3339 date.
--tail
Set number of records to show from the end of the logs. Defaults to all logs if unspecified.
--output, -o
Define output format. Possible values: json, yaml. Defaults to yaml if unspecified.
Examples
vgs logs access --vault <VAULT_ID> --since 2020-08-01T12:30:45
vgs logs access --vault <VAULT_ID> --since 1h
vgs logs access --vault <VAULT_ID> --until 2020-08-01T12:30:45
vgs logs access --vault <VAULT_ID> --until 8h
vgs logs access --vault <VAULT_ID> --tail 10
vgs logs access --vault <VAULT_ID> --output json
Operations
Print operation logs for the particular request:
vgs logs operations [OPTIONS]
Options
--vault, -V
Set target vault to get logs (e.g. tnt23f12a3g).
--request, -R
Set request id to get logs. (e.g. 3f2ab1258a87bc03f18d41a71cf317ee).
--output, -o
Define output format. Possible values: json, yaml. Defaults to yaml if unspecified.
Examples
vgs logs operations --vault <VAULT_ID> --request <REQUEST_ID>
vgs logs operations --vault <VAULT_ID> --request <REQUEST_ID> --output json
Last updated