Giter VIP home page Giter VIP logo

stackstorm-nsone's Introduction

NSOne

This pack enables the integration of NSOne into Stackstorm

Configuration

To create and install the config file, you can run:

st2 pack config nsone

Alternatively, you can copy the example configuration in nsone.yaml.example to /opt/stackstorm/configs/nsone.yaml and edit as required.

  • api_key: API-KEY
  • debug: optional debug flag. Set to True for additional logging

You can also use dynamic values from the datastore. See the docs for more info.

Note : When modifying the configuration in /opt/stackstorm/configs/ please remember to tell StackStorm to load these new values by running st2ctl reload --register-configs

Creating API Key in NSOne

  • Sign into NSOne
  • Go to 'Account Settings' > 'API Keys'
  • Click on 'Add Key' and select the permissions this API should have.
  • Add the API Key to the Pack's config.

Configuration

---
api_key: abcd1234ABCD
debug: false

Actions

Account

  • account.get - Get data about your account

Feeds

  • feed.create - Create a feed in a data source
  • feed.delete - Delete a feed in a data source
  • feed.get - Get details about a feed in a data source
  • feed.list - List all feeds in a data source
  • feed.update - Update a feed in a data source

Monitors

  • monitor.get - Get details about a monitor
  • monitor.list - List all monitors

Notify List

  • notify_list.get - Get details about a notification list
  • notify_list.list - List all notification lists

Records

  • record.create - Create a record
  • record.delete - Delete a record
  • record.get - Get details about a record
  • record.update - Update a record

Data Sources

  • source.create - Create a data source
  • source.delete - Delete a data source
  • source.get - Get details about a data source
  • source.list - List all data sources
  • source.publish - Publish a data source
  • source.update - Update a data source

Stats

  • stats.qps - Get QPS (Queries per second) details about your Account, a Zone, or a Record
  • stats.usage - Get usage details about your Account, a Zone, or a Record

Zones

  • zone.create - Create a zone
  • zone.delete - Delete a zone
  • zone.get - Get details about a zone
  • zone.list - List all zones
  • zone.search - Search a zone for records
  • zone.update - Update a zone

References

Future

  • Actions covered by methods in ns1-python/ns1/rest/ipam.py
  • Actions for monitor.create, monitor.update, monitor.delete in ns1-python/ns1/rest/monitoring.py
  • Actions for notify_list.create, notify_list.update, notify_list.delete in ns1-python/ns1/rest/monitoring.py

stackstorm-nsone's People

Contributors

kami avatar lindsayhill avatar cognifloyd avatar blag avatar emedvedev avatar nullkarma avatar namachieli avatar nmaludy avatar

Watchers

James Cloos avatar Mick McGrath avatar Dmitri Zimin(e) avatar Marcel Weinberg avatar Eugen avatar  avatar Lakshmi Kannan avatar David Gee avatar Ankur Singh avatar A R avatar Amanda McGuinness avatar Ram Golla avatar

Forkers

cognifloyd

stackstorm-nsone's Issues

RuntimeError: dictionary changed size during iteration

It looks like the nsone.record.create action is failing with the following stack error:

"stderr": "st2.actions.python.NSOneAction: DEBUG    Instantiating NSOneBaseAction()
st2.actions.python.NSOneAction: DEBUG    Initializing ns1 client
st2.actions.python.NSOneAction: DEBUG    API Key loaded
st2.actions.python.NSOneAction: DEBUG    Action running with Module: records, Package: Records, Method: create
Traceback (most recent call last):
  File \"/opt/stackstorm/st2/lib/python3.6/site-packages/python_runner/python_action_wrapper.py\", line 395, in <module>
    obj.run()
  File \"/opt/stackstorm/st2/lib/python3.6/site-packages/python_runner/python_action_wrapper.py\", line 214, in run
    output = action.run(**self._parameters)
  File \"/opt/stackstorm/packs/nsone/actions/action.py\", line 18, in run
    for k, v in kwargs.items():
RuntimeError: dictionary changed size during iteration

Can someone please fix this? I was able to create records using the REST API so there is something wrong either with the ST2 implementation or the python module ns1-python

Bug: Incorrect result text when empty response for some actions

Some actions, such as nsone.source.publish, when successful the api replies with {}.

Line 40 of action.py checks output and if empty, returns a static key of "deleted": true. This was originally added because I thought only successful deletion of resources responded this way. I see now that is neither accurate nor an absolute way to check for something so important.

This is also bad as it may give users heart attack when they intended to update something, and get a message of deleted :(

Solution:
reference if the method used was delete as an additional condition, and change else to have a generic completion message like "completed": true

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.