The SpaceONE command-line tool, spacectl, allows you to run commands against resources managed by SpaceONE.
API Reference: https://cloudforet.gitbook.io/cloudforet-apis
Install the latest release with the command from PyPI using pip:
sudo pip install --upgrade pip
sudo pip install spacectl
There are a few variants on getting helps. A list of global options and supported commands are available with --help:
spacectl --help
The following commands run spacectl to set your own configurations and endpoints. It handles setting the environments, authenticating and targets. Run it like these:
-
Set up spacectl configuration
spacectl config init # input environment on shell spacectl config set api_key <api_key> spacectl config endpoint add <service> <endpoint>
-
(OR) Import a configuration file which you downloaded at SpaceONE console
spacectl config init -f <import_file>
The <import_file> looks like
api_key: <JWT_API_KEY>
endpoints:
identity: grpc://identity:50051
inventory: grpc://inventory:50051
plugin: grpc://plugin:50051
repository: grpc://repository:50051
secret: grpc://secret:50051
...
if you want to see a sample configuration file, try examples/configuration.yaml.
The following commands list all available spacectl APIs. Run it like this:
spacectl api-resources
spacectl list inventory.CloudServiceType -p provider=aws
spacectl exec create project_group -p name=<project_group_name>
spacectl list cost_analysis.Cost -p provider=aws -p region_code=us-east-1 --limit 10
- get: Show details of a specific resource
- list: Display one or many resources
- apply: Get, list, create or update various resources and execute other tasks
- stat: Querying statistics for resources
- exec: Execute a method to resource
- template: Manage resource templates
The following details are documented in docs/configuration.md
- Config Concept
- Quick Start
- Manage Endpoints
- Switch the Environment