scalr_api_v2 0.2.2 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54710c6c248a7862e3e04d1f2f3dbeb954c8f1c5
4
- data.tar.gz: 8d6f956b22cb5a204e70c9812440c2c3a37e64f1
3
+ metadata.gz: 2cf32887fa89a16779175fb2a666e3c985382258
4
+ data.tar.gz: 6c410a247c85684291f7b57646cffbf7eb73a9d9
5
5
  SHA512:
6
- metadata.gz: f6eea8324fa710531be5c172bf5aee473fe082cda5834228a9e8836f5ca21217df71556146e7accb367378146a5b72d72805b5c66247892aa7826b5ea1dfd9a1
7
- data.tar.gz: 8977e7c6e4b69456f00707f861324f59073b6d6d48d02df516bdff7199d23c98488e28563353eeee5773540f7554c4bd5cd9f10b003d89ea73ec170b45ce8e96
6
+ metadata.gz: 3ec83f30b01248cc4ede13d7492b37fca712a48b1c5ce322857bcb411045a053cebd2f0364188bb827cb6ef3724a67f264982359c82830a0521489ca8e8e8ae0
7
+ data.tar.gz: '08f73fc4a56eb0147c1f85cd1801449ceae51ffa7f3a4af6ce5c131a9d3710682d707de326d3d9fa63f250aece4db3e837843e573d3cf14f953e466e24b48505'
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.3.2
2
+
3
+ * Added: Images::list,create,delete
4
+ * Added: Roles::list,create,delete,list_role_images,associate_role_image
5
+
1
6
  == 0.2.2
2
7
 
3
8
  * Added: Scripts::get_farm, Scripts::list_farm_servers and tests
data/README.md CHANGED
@@ -41,7 +41,7 @@ Set the below environment variables:
41
41
 
42
42
  ### limitations
43
43
 
44
- At present there is a limited subset of api commands avaialble via this GEM. Functionality is limited to working with scripts. As well as listing farms and servers.
44
+ At present there is a limited subset of api commands avaialble via this GEM. Functionality is limited to working with scripts, images & roles. As well as listing farms and servers.
45
45
  Examples of the functionality provided can be found in the rspec tests.
46
46
 
47
47
  ## Development
data/lib/scalr_api_v2.rb CHANGED
@@ -4,6 +4,8 @@ require 'scalr_api_v2/request'
4
4
  require 'scalr_api_v2/scripts'
5
5
  require 'scalr_api_v2/farms'
6
6
  require 'scalr_api_v2/servers'
7
+ require 'scalr_api_v2/images'
8
+ require 'scalr_api_v2/roles'
7
9
 
8
10
  # define module
9
11
  module ScalrApiV2
@@ -0,0 +1,30 @@
1
+ # ScalrApiV2::Images
2
+ module ScalrApiV2
3
+ require 'json'
4
+
5
+ # connection and request methods for interacting with the Scalr API
6
+ class Images
7
+ def initialize
8
+ @config = ScalrApiV2::Config.new.config
9
+ @scalr = ScalrApiV2::Request.new
10
+ end
11
+
12
+ # List all scripts
13
+ def list
14
+ list = @scalr.list(format('/api/v1beta0/user/%s/images/', @config['env_id']))
15
+ return list
16
+ end
17
+
18
+ def create(image)
19
+ item = @scalr.create(format('/api/v1beta0/user/%s/images/', @config['env_id']), image)
20
+ return item
21
+ end
22
+
23
+ def delete(image_id)
24
+ item = @scalr.delete(format('/api/v1beta0/user/%s/images/%s', @config['env_id'], image_id))
25
+ return item
26
+ end
27
+
28
+ # TODO: add remainig api calls
29
+ end
30
+ end
@@ -0,0 +1,40 @@
1
+ # ScalrApiV2::Roles
2
+ module ScalrApiV2
3
+ require 'json'
4
+
5
+ # connection and request methods for interacting with the Scalr API
6
+ class Roles
7
+ def initialize
8
+ @config = ScalrApiV2::Config.new.config
9
+ @scalr = ScalrApiV2::Request.new
10
+ end
11
+
12
+ # List all scripts
13
+ def list
14
+ list = @scalr.list(format('/api/v1beta0/user/%s/roles/', @config['env_id']))
15
+ return list
16
+ end
17
+
18
+ def create(role)
19
+ item = @scalr.create(format('/api/v1beta0/user/%s/roles/', @config['env_id']), role)
20
+ return item
21
+ end
22
+
23
+ def delete(role_id)
24
+ item = @scalr.delete(format('/api/v1beta0/user/%s/images/%s', @config['env_id'], role_id))
25
+ return item
26
+ end
27
+
28
+ def list_images(role_id)
29
+ list = @scalr.list(format('/api/v1beta0/user/%s/roles/%s/images', @config['env_id'], role_id))
30
+ return list
31
+ end
32
+
33
+ def associate_image(role_id, payload)
34
+ item = @scalr.create(format('/api/v1beta0/user/%s/roles/%s/images', @config['env_id'], role_id), payload)
35
+ return item
36
+ end
37
+
38
+ # TODO: add remainig api calls
39
+ end
40
+ end
@@ -1,4 +1,4 @@
1
1
  # ScalrApiV2::VERSION
2
2
  module ScalrApiV2
3
- VERSION = '0.2.2'.freeze
3
+ VERSION = '0.3.2'.freeze
4
4
  end
metadata CHANGED
@@ -1,195 +1,195 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scalr_api_v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - david.meekin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-12 00:00:00.000000000 Z
11
+ date: 2017-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.12'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.12'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: climate_control
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rack
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 1.6.8
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.6.8
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: webmock
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 3.0.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 3.0.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: sinatra
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: 1.4.8
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.4.8
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: cucumber
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ~>
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
117
  version: 2.4.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ~>
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 2.4.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: aruba
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
131
  version: 0.14.2
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 0.14.2
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rubocop
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ~>
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
145
  version: 0.48.1
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ~>
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: 0.48.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rest-client
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ~>
157
+ - - "~>"
158
158
  - !ruby/object:Gem::Version
159
159
  version: 2.0.2
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ~>
164
+ - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: 2.0.2
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: json
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ~>
171
+ - - "~>"
172
172
  - !ruby/object:Gem::Version
173
173
  version: 2.1.0
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ~>
178
+ - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: 2.1.0
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: thor
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ~>
185
+ - - "~>"
186
186
  - !ruby/object:Gem::Version
187
187
  version: 0.19.4
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ~>
192
+ - - "~>"
193
193
  - !ruby/object:Gem::Version
194
194
  version: 0.19.4
195
195
  description: provides a connection to scalr and a non exhuastive list of api calls
@@ -201,10 +201,10 @@ executables:
201
201
  extensions: []
202
202
  extra_rdoc_files: []
203
203
  files:
204
- - .gitignore
205
- - .rspec
206
- - .rubocop.yml
207
- - .travis.yml
204
+ - ".gitignore"
205
+ - ".rspec"
206
+ - ".rubocop.yml"
207
+ - ".travis.yml"
208
208
  - CHANGELOG
209
209
  - CODE_OF_CONDUCT.md
210
210
  - Gemfile
@@ -218,7 +218,9 @@ files:
218
218
  - lib/scalr_api_v2/cli.rb
219
219
  - lib/scalr_api_v2/config.rb
220
220
  - lib/scalr_api_v2/farms.rb
221
+ - lib/scalr_api_v2/images.rb
221
222
  - lib/scalr_api_v2/request.rb
223
+ - lib/scalr_api_v2/roles.rb
222
224
  - lib/scalr_api_v2/scripts.rb
223
225
  - lib/scalr_api_v2/servers.rb
224
226
  - lib/scalr_api_v2/version.rb
@@ -233,17 +235,17 @@ require_paths:
233
235
  - lib
234
236
  required_ruby_version: !ruby/object:Gem::Requirement
235
237
  requirements:
236
- - - '>='
238
+ - - ">="
237
239
  - !ruby/object:Gem::Version
238
240
  version: '0'
239
241
  required_rubygems_version: !ruby/object:Gem::Requirement
240
242
  requirements:
241
- - - '>='
243
+ - - ">="
242
244
  - !ruby/object:Gem::Version
243
245
  version: '0'
244
246
  requirements: []
245
247
  rubyforge_project:
246
- rubygems_version: 2.6.12
248
+ rubygems_version: 2.6.11
247
249
  signing_key:
248
250
  specification_version: 4
249
251
  summary: ruby gem providing interface to Scalr API v2 methods