cirrus

command module
v0.0.0-...-1e28c7c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2021 License: MIT Imports: 1 Imported by: 0

README

cirrus

Get IPs of all your cloud resources

Quick start

go get github.com/kabachook/cirrus/...
cirrus -h
Cloud Inventory made easy

Usage:
  cirrus [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  gcp         Google Cloud Platform
  help        Help about any command
  server      Run as server
  yc          Yandex Cloud

Flags:
      --config string   config file (default is $HOME/.cirrus.yaml)
  -h, --help            help for cirrus

Use "cirrus [command] --help" for more information about a command.

Example

$ cirrus gcp all --project my-project --key key.json
{"level":"info","ts":1625912546.2882447,"caller":"cmd/gcp_all.go:72","msg":"Got endpoints"}
{"level":"info","ts":1625912546.2884,"caller":"cmd/gcp_all.go:79","msg":"","endpoints":[{"cloud":"gcp","ip":"10.142.0.2","type":"compute#instance","name":"venus01"},{"cloud":"gcp","ip":"35.185.126.199","type":"compute#instance","name":"venus01"}]}

Config

Defalt config path is $HOME/.cirrus.yaml. It can be overriden with -c flag/

Example config:

gcp:
  key: key.json # Path to key file
  project: my-project
  zones:
    - europe-north1-a
    - europe-north1-b
    - europe-north1-c
    - us-east1-d
  aggregated: true # use aggregated queries if possible

yc:
  token: AQAA... # OAuth token
  folderId: b1...
  zones:
    - ru-central1-a
    - ru-central1-b
    - ru-central1-c

server:
  providers:
    - gcp
    - yc
  scan: 1h

db:
  path: cirrus.db # Path for database

Server mode

You can run API and Web interface using server command:

$ cirrus server
{"level":"info","ts":1625912770.090399,"logger":"db","caller":"bbolt/database.go:44","msg":"Database opened"}
{"level":"info","ts":1625912770.0917914,"logger":"server","caller":"server/generator.go:28","msg":"Provider added","name":"gcp"}
{"level":"info","ts":1625912770.091823,"logger":"server","caller":"server/generator.go:28","msg":"Provider added","name":"yc"}

API routes list

In order to run Web interface you should bundle frontend before running server:

cd frontend
yarn
yarn build

Documentation

Overview

Copyright © 2021 Danil Beltyukov <root@danil.co>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
pkg
cmd
Constant keys for viper config
Constant keys for viper config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL