Skip to main content

View instance information on all supported cloud providers

Project description

cloudview

View instance information on all supported cloud providers: Amazon Web Services, Azure, Google Compute Platform & OpenStack.

Build Status

Usage

Usage: cloudview [OPTIONS]
Options:
    -h, --help                          show this help message and exit
    -l, --log debug|info|warning|error|critical
    -o, --output text|html|json|JSON    output type
    -p, --port PORT                     run a web server on port PORT
    -r, --reverse                       reverse sort
    -s, --sort name|time|status         sort type
    -S, --status stopped|running|all    filter by instance status
    -T, --time TIME_FORMAT              time format as used by strftime(3)
    -v, --verbose                       be verbose
    -V, --version                       show version and exit
Filter options:
    --filter-aws NAME VALUE             may be specified multiple times
    --filter-azure FILTER               Filter for Azure
    --filter-gcp FILTER                 Filter for GCP
    --filter-nova NAME VALUE            may be specified multiple times

NOTES:

  • Use --output JSON to dump all available information received from each provider.
  • Remember to set these environment variables:
    • GOOGLE_APPLICATION_CREDENTIALS
    • AWS_ACCESS_KEY_ID
    • AWS_DEFAULT_REGION
    • AWS_SECRET_ACCESS_KEY
    • AZURE_TENANT_ID
    • AZURE_SUBSCRIPTION_ID
    • AZURE_CLIENT_SECRET
    • AZURE_CLIENT_ID
    • OS_USERNAME
    • OS_PASSWORD
    • OS_PROJECT_ID
    • OS_AUTH_URL
    • OS_USER_DOMAIN_NAME
    • OS_CACERT

This script is best run with Docker to have all dependencies in just one package, but it may be run stand-alone on systems with Python 3.5+

To run stand-alone:

pip3 install --user cloudview

To run with Docker:

Build image with:

docker build -t cloud --pull .

Export the variables listed in the .dockerenv file and run with:

docker run --rm -v "$GOOGLE_APPLICATION_CREDENTIALS:$GOOGLE_APPLICATION_CREDENTIALS:ro" -v "$OS_CACERT:$OS_CACERT:ro" --env-file .dockerenv cloudview --status all

Run the web server with Docker Compose:

If you have a TLS key pair, rename the certificate to cert.pem, the private key to key.pem and the file containing the password to the private key to key.txt. Then edit the docker-compose.yml file to mount them to /etc/nginx/ssl in read-only mode like this: - "/path/to/tls:/etc/nginx/ssl:ro".

If you don't have a TLS key pair, a self-signed certificate will be generated. Be aware of the typical problems with time resolution related to TLS certificates.

docker-compose up -d

Now browse to https://localhost:8443

To stop the web server:

docker-compose down

To rebuild with latest version:

docker-compose build --pull

Filter options (AWS)

Usage: --filter-aws NAME VALUE

May be specified multiple times.

Complete list of filters:

https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html

Example: --filter-aws tag-key production

Note: If instance-state-name is present in the filter name, the --status option is ignored.

Filter options (Azure)

Usage: --filter-azure FILTER

Note: This filtering is done in the client SDK using JMESPath to filter the JSON response. You can view the JSON output using --output JSON or following the instance link in the HTML table.

Complete list of filters: https://github.com/MicrosoftDocs/azure-docs-cli/blob/master/docs-ref-conceptual/query-azure-cli.md#filter-arrays

Example: --filter-azure "location == 'westeurope' && !(name == 'admin')"

Note: If instance_view.statuses is present in the filter, the --status option is ignored.

Filter options (GCP)

Usage: --filter-gcp FILTER

Note: You may filter the resources listed in the API response.

Complete list of resources:

https://cloud.google.com/compute/docs/reference/rest/v1/instances/list

Example: --filter-gcp 'name: instance-1 AND canIpForward: false'

Note: If status is present in the filter, the --status option is ignored.

Filter options (Nova)

Usage: --filter-nova NAME VALUE

May be specified multiple times.

Complete list of filters:

https://developer.openstack.org/api-ref/compute/?expanded=list-servers-detail#listServers

Example: --filter-nova name admin1

Note: If status is present in the filter, the --status option is ignored.

TODO

  • Search by tag (this can be done currently with the filter-* options)
  • Sort by instance type
  • Use apache-libcloud?
  • Improve documentation with use cases

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloudview-0.2.7.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

cloudview-0.2.7-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file cloudview-0.2.7.tar.gz.

File metadata

  • Download URL: cloudview-0.2.7.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for cloudview-0.2.7.tar.gz
Algorithm Hash digest
SHA256 f9ae355e3094b330434ac12b85fe721565e5e9b207e0636ad8553de1f42ed137
MD5 3f4605d87777b831c8d6373b64ec98db
BLAKE2b-256 eaf4bde0516cde080fa6a97dc6227482a3fdfda93cf19c75ec8eb309c35aa445

See more details on using hashes here.

File details

Details for the file cloudview-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: cloudview-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for cloudview-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d0604d2514645213686e967c2b809c422d11d8dab0eed848d596299a3de2458e
MD5 26966f5ecea7a8783efdfdb81fc2b5c7
BLAKE2b-256 8835ecb486c2528740243c92e392bc6a078c819ecff3586e821e38e7a2f9891b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page