Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

puppet_x_eos_eapi

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puppet_x_eos_eapi

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Arista eAPI Ruby Library

This ruby gem library implements configuration tasks using the Arista EOS eAPI. The goal if this library is to provide a reusable set of classes and methods for use with Puppet types and providers.

Installation for Development

First, clone the repository to your local development system:

$ cd /workspace
$ git clone git@github.com:puppetlabs/puppet_x_eos_eapi.git

Then add these lines to your module's Gemfile in order to use your development copy of the Gem library:

puppet_x_eos_eapi_version = ENV['GEM_PUPPET_X_EOS_EAPI_VERSION']
if puppet_x_eos_eapi_version
  gem 'puppet_x_eos_eapi', *location_for(puppet_x_eos_eapi_version)
else
  gem 'puppet_x_eos_eapi'
end

And then execute:

$ export GEM_PUPPET_X_EOS_EAPI_VERSION=file:///workspace/puppet_x_eos_eapi
$ bundle install --path .bundle/gems/

Usage

Provider's extend themselves by including the API methods into the provider class. For example,

# encoding: utf-8

require 'puppet/type'
require 'puppet_x_eos_eapi'
Puppet::Type.type(:network_snmp).provide(:eos) do

  # Create methods that set the @property_hash for the #flush method
  mk_resource_methods

  # Mix in the api as instance methods
  include PuppetX::Eos::ProviderMethods
  # Mix in the api as class methods
  extend PuppetX::Eos::ProviderMethods
  # Mix in common provider class methods (e.g. self.prefetch)
  extend PuppetX::Eos::ProviderClassMethods

  def initialize(resource = {})
    super(resource)
    @property_flush = {}
  end
end

Behavior tests

When making changes to this Gem, please check the spec tests, code coverage, documentation coverage, and rubocop warnings:

Behavior Tests:

bundle exec rspec spec

Code Coverage is automatically generated after the spec tests are run:

open coverage/index.html

Documentation:

bundle exec yard

Rubocop warnings:

bundle exec rubocop

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 26 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc