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

cloudpassage

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudpassage

  • 0.0.14
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Cloudpassage

Rubygem for interacting with cloudpassage API.

To date, most list/get functions are implemented. Most write-oriented functions are not.

Installation

Add this line to your application's Gemfile:

gem 'cloudpassage'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cloudpassage

Usage

  • Objects are all wrappers around RestClient. Data is retrieved when the .data method is invoked.
  • This method returns a hash, parsed from the JSON data.
  • Data will not be retrieved until data is invoked.
  • Objects cache data until their reload method is invoked.

Examples

General Usage

  require 'cloudpassage'
  
  # Setup API client
  api = Cloudpassage.api(ENV['CLIENT_ID'], ENV['CLIENT_SECRET'])

  # List all the things.
  puts api.events.all
  puts api.file_integrity_policies.all
  puts api.firewall_interfaces.all
  puts api.firewall_policies.all
  puts api.firewall_services.all
  puts api.firewall_zones.all
  puts api.server_groups.all
  puts api.users.all
  puts api.servers.all
  
  # List things that are related to other things.
  puts api.firewall_policies.all[0].rules
  puts api.servers.all[0].accounts.all
  puts api.servers.all[0].issues.all
  puts api.server_groups.all[0].groups.all

  # Add/move a server to a group (groups are case-sensitive)
  api.servers.get('some_id').group='some_group_id'

  # List servers by passing in state (missing, deactivated, active)
  api.servers.filter(:state=>'missing')

  # Delete a server permanently
  api.servers.get('id').destroy

  # Retire a 'inactive' server
  api.servers.get('id').retire
      
  # Get specific things.
  puts api.file_integrity_policies.get('file_integrity_policy_id').data.to_json
  ...

  # Reload an object:
  users = api.users

  # First load occurs here.
  users.all

  # Second load occurs here.
  users.reload

  # You can also reload single objects:
  user = users.all[0]
  user.reload

Allocating a user to login with on a server:

  server = find_server_you_want_use_here
  command = server.accounts.create('user', 'group')
  command.wait_for{done?}

  # You can use this password to login as the user.
  password = command.password

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 13 Jun 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