GithubHelp home page GithubHelp logo

a2's Introduction

A2

build status Gem Version

A CLI and ruby client for interacting with Chef Automate 2+ APIs.

Usage

Using from the command line

Install the CLI via rubygems:

$ gem install a2

The URL and auth token for your Chef Automate instance must be provided either via command line args or through environment variables. If both are provided, the command line args take precedence.

Environment variables:

AUTOMATE_URL="https://automate.example.com"
AUTOMATE_TOKEN="my-token"
AUTOMATE_SSL_NO_VERIFY=true

List the available commands:

$ a2 --help
Usage: a2 [options] {compliance | help | iam | infra | nodemgmt | version}

Available commands:
    compliance        Compliance management commands
      export-node-reports
      list-reports
    help              Provide help for individual commands
    iam               Identity access management commands
      add-membership
      create-team
      create-user
      delete-team
      delete-user
      get-team
      get-teams-by-membership
      get-user
      list-team-members
      list-teams
      list-users
      remove-membership
      update-team
      update-user
    infra             Chef Infra config management commands
      list-missing-nodes
      list-node-runs
      list-node-status-counts
      list-nodes
      list-orgs
      show-attributes
      show-node-run
    nodemgmt          Node management commands
      bulk-delete-by-filter
      bulk-delete-by-ids
      delete
      get
      search
    version           Show the version of the program

Options (take precedence over global options):
    -v, --version                    Show the version of the program

Global Options:
    -u, --automate-url [url]         The Chef Automate URL
    -t, --automate-token [token]     The Chef Automate API token
    -N, --ssl-no-verify              Disable SSL verification
    -h, --help                       Show help

Using as an API Client

You can also use the ruby API client directly by adding this line to your application's Gemfile:

gem 'a2'

And then installing via bundler:

$ bundle install

Making requests:

require 'a2'
client = A2::Client.new(automate_url: 'https://automate.example.com', automate_token: 'my-token', ssl_no_verify: true)
client.list_all_users

License

The gem is available as open source under the terms of the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.