Giter Club home page Giter Club logo

skill-ontap's Introduction

NetApp ONTAP Skill for Opsdroid

This is an OPSDROID skill for ChatOps using the ONTAP SDK for Python to make it easy to interact with ONTAP's Rest API's. Opsdroid is an open source chat bot framework written in Python. It is designed to be extendable, scalable and simple.

alt text

๐Ÿšฅ Prerequisites

  • python 3.5 or later
  • requests 2.21.0 or later
  • marshmallow between 3.0.0rc5 and 3.0.0rc7
  • ONTAP SDK for Python

๐Ÿ”จ Installation

Install opsdroid from pip:

$ pip install opsdroid
$ pip install netapp-ontap

#run the opsdroid command to create the configuration files

$ opsdroid

# Stop opsdroid  with Ctrl + C to modify the configuration

๐Ÿ“˜ Configuration

Modify the opsdroid configuration.yaml file and make sure it contains the following sections:

  • Chat service e.g. Slack
  • ONTAP skill added to the skills section
  • Regex is enabled, for parsing messages

For configuration, opsdroid uses a single YAML file named configuration.yaml. When you run opsdroid it will look for the file in the following places in order:

  • ./configuration.yaml
  • /etc/opsdroid/configuration.yaml One of the default locations:
  • Mac: ~/Library/Application Support/opsdroid
  • Linux: ~/.local/share/opsdroid or ~/.config/opsdroid
  • Windows: C:\<User>\<Application Data>\<Local Settings>\opsdroid\ or C:\Users\<User>\AppData\Local\opsdroid

Note: If no file named configuration.yaml can be found on one of these folders one will be created for you taken from the example configuration file.

If you are using one of the default locations you can run the command opsdroid -e or opsdroid --edit-config to open the configuration with your favorite editor(taken from the environment variable EDITOR) or the default editor vim.

Then add the ONTAP skill to the skill section of the opsdroid configuration.yaml file.

  ## Interact with ONTAP API
  - name: ontap
    repo: https://github.com/promiseowolabi/skill-ontap.git
    no-cache: True

Uncomment Regex for parsing in the configuration.yaml file:

parsers:
  - name: regex
    enabled: true

Setup your chat service e.g. Slack in the configuration.yaml file:

  - name: slack
    # required
    api-token: "your-slack-token-goes-here"
    # optional
    bot-name: "opsdroid" # default "opsdroid"
    default-room: "#chatops" # default "#general"
    icon-emoji: ":robot_face:" # default ":robot_face:"
    connect-timeout: 10 # default 10 seconds

Start opsdroid after you complete the configuration

$ opsdroid

๐Ÿ” Usage

On you chosen chat service, these are some example messages based on regex_matches the skill will respond to, refer to the Quickstart documentation for a complete list:

  • get ontap cluster info
  • get ontap cluster version
  • get ontap cluster name
  • create a {size} MB volume called {name} on svm {svm} and aggregate {aggr}
  • delete volume {name} on svm {svm}
  • get volumes on svm {svm}
  • get all aggregates on cluster or get aggregates on cluster
  • get all ports state on cluster or get ports state on cluster
  • get all interfaces on cluster or get interfaces on cluster
  • create a snapshot of {volume} on svm {svm} or take a snapshot of {volume} on svm {svm}
  • create a clone of {volume} on svm {svm} called {name} or create a flexclone of {volume} on svm {svm} called {name}
  • create and mount a {size} MB volume {name} on {svm} {aggr} or create and mount a {size} MB volume called {name} on svm {svm} and aggregate {aggr}

Slack: Enclose hostnames, FQDN values in < > i.e. <sqlhost.netapp.com> to avoid Slack unfurling which cause hostname not found errors.

Note: The messages must match the syntax above including letter cases.

๐Ÿ“Œ License

skill-ontap's People

Contributors

promiseowolabi avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

skill-ontap's Issues

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.