https://github.com/svenmueller/nube
CLI for managing commercetools cloud resources on Rackspace/AWS
https://github.com/svenmueller/nube
api cli cloud golang rackspace route53
Last synced: 11 months ago
JSON representation
CLI for managing commercetools cloud resources on Rackspace/AWS
- Host: GitHub
- URL: https://github.com/svenmueller/nube
- Owner: svenmueller
- License: apache-2.0
- Created: 2016-03-21T23:26:05.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-12T10:57:34.000Z (over 9 years ago)
- Last Synced: 2025-02-26T20:15:30.241Z (over 1 year ago)
- Topics: api, cli, cloud, golang, rackspace, route53
- Language: Go
- Size: 1.63 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nube CLI
[](https://travis-ci.org/svenmueller/nube)
`nube` is a CLI for managing commercetools cloud resources on Rackspace/AWS. The word "nube" is taken from the spanish language and simply means "cloud".
## Installation
Using `go get`:
```bash
$ go get github.com/svenmueller/nube
```
Or clone and build yourself:
```bash
$ git clone
$ go get
```
Or using Docker:
```bash
$ docker run --rm -v ~/.nube.yaml:/root/.nube.yaml svenmueller/nube
```
In case you want to pass a file to `---user-data-file`, you need to mount Docker volume.
```bash
$ docker run --rm -v ~/.nube.yaml:/root/.nube.yaml -v /path/to/user-data-file svenmueller/nube
```
Define an alias for repeated calls in (add line to `~/.profile`)
```bash
alias nube='docker run --rm -v ~/.nube.yaml:/root/.nube.yaml svenmueller/nube'
```
## Usage
```bash
Manage Rackspace and AWS resources
Usage:
nube [command]
Available Commands:
dns AWS Route53 DNS commands
servers Rackspace Cloud Server commands
Flags:
--aws-access-key-id string AWS Access Key ID
--aws-secret-access-key string AWS Secret Access Key
--config string Configuration file (default is $HOME/.nube.yaml)
-h, --help help for nube
-o, --output string Output format [yaml|json] (default "yaml")
--profile string Profile name. (default "default")
--rackspace-api-key string Rackspace API key
--rackspace-region string Rackspace region name (default "LON")
--rackspace-username string Rackspace API username
Use "nube [command] --help" for more information about a command.
```
### Examples
```bash
# List all server instances
$ nube servers instance list
```
```bash
# Create 3 server instances (using defaults for flavor/size etc.)
$ nube servers instance create server1 server2 server3
```
```bash
# Create 1 server instance using custom flavor/image and user-data file
$ nube servers instance create server1 \
--flavor="2 GB Performance" \
--image="Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)" \
--user-data-file=cloud-config.yaml
```
```bash
# Destroy 3 server instances using ID or name
$ nube servers instance destroy cdf0bb56 server2.example.com server3.example.com
```
```bash
# List all hosted zones
$ nube dns zones list
```
```bash
# List all resource records of for given hosted zone ID
$ nube dns records list /hostedzone/XXXXXX
```
## Configuration
There are multiple ways to set values for `nube` CLI. All values are looked up in the following order:
- Configuration file (default path is `~/.nube.yaml`)
- Environment variable (upper case, prefix `NUBE_`, `-` replaced by `_`, e.g. `NUBE_RACKSPACE_USERNAME`)
- Flags (e.g. `--rackspace-username`)
Example configuration file (`~/.nube.yaml`)
```yaml
default:
rackspace-username: bart.simpson
rackspace-api-key: 12121212121
rackspace-region: LON
aws-access-key-id: 113131313131313
aws-secret-access-key: 00000000000
# to avoid having to pass --hosted-zone-id option to create resource record set
# hosted-zone-id: /hostedzone/XXXXXXX
```
### Named Profiles
The nube CLI supports named profiles stored in the config files. You can configure additional profiles by adding entries to the config files.
The following example shows a config file with two profiles:
```yaml
default:
username: homer.simpson.dev
password: 3342h3c23423423
production:
username: homer.simpson.prod
password: dfsfw4534534534
```
To use a named profile, add the `--profile` option to your command. The following example lists server instances using the `production` profile from example above.
```bash
# List all hosted zones
$ nube dns zones list
```
By default, the named profile `default` is used if no `--profile` option is found.