cloudpassage 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cloudpassage/base.rb +8 -1
- data/lib/cloudpassage/servers.rb +9 -5
- data/lib/cloudpassage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcbae6fe51aad88f8f65f058a5d8ecb22a207bc2
|
4
|
+
data.tar.gz: 1eef871955974d8dec4a3a896548fa3e71304309
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1acde19f515a84d298708829300d7d961de54b8e9746dd771b2a51d4fca90de1bd0cb3b75a27498392af8771d2034ded3114b04fa9e666f3932c770eb350738
|
7
|
+
data.tar.gz: c3f4ff6e6e2706d819e7342d863c3bdcac4efe6c38997f4e5b797109f5258316975e3746939cd1488ba04ebf54e74e0ac3a56697341b31b0a81d9bf53e73e5b7
|
data/lib/cloudpassage/base.rb
CHANGED
@@ -71,12 +71,19 @@ module Cloudpassage
|
|
71
71
|
class_name[index + 2 .. -1].underscore.to_sym
|
72
72
|
end
|
73
73
|
|
74
|
+
# Return true if object exists in the cloudpassage API, false otherwise.
|
75
|
+
def exists?
|
76
|
+
@base_resource.get(headers)
|
77
|
+
true
|
78
|
+
rescue RestClient::ResourceNotFound
|
79
|
+
false
|
80
|
+
end
|
81
|
+
|
74
82
|
# Wait for block to evaluate to true.
|
75
83
|
# If specified, options can be used to override default options.
|
76
84
|
# Options should conform to https://rubygems.org/gems/wait
|
77
85
|
def wait_for(options={}, &block)
|
78
86
|
Wait.new(Cloudpassage::wait_options.merge(options)).until do
|
79
|
-
reload
|
80
87
|
instance_eval &block
|
81
88
|
end
|
82
89
|
end
|
data/lib/cloudpassage/servers.rb
CHANGED
@@ -98,16 +98,16 @@ module Cloudpassage
|
|
98
98
|
|
99
99
|
def disable_account(username)
|
100
100
|
payload = {:account => {:active=>false}}
|
101
|
-
@server
|
101
|
+
@server..get(JSON.parse(@base_resource[username].put(payload.to_json, headers))['command']['id'])
|
102
102
|
end
|
103
103
|
|
104
104
|
def reset(username, opts = {})
|
105
105
|
payload = {'password' => password_opts.merge(opts)}
|
106
|
-
JSON.parse
|
106
|
+
@server.commands.get(JSON.parse(@base_resource[username]['password'].put(payload.to_json, headers))['command']['id'])
|
107
107
|
end
|
108
108
|
|
109
109
|
def remove(username)
|
110
|
-
JSON.parse
|
110
|
+
@server.commands.get(JSON.parse(@base_resource[username].delete(headers))['command']['id'])
|
111
111
|
end
|
112
112
|
|
113
113
|
def headers
|
@@ -149,8 +149,12 @@ module Cloudpassage
|
|
149
149
|
|
150
150
|
class Command < Single
|
151
151
|
def done?
|
152
|
-
|
153
|
-
|
152
|
+
reload
|
153
|
+
fail Error.new(self.result) if status == 'failed'
|
154
|
+
'completed' == status
|
155
|
+
end
|
156
|
+
|
157
|
+
class Error < StandardError
|
154
158
|
end
|
155
159
|
end
|
156
160
|
|
data/lib/cloudpassage/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudpassage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mshea
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|