Skip to main content

Commandline interpreter to interact with Resoto.

Project description

resh

Resoto Shell

Table of contents

Overview

resh starts the resoto shell. It is used to interact with resotocore. It allows you to explore the graph, find resources of interest, mark them for cleanup, fix their tagging, aggregate over their metadata to create metrics and format the output for use in a 3rd party script or system.

More information can be found below and in the docs.

Usage

resh uses the following commandline arguments:

  --resotocore-uri RESOTOCORE_URI
                        resotocore URI (default: https://localhost:8900)
  --resotocore-section RESOTOCORE_SECTION
                        All queries are interpreted with this section name. If not set, the server default is used.
  --resotocore-graph RESOTOCORE_GRAPH
                        The name of the graph to use by default. If not set, the server default is used.
  --download-directory DOWNLOAD_DIRECTORY
                        If files are received, they are written to this directory.
  --no-color            Output should be rendered plain without any color escape sequences.
  --stdin               Read from STDIN instead of opening a shell
  --verbose, -v         Verbose logging
  --quiet               Only log errors
  --psk PSK             Pre-shared key
  --ca-cert CA_CERT     Path to custom CA certificate file
  --no-verify-certs     Turn off certificate verification

ENV Prefix: RESOTOSHELL_ Every CLI arg can also be specified using ENV variables.

For instance --resotocore-uri http://foobar.tld:8900 would become RESOTOSHELL_RESOTOCORE_URI=http://foobar.tld:8900.

Examples

Basics

Enter help into resh to get an overview of all available commands

Using help followed by a command will provide more information about that command.

Intermediate

Show all storage volumes that are in use

> search is(volume) and volume_status = in-use

Show all storage volumes in use and format the output as CSV

> search is(volume) and volume_status = in-use | format {kind},{id},{name},{ctime}

Show all storage volumes not in use with a size of more than 10 GB

> search is(volume) and volume_status = available and volume_size > 10

Advanced

Find volumes in cloud AWS that are in use

search is(volume) and volume_status = in-use and /ancestors.cloud.reported.name = aws

Alternatively instead of filtering for storage volumes of the generic volume kind we can also be more specific

search is(aws_ec2_volume) and volume_status = in-use

Find unused AWS volumes older than 30 days with no I/O in the past 7 days

search is(aws_ec2_volume) and volume_status = available and ctime < -30d and atime < -7d and mtime < -7d

Contact

If you have any questions feel free to join our Discord or open a GitHub issue.

License

See LICENSE for details.

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

resotoshell-3.9.0.tar.gz (24.6 kB view hashes)

Uploaded Source

Built Distribution

resotoshell-3.9.0-py3-none-any.whl (20.8 kB view hashes)

Uploaded Python 3

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