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'
api = Cloudpassage.api(ENV['CLIENT_ID'], ENV['CLIENT_SECRET'])
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
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
api.servers.get('some_id').group='some_group_id'
api.servers.filter(:state=>'missing')
api.servers.get('id').destroy
api.servers.get('id').retire
puts api.file_integrity_policies.get('file_integrity_policy_id').data.to_json
...
users = api.users
users.all
users.reload
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?}
password = command.password
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request