vmware-vra 3.0.1 → 3.1.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
  SHA256:
3
- metadata.gz: 95e805c8c8d6fd5228962ffa907ce07409b60022e29166ba970194e0aa61cc42
4
- data.tar.gz: 49beb545bf435a61aefccf06daa25629ccd991363dc9ca7546e3a15996cca362
3
+ metadata.gz: 4d18c9dda0b686aad417c4f46c36c3c3a23f4523e68f78d1715f86f24a0a1ef4
4
+ data.tar.gz: aff6ebd90a5b5ecbc43e249065a04ac34f8978c151dd27869e11378bfd08adc8
5
5
  SHA512:
6
- metadata.gz: de450415be0060fb3aef5d796e407bf9fedfb79b0f83a003d702073ee7aaa06508a5758191916d4c522c42348d166c01c23f8671221c2b8cd66b5e4b839177e7
7
- data.tar.gz: ade68fa3e927d199c2c263bd1fcc918c21ea8c9aa52703ab74092461e9719c442294064c1410fc890c27d90908be089d21340141c11814db04cbccf3d1e4710a
6
+ metadata.gz: 2dfd08b68a8ee04d9c657e4776b02a3a8edfc6e74f21dde0faff948a1d279a617010563beeb6c83e9602db26259abf9547e506cec4dea5012e989547a67481aa
7
+ data.tar.gz: 1d3c7f0a3003185dc8e82fa2e5be29462b1957c56a4d231a081fae82e6641b728a6022cbc8356efada6e8b41b4f414c7982d1b2c24722bca84c4ac0b79682b1d
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Unit
3
+
4
+ 'on':
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ ruby: ['2.6', '2.7', '3.0', '3.1']
16
+ name: Unit test on Ruby ${{ matrix.ruby }}
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ - uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby }}
22
+ bundler-cache: true
23
+ - run: bundle exec rake spec
data/CHANGELOG.md CHANGED
@@ -1,316 +1,366 @@
1
1
  # Change Log
2
- ## [3.0.1](https://github.com/chef-partners/vmware-vra-gem/tree/v3.0.1) (2022-01-25)
3
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v3.0.0...v3.0.1)
2
+
3
+
4
+ ## [3.1.2] (2022-03-28)
5
+
6
+ - Upgrade Rake dependency (@damacus)
7
+
8
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v3.1.1...v3.1.1)
9
+
10
+ ## [3.1.1] (2022-03-01)
11
+
12
+ - Send Authorization: Bearer header instead of csp-auth-token for greater compatibility [@oshvarts]
13
+
14
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v3.1.0...v3.1.1)
15
+
16
+ ## [3.1.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v3.1.0) (2022-01-30)
17
+
18
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v3.0.1...v3.1.0)
19
+
20
+ - Make the version param optional in deployment request api
21
+
22
+ ## [3.0.1](https://github.com/test-kitchen/vmware-vra-gem/tree/v3.0.1) (2022-01-25)
23
+
24
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v3.0.0...v3.0.1)
4
25
 
5
26
  - Fix access token workflow to work with VRA8
6
27
 
7
- ## [3.0.0](https://github.com/chef-partners/vmware-vra-gem/tree/v3.0.0) (2022-01-18)
8
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.7.2...v3.0.0)
28
+ ## [3.0.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v3.0.0) (2022-01-18)
29
+
30
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.7.2...v3.0.0)
9
31
 
10
32
  - Rewritten to support vRA 8. If you require support for 7 make sure to pin on the previous 2.7.2 release.
11
33
 
12
- ## [2.7.2](https://github.com/chef-partners/vmware-vra-gem/tree/v2.7.2) (2020-09-09)
13
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.7.1...v2.7.2)
34
+ ## [2.7.2](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.7.2) (2020-09-09)
35
+
36
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.7.1...v2.7.2)
14
37
 
15
38
  - Added an extra option to handle shirt size parameter
16
39
  - Masking user credentials(password) in debug mode
17
40
 
18
- ## [2.7.1](https://github.com/chef-partners/vmware-vra-gem/tree/v2.7.1) (2019-05-28)
19
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.7.0...v2.7.1)
41
+ ## [2.7.1](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.7.1) (2019-05-28)
42
+
43
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.7.0...v2.7.1)
20
44
 
21
45
  **Closed issues:**
22
46
 
23
- - Some Extra Parameters are not passing through to VRA [\#75](https://github.com/chef-partners/vmware-vra-gem/issues/75)
47
+ - Some Extra Parameters are not passing through to VRA [\#75](https://github.com/test-kitchen/vmware-vra-gem/issues/75)
24
48
 
25
49
  **Merged pull requests:**
26
50
 
27
- - Add support for boolean vRA parameters, fix deep merge, add tracing [\#76](https://github.com/chef-partners/vmware-vra-gem/pull/76) ([stuartpreston](https://github.com/stuartpreston))
51
+ - Add support for boolean vRA parameters, fix deep merge, add tracing [\#76](https://github.com/test-kitchen/vmware-vra-gem/pull/76) ([stuartpreston](https://github.com/stuartpreston))
28
52
 
29
- ## [2.7.0](https://github.com/chef-partners/vmware-vra-gem/tree/v2.7.0) (2019-05-10)
30
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.6.1...v2.7.0)
53
+ ## [2.7.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.7.0) (2019-05-10)
54
+
55
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.6.1...v2.7.0)
31
56
 
32
57
  **Closed issues:**
33
58
 
34
- - Extra Parameters Not Being Sent to vRA [\#73](https://github.com/chef-partners/vmware-vra-gem/issues/73)
59
+ - Extra Parameters Not Being Sent to vRA [\#73](https://github.com/test-kitchen/vmware-vra-gem/issues/73)
35
60
 
36
61
  **Merged pull requests:**
37
62
 
38
- - vRA7 multiple fixes for nested, non-nested and merged parameters for a Blueprint [\#74](https://github.com/chef-partners/vmware-vra-gem/pull/74) ([stuartpreston](https://github.com/stuartpreston))
63
+ - vRA7 multiple fixes for nested, non-nested and merged parameters for a Blueprint [\#74](https://github.com/test-kitchen/vmware-vra-gem/pull/74) ([stuartpreston](https://github.com/stuartpreston))
64
+
65
+ ## [2.6.1](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.6.1) (2018-07-31)
39
66
 
40
- ## [2.6.1](https://github.com/chef-partners/vmware-vra-gem/tree/v2.6.1) (2018-07-31)
41
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.6.0...2.6.1)
67
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.6.0...2.6.1)
42
68
 
43
69
  **Closed issues:**
44
70
 
45
- - Vra::Resource\#ip\_addresses non-deterministically returns an empty array in error [\#65](https://github.com/chef-partners/vmware-vra-gem/issues/65)
71
+ - Vra::Resource\#ip\_addresses non-deterministically returns an empty array in error [\#65](https://github.com/test-kitchen/vmware-vra-gem/issues/65)
46
72
 
47
73
  **Merged pull requests:**
48
74
 
49
- - Removed the deep merge [\#68](https://github.com/chef-partners/vmware-vra-gem/pull/68) ([jjasghar](https://github.com/jjasghar))
75
+ - Removed the deep merge [\#68](https://github.com/test-kitchen/vmware-vra-gem/pull/68) ([jjasghar](https://github.com/jjasghar))
76
+
77
+ ## [v2.6.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.6.0) (2018-03-01)
50
78
 
51
- ## [v2.6.0](https://github.com/chef-partners/vmware-vra-gem/tree/v2.6.0) (2018-03-01)
52
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.5.2...v2.6.0)
79
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.5.2...v2.6.0)
53
80
 
54
81
  **Closed issues:**
55
82
 
56
- - undefined method `\[\]' for nil:NilClass if data for json content is of single entity [\#55](https://github.com/chef-partners/vmware-vra-gem/issues/55)
83
+ - undefined method `\[\]' for nil:NilClass if data for json content is of single entity [\#55](https://github.com/test-kitchen/vmware-vra-gem/issues/55)
57
84
 
58
85
  **Merged pull requests:**
59
86
 
60
- - Accept subtenant name as input in kitchen.yml [\#67](https://github.com/chef-partners/vmware-vra-gem/pull/67) ([vinuphilip](https://github.com/vinuphilip))
61
- - Lgustafson/fix 65 [\#66](https://github.com/chef-partners/vmware-vra-gem/pull/66) ([lgustafson](https://github.com/lgustafson))
87
+ - Accept subtenant name as input in kitchen.yml [\#67](https://github.com/test-kitchen/vmware-vra-gem/pull/67) ([vinuphilip](https://github.com/vinuphilip))
88
+ - Lgustafson/fix 65 [\#66](https://github.com/test-kitchen/vmware-vra-gem/pull/66) ([lgustafson](https://github.com/lgustafson))
62
89
 
63
- ## [v2.5.2](https://github.com/chef-partners/vmware-vra-gem/tree/v2.5.2) (2018-01-22)
64
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.5.1...v2.5.2)
90
+ ## [v2.5.2](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.5.2) (2018-01-22)
91
+
92
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.5.1...v2.5.2)
65
93
 
66
94
  **Merged pull requests:**
67
95
 
68
- - Added a method to retrieve catalog id's from catalog name [\#64](https://github.com/chef-partners/vmware-vra-gem/pull/64) ([rupeshpatel88](https://github.com/rupeshpatel88))
96
+ - Added a method to retrieve catalog id's from catalog name [\#64](https://github.com/test-kitchen/vmware-vra-gem/pull/64) ([rupeshpatel88](https://github.com/rupeshpatel88))
97
+
98
+ ## [v2.5.1](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.5.1) (2017-10-19)
69
99
 
70
- ## [v2.5.1](https://github.com/chef-partners/vmware-vra-gem/tree/v2.5.1) (2017-10-19)
71
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.5.0...v2.5.1)
100
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.5.0...v2.5.1)
72
101
 
73
102
  **Merged pull requests:**
74
103
 
75
- - Fixes a bug with Resource.by\_name [\#63](https://github.com/chef-partners/vmware-vra-gem/pull/63) ([logicminds](https://github.com/logicminds))
104
+ - Fixes a bug with Resource.by\_name [\#63](https://github.com/test-kitchen/vmware-vra-gem/pull/63) ([logicminds](https://github.com/logicminds))
105
+
106
+ ## [v2.5.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.5.0) (2017-10-17)
76
107
 
77
- ## [v2.5.0](https://github.com/chef-partners/vmware-vra-gem/tree/v2.5.0) (2017-10-17)
78
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.4.0...v2.5.0)
108
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.4.0...v2.5.0)
79
109
 
80
110
  **Closed issues:**
81
111
 
82
- - Use mkdir\_p when creating template directory [\#60](https://github.com/chef-partners/vmware-vra-gem/issues/60)
112
+ - Use mkdir\_p when creating template directory [\#60](https://github.com/test-kitchen/vmware-vra-gem/issues/60)
83
113
 
84
114
  **Merged pull requests:**
85
115
 
86
- - Adds ability to lookup resource by name [\#62](https://github.com/chef-partners/vmware-vra-gem/pull/62) ([logicminds](https://github.com/logicminds))
116
+ - Adds ability to lookup resource by name [\#62](https://github.com/test-kitchen/vmware-vra-gem/pull/62) ([logicminds](https://github.com/logicminds))
87
117
 
88
- ## [v2.4.0](https://github.com/chef-partners/vmware-vra-gem/tree/v2.4.0) (2017-09-19)
89
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.3.0...v2.4.0)
118
+ ## [v2.4.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.4.0) (2017-09-19)
119
+
120
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.3.0...v2.4.0)
90
121
 
91
122
  **Closed issues:**
92
123
 
93
- - cpu and memory parameters request [\#52](https://github.com/chef-partners/vmware-vra-gem/issues/52)
94
- - Minor typo in README [\#51](https://github.com/chef-partners/vmware-vra-gem/issues/51)
124
+ - cpu and memory parameters request [\#52](https://github.com/test-kitchen/vmware-vra-gem/issues/52)
125
+ - Minor typo in README [\#51](https://github.com/test-kitchen/vmware-vra-gem/issues/51)
95
126
 
96
127
  **Merged pull requests:**
97
128
 
98
- - Adds ability to supply template files to catalog request [\#57](https://github.com/chef-partners/vmware-vra-gem/pull/57) ([logicminds](https://github.com/logicminds))
99
- - Adds the ability to dump catalog templates via class methods [\#56](https://github.com/chef-partners/vmware-vra-gem/pull/56) ([logicminds](https://github.com/logicminds))
100
- - Symbols [\#53](https://github.com/chef-partners/vmware-vra-gem/pull/53) ([logicminds](https://github.com/logicminds))
129
+ - Adds ability to supply template files to catalog request [\#57](https://github.com/test-kitchen/vmware-vra-gem/pull/57) ([logicminds](https://github.com/logicminds))
130
+ - Adds the ability to dump catalog templates via class methods [\#56](https://github.com/test-kitchen/vmware-vra-gem/pull/56) ([logicminds](https://github.com/logicminds))
131
+ - Symbols [\#53](https://github.com/test-kitchen/vmware-vra-gem/pull/53) ([logicminds](https://github.com/logicminds))
132
+
133
+ ## [v2.3.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.3.0) (2017-06-30)
101
134
 
102
- ## [v2.3.0](https://github.com/chef-partners/vmware-vra-gem/tree/v2.3.0) (2017-06-30)
103
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.2.0...v2.3.0)
135
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.2.0...v2.3.0)
104
136
 
105
137
  **Closed issues:**
106
138
 
107
- - catalog\_request SSLError [\#30](https://github.com/chef-partners/vmware-vra-gem/issues/30)
108
- - Incompatible with vagrant 1.8+ \(at least\) [\#26](https://github.com/chef-partners/vmware-vra-gem/issues/26)
139
+ - catalog\_request SSLError [\#30](https://github.com/test-kitchen/vmware-vra-gem/issues/30)
140
+ - Incompatible with vagrant 1.8+ \(at least\) [\#26](https://github.com/test-kitchen/vmware-vra-gem/issues/26)
109
141
 
110
142
  **Merged pull requests:**
111
143
 
112
- - Extra parameters [\#50](https://github.com/chef-partners/vmware-vra-gem/pull/50) ([lloydsmithjr03](https://github.com/lloydsmithjr03))
113
- - Initial Jenkinsfile for integration tests [\#49](https://github.com/chef-partners/vmware-vra-gem/pull/49) ([jjasghar](https://github.com/jjasghar))
144
+ - Extra parameters [\#50](https://github.com/test-kitchen/vmware-vra-gem/pull/50) ([lloydsmithjr03](https://github.com/lloydsmithjr03))
145
+ - Initial Jenkinsfile for integration tests [\#49](https://github.com/test-kitchen/vmware-vra-gem/pull/49) ([jjasghar](https://github.com/jjasghar))
146
+
147
+ ## [v2.2.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.2.0) (2017-06-08)
114
148
 
115
- ## [v2.2.0](https://github.com/chef-partners/vmware-vra-gem/tree/v2.2.0) (2017-06-08)
116
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.1.3...v2.2.0)
149
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.1.3...v2.2.0)
117
150
 
118
151
  **Closed issues:**
119
152
 
120
- - usage of openssl raises error [\#45](https://github.com/chef-partners/vmware-vra-gem/issues/45)
121
- - why is chefstyle a runtime dependency? [\#44](https://github.com/chef-partners/vmware-vra-gem/issues/44)
122
- - Error when using set\_parameter and support for extra\_parameters [\#38](https://github.com/chef-partners/vmware-vra-gem/issues/38)
153
+ - usage of openssl raises error [\#45](https://github.com/test-kitchen/vmware-vra-gem/issues/45)
154
+ - why is chefstyle a runtime dependency? [\#44](https://github.com/test-kitchen/vmware-vra-gem/issues/44)
155
+ - Error when using set\_parameter and support for extra\_parameters [\#38](https://github.com/test-kitchen/vmware-vra-gem/issues/38)
123
156
 
124
157
  **Merged pull requests:**
125
158
 
126
- - Fixes issue with chefstyle and unnecessary runtime dependency [\#48](https://github.com/chef-partners/vmware-vra-gem/pull/48) ([logicminds](https://github.com/logicminds))
127
- - adds ability to specify additional params to catalog request [\#47](https://github.com/chef-partners/vmware-vra-gem/pull/47) ([logicminds](https://github.com/logicminds))
128
- - Fixes \#45 - usage of openssl raises error [\#46](https://github.com/chef-partners/vmware-vra-gem/pull/46) ([logicminds](https://github.com/logicminds))
159
+ - Fixes issue with chefstyle and unnecessary runtime dependency [\#48](https://github.com/test-kitchen/vmware-vra-gem/pull/48) ([logicminds](https://github.com/logicminds))
160
+ - adds ability to specify additional params to catalog request [\#47](https://github.com/test-kitchen/vmware-vra-gem/pull/47) ([logicminds](https://github.com/logicminds))
161
+ - Fixes \#45 - usage of openssl raises error [\#46](https://github.com/test-kitchen/vmware-vra-gem/pull/46) ([logicminds](https://github.com/logicminds))
129
162
 
130
- ## [v2.1.3](https://github.com/chef-partners/vmware-vra-gem/tree/v2.1.3) (2017-03-28)
131
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.1.2...v2.1.3)
163
+ ## [v2.1.3](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.1.3) (2017-03-28)
164
+
165
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.1.2...v2.1.3)
132
166
 
133
167
  **Merged pull requests:**
134
168
 
135
- - Fixing missing messages from some HTTP exceptions [\#43](https://github.com/chef-partners/vmware-vra-gem/pull/43) ([nsdavidson](https://github.com/nsdavidson))
169
+ - Fixing missing messages from some HTTP exceptions [\#43](https://github.com/test-kitchen/vmware-vra-gem/pull/43) ([nsdavidson](https://github.com/nsdavidson))
170
+
171
+ ## [v2.1.2](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.1.2) (2017-03-28)
136
172
 
137
- ## [v2.1.2](https://github.com/chef-partners/vmware-vra-gem/tree/v2.1.2) (2017-03-28)
138
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.1.1...v2.1.2)
173
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.1.1...v2.1.2)
139
174
 
140
175
  **Merged pull requests:**
141
176
 
142
- - Updates extra\_params to check for top level props [\#42](https://github.com/chef-partners/vmware-vra-gem/pull/42) ([nsdavidson](https://github.com/nsdavidson))
177
+ - Updates extra\_params to check for top level props [\#42](https://github.com/test-kitchen/vmware-vra-gem/pull/42) ([nsdavidson](https://github.com/nsdavidson))
178
+
179
+ ## [v2.1.1](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.1.1) (2017-03-14)
143
180
 
144
- ## [v2.1.1](https://github.com/chef-partners/vmware-vra-gem/tree/v2.1.1) (2017-03-14)
145
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.1.0...v2.1.1)
181
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.1.0...v2.1.1)
146
182
 
147
183
  **Merged pull requests:**
148
184
 
149
- - Converted to chefstyle [\#41](https://github.com/chef-partners/vmware-vra-gem/pull/41) ([jjasghar](https://github.com/jjasghar))
185
+ - Converted to chefstyle [\#41](https://github.com/test-kitchen/vmware-vra-gem/pull/41) ([jjasghar](https://github.com/jjasghar))
150
186
 
151
- ## [v2.1.0](https://github.com/chef-partners/vmware-vra-gem/tree/v2.1.0) (2017-03-14)
152
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.0.0...v2.1.0)
187
+ ## [v2.1.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.1.0) (2017-03-14)
188
+
189
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.0.0...v2.1.0)
153
190
 
154
191
  **Merged pull requests:**
155
192
 
156
- - Added skips [\#40](https://github.com/chef-partners/vmware-vra-gem/pull/40) ([jjasghar](https://github.com/jjasghar))
157
- - Support extra params for vra7 [\#39](https://github.com/chef-partners/vmware-vra-gem/pull/39) ([nsdavidson](https://github.com/nsdavidson))
193
+ - Added skips [\#40](https://github.com/test-kitchen/vmware-vra-gem/pull/40) ([jjasghar](https://github.com/jjasghar))
194
+ - Support extra params for vra7 [\#39](https://github.com/test-kitchen/vmware-vra-gem/pull/39) ([nsdavidson](https://github.com/nsdavidson))
195
+
196
+ ## [v2.0.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.0.0) (2016-12-15)
197
+
198
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.0.0.pre2...v2.0.0)
158
199
 
159
- ## [v2.0.0](https://github.com/chef-partners/vmware-vra-gem/tree/v2.0.0) (2016-12-15)
160
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.0.0.pre2...v2.0.0)
200
+ ## [v2.0.0.pre2](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.0.0.pre2) (2016-12-08)
161
201
 
162
- ## [v2.0.0.pre2](https://github.com/chef-partners/vmware-vra-gem/tree/v2.0.0.pre2) (2016-12-08)
163
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v2.0.0.pre1...v2.0.0.pre2)
202
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v2.0.0.pre1...v2.0.0.pre2)
164
203
 
165
204
  **Closed issues:**
166
205
 
167
- - \_\_Notes property does not work with vRA 7 [\#33](https://github.com/chef-partners/vmware-vra-gem/issues/33)
206
+ - \_\_Notes property does not work with vRA 7 [\#33](https://github.com/test-kitchen/vmware-vra-gem/issues/33)
168
207
 
169
- ## [v2.0.0.pre1](https://github.com/chef-partners/vmware-vra-gem/tree/v2.0.0.pre1) (2016-12-03)
170
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.7.0...v2.0.0.pre1)
208
+ ## [v2.0.0.pre1](https://github.com/test-kitchen/vmware-vra-gem/tree/v2.0.0.pre1) (2016-12-03)
209
+
210
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.7.0...v2.0.0.pre1)
171
211
 
172
212
  **Merged pull requests:**
173
213
 
174
- - 2.0.0.pre1 release [\#37](https://github.com/chef-partners/vmware-vra-gem/pull/37) ([jjasghar](https://github.com/jjasghar))
175
- - vRA 7.1 Support [\#36](https://github.com/chef-partners/vmware-vra-gem/pull/36) ([jjasghar](https://github.com/jjasghar))
176
- - Updated travis rubies [\#35](https://github.com/chef-partners/vmware-vra-gem/pull/35) ([jjasghar](https://github.com/jjasghar))
177
- - vra 7.0.1 compatibility [\#34](https://github.com/chef-partners/vmware-vra-gem/pull/34) ([stevehedrick](https://github.com/stevehedrick))
214
+ - 2.0.0.pre1 release [\#37](https://github.com/test-kitchen/vmware-vra-gem/pull/37) ([jjasghar](https://github.com/jjasghar))
215
+ - vRA 7.1 Support [\#36](https://github.com/test-kitchen/vmware-vra-gem/pull/36) ([jjasghar](https://github.com/jjasghar))
216
+ - Updated travis rubies [\#35](https://github.com/test-kitchen/vmware-vra-gem/pull/35) ([jjasghar](https://github.com/jjasghar))
217
+ - vra 7.0.1 compatibility [\#34](https://github.com/test-kitchen/vmware-vra-gem/pull/34) ([stevehedrick](https://github.com/stevehedrick))
218
+
219
+ ## [v1.7.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.7.0) (2016-08-02)
178
220
 
179
- ## [v1.7.0](https://github.com/chef-partners/vmware-vra-gem/tree/v1.7.0) (2016-08-02)
180
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.6.1...v1.7.0)
221
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.6.1...v1.7.0)
181
222
 
182
223
  **Merged pull requests:**
183
224
 
184
- - v1.7.0 [\#32](https://github.com/chef-partners/vmware-vra-gem/pull/32) ([jjasghar](https://github.com/jjasghar))
185
- - instructing Net::HTTP not to verify SSL when verify\_ssl is false [\#31](https://github.com/chef-partners/vmware-vra-gem/pull/31) ([bvandgrift](https://github.com/bvandgrift))
225
+ - v1.7.0 [\#32](https://github.com/test-kitchen/vmware-vra-gem/pull/32) ([jjasghar](https://github.com/jjasghar))
226
+ - instructing Net::HTTP not to verify SSL when verify\_ssl is false [\#31](https://github.com/test-kitchen/vmware-vra-gem/pull/31) ([bvandgrift](https://github.com/bvandgrift))
227
+
228
+ ## [v1.6.1](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.6.1) (2016-05-10)
186
229
 
187
- ## [v1.6.1](https://github.com/chef-partners/vmware-vra-gem/tree/v1.6.1) (2016-05-10)
188
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.6.0...v1.6.1)
230
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.6.0...v1.6.1)
189
231
 
190
- ## [v1.6.0](https://github.com/chef-partners/vmware-vra-gem/tree/v1.6.0) (2016-05-10)
191
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.5.4...v1.6.0)
232
+ ## [v1.6.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.6.0) (2016-05-10)
233
+
234
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.5.4...v1.6.0)
192
235
 
193
236
  **Merged pull requests:**
194
237
 
195
- - Remove rest-client dependency [\#28](https://github.com/chef-partners/vmware-vra-gem/pull/28) ([regularfry](https://github.com/regularfry))
238
+ - Remove rest-client dependency [\#28](https://github.com/test-kitchen/vmware-vra-gem/pull/28) ([regularfry](https://github.com/regularfry))
239
+
240
+ ## [v1.5.4](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.5.4) (2016-04-27)
196
241
 
197
- ## [v1.5.4](https://github.com/chef-partners/vmware-vra-gem/tree/v1.5.4) (2016-04-27)
198
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.5.3...v1.5.4)
242
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.5.3...v1.5.4)
199
243
 
200
244
  **Closed issues:**
201
245
 
202
- - when org data is nil, knife vra barfs [\#27](https://github.com/chef-partners/vmware-vra-gem/issues/27)
246
+ - when org data is nil, knife vra barfs [\#27](https://github.com/test-kitchen/vmware-vra-gem/issues/27)
203
247
 
204
248
  **Merged pull requests:**
205
249
 
206
- - Fixing potential NilClass errors [\#29](https://github.com/chef-partners/vmware-vra-gem/pull/29) ([adamleff](https://github.com/adamleff))
250
+ - Fixing potential NilClass errors [\#29](https://github.com/test-kitchen/vmware-vra-gem/pull/29) ([adamleff](https://github.com/adamleff))
251
+
252
+ ## [v1.5.3](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.5.3) (2016-04-18)
207
253
 
208
- ## [v1.5.3](https://github.com/chef-partners/vmware-vra-gem/tree/v1.5.3) (2016-04-18)
209
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.5.2...v1.5.3)
254
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.5.2...v1.5.3)
210
255
 
211
256
  **Closed issues:**
212
257
 
213
- - fork of this gem [\#24](https://github.com/chef-partners/vmware-vra-gem/issues/24)
214
- - `Vra::Exception::HTTPError` initialized incorrectly [\#23](https://github.com/chef-partners/vmware-vra-gem/issues/23)
258
+ - fork of this gem [\#24](https://github.com/test-kitchen/vmware-vra-gem/issues/24)
259
+ - `Vra::Exception::HTTPError` initialized incorrectly [\#23](https://github.com/test-kitchen/vmware-vra-gem/issues/23)
215
260
 
216
261
  **Merged pull requests:**
217
262
 
218
- - updating \#http\_head to use same http exception handling [\#25](https://github.com/chef-partners/vmware-vra-gem/pull/25) ([adamleff](https://github.com/adamleff))
263
+ - updating \#http\_head to use same http exception handling [\#25](https://github.com/test-kitchen/vmware-vra-gem/pull/25) ([adamleff](https://github.com/adamleff))
219
264
 
220
- ## [v1.5.2](https://github.com/chef-partners/vmware-vra-gem/tree/v1.5.2) (2016-04-01)
221
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.5.1...v1.5.2)
265
+ ## [v1.5.2](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.5.2) (2016-04-01)
266
+
267
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.5.1...v1.5.2)
222
268
 
223
269
  **Closed issues:**
224
270
 
225
- - require 'json' missing from client.rb [\#21](https://github.com/chef-partners/vmware-vra-gem/issues/21)
226
- - request feeder file [\#20](https://github.com/chef-partners/vmware-vra-gem/issues/20)
271
+ - require 'json' missing from client.rb [\#21](https://github.com/test-kitchen/vmware-vra-gem/issues/21)
272
+ - request feeder file [\#20](https://github.com/test-kitchen/vmware-vra-gem/issues/20)
227
273
 
228
274
  **Merged pull requests:**
229
275
 
230
- - use FFI\_Yajl::Encoder instead of \#to\_json [\#22](https://github.com/chef-partners/vmware-vra-gem/pull/22) ([adamleff](https://github.com/adamleff))
276
+ - use FFI\_Yajl::Encoder instead of \#to\_json [\#22](https://github.com/test-kitchen/vmware-vra-gem/pull/22) ([adamleff](https://github.com/adamleff))
277
+
278
+ ## [v1.5.1](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.5.1) (2016-03-11)
231
279
 
232
- ## [v1.5.1](https://github.com/chef-partners/vmware-vra-gem/tree/v1.5.1) (2016-03-11)
233
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.5.0...v1.5.1)
280
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.5.0...v1.5.1)
234
281
 
235
282
  **Closed issues:**
236
283
 
237
- - Machine status is MachineActivated causing errors \(VRA7\) [\#18](https://github.com/chef-partners/vmware-vra-gem/issues/18)
284
+ - Machine status is MachineActivated causing errors \(VRA7\) [\#18](https://github.com/test-kitchen/vmware-vra-gem/issues/18)
238
285
 
239
286
  **Merged pull requests:**
240
287
 
241
- - Support for MachineActivated state [\#19](https://github.com/chef-partners/vmware-vra-gem/pull/19) ([stevehedrick](https://github.com/stevehedrick))
242
- - fixing travis notifications [\#17](https://github.com/chef-partners/vmware-vra-gem/pull/17) ([adamleff](https://github.com/adamleff))
243
- - fixing new rubocop 0.36 complaints and testing travis [\#16](https://github.com/chef-partners/vmware-vra-gem/pull/16) ([adamleff](https://github.com/adamleff))
288
+ - Support for MachineActivated state [\#19](https://github.com/test-kitchen/vmware-vra-gem/pull/19) ([stevehedrick](https://github.com/stevehedrick))
289
+ - fixing travis notifications [\#17](https://github.com/test-kitchen/vmware-vra-gem/pull/17) ([adamleff](https://github.com/adamleff))
290
+ - fixing new rubocop 0.36 complaints and testing travis [\#16](https://github.com/test-kitchen/vmware-vra-gem/pull/16) ([adamleff](https://github.com/adamleff))
291
+
292
+ ## [v1.5.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.5.0) (2015-11-18)
244
293
 
245
- ## [v1.5.0](https://github.com/chef-partners/vmware-vra-gem/tree/v1.5.0) (2015-11-18)
246
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.4.0...v1.5.0)
294
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.4.0...v1.5.0)
247
295
 
248
296
  **Merged pull requests:**
249
297
 
250
- - Add support for Infrastructure.Cloud resources [\#15](https://github.com/chef-partners/vmware-vra-gem/pull/15) ([adamleff](https://github.com/adamleff))
298
+ - Add support for Infrastructure.Cloud resources [\#15](https://github.com/test-kitchen/vmware-vra-gem/pull/15) ([adamleff](https://github.com/adamleff))
251
299
 
252
- ## [v1.4.0](https://github.com/chef-partners/vmware-vra-gem/tree/v1.4.0) (2015-11-13)
253
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.3.0...v1.4.0)
300
+ ## [v1.4.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.4.0) (2015-11-13)
301
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.3.0...v1.4.0)
254
302
 
255
303
  **Closed issues:**
256
304
 
257
- - attr\_accessor :bearer\_token has to be changed due to PR \#9 change [\#12](https://github.com/chef-partners/vmware-vra-gem/issues/12)
305
+ - attr\_accessor :bearer\_token has to be changed due to PR \#9 change [\#12](https://github.com/test-kitchen/vmware-vra-gem/issues/12)
258
306
 
259
307
  **Merged pull requests:**
260
308
 
261
- - Add accessors for bearer\_token [\#14](https://github.com/chef-partners/vmware-vra-gem/pull/14) ([adamleff](https://github.com/adamleff))
309
+ - Add accessors for bearer\_token [\#14](https://github.com/test-kitchen/vmware-vra-gem/pull/14) ([adamleff](https://github.com/adamleff))
262
310
 
263
- ## [v1.3.0](https://github.com/chef-partners/vmware-vra-gem/tree/v1.3.0) (2015-11-12)
264
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.2.0...v1.3.0)
311
+ ## [v1.3.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.3.0) (2015-11-12)
312
+
313
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.2.0...v1.3.0)
265
314
 
266
315
  **Merged pull requests:**
267
316
 
268
- - Additional changes to support chef-provisoning-vra [\#13](https://github.com/chef-partners/vmware-vra-gem/pull/13) ([adamleff](https://github.com/adamleff))
317
+ - Additional changes to support chef-provisoning-vra [\#13](https://github.com/test-kitchen/vmware-vra-gem/pull/13) ([adamleff](https://github.com/adamleff))
318
+
319
+ ## [v1.2.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.2.0) (2015-09-24)
269
320
 
270
- ## [v1.2.0](https://github.com/chef-partners/vmware-vra-gem/tree/v1.2.0) (2015-09-24)
271
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.1.0...v1.2.0)
321
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.1.0...v1.2.0)
272
322
 
273
323
  **Closed issues:**
274
324
 
275
- - bug in pagination at path "/catalog-service/api/consumer/resources?limit=20" duplicate machines returned [\#10](https://github.com/chef-partners/vmware-vra-gem/issues/10)
325
+ - bug in pagination at path "/catalog-service/api/consumer/resources?limit=20" duplicate machines returned [\#10](https://github.com/test-kitchen/vmware-vra-gem/issues/10)
276
326
 
277
327
  **Merged pull requests:**
278
328
 
279
- - Allow setting of pagination page size, raise exception on duplicates [\#11](https://github.com/chef-partners/vmware-vra-gem/pull/11) ([adamleff](https://github.com/adamleff))
329
+ - Allow setting of pagination page size, raise exception on duplicates [\#11](https://github.com/test-kitchen/vmware-vra-gem/pull/11) ([adamleff](https://github.com/adamleff))
330
+
331
+ ## [v1.1.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.1.0) (2015-09-17)
280
332
 
281
- ## [v1.1.0](https://github.com/chef-partners/vmware-vra-gem/tree/v1.1.0) (2015-09-17)
282
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.0.0...v1.1.0)
333
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.0.0...v1.1.0)
283
334
 
284
335
  **Merged pull requests:**
285
336
 
286
- - Adding masking of passwords in console output [\#9](https://github.com/chef-partners/vmware-vra-gem/pull/9) ([adamleff](https://github.com/adamleff))
287
- - Removing specific error class from \#validate\_client\_options test [\#8](https://github.com/chef-partners/vmware-vra-gem/pull/8) ([adamleff](https://github.com/adamleff))
288
- - README update - spaces update only [\#6](https://github.com/chef-partners/vmware-vra-gem/pull/6) ([adamleff](https://github.com/adamleff))
337
+ - Adding masking of passwords in console output [\#9](https://github.com/test-kitchen/vmware-vra-gem/pull/9) ([adamleff](https://github.com/adamleff))
338
+ - Removing specific error class from \#validate\_client\_options test [\#8](https://github.com/test-kitchen/vmware-vra-gem/pull/8) ([adamleff](https://github.com/adamleff))
339
+ - README update - spaces update only [\#6](https://github.com/test-kitchen/vmware-vra-gem/pull/6) ([adamleff](https://github.com/adamleff))
289
340
 
290
- ## [v1.0.0](https://github.com/chef-partners/vmware-vra-gem/tree/v1.0.0) (2015-08-07)
291
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.0.0.rc2...v1.0.0)
341
+ ## [v1.0.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.0.0) (2015-08-07)
342
+
343
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.0.0.rc2...v1.0.0)
292
344
 
293
345
  **Merged pull requests:**
294
346
 
295
- - Release v1.0.0 [\#5](https://github.com/chef-partners/vmware-vra-gem/pull/5) ([adamleff](https://github.com/adamleff))
347
+ - Release v1.0.0 [\#5](https://github.com/test-kitchen/vmware-vra-gem/pull/5) ([adamleff](https://github.com/adamleff))
348
+
349
+ ## [v1.0.0.rc2](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.0.0.rc2) (2015-07-30)
296
350
 
297
- ## [v1.0.0.rc2](https://github.com/chef-partners/vmware-vra-gem/tree/v1.0.0.rc2) (2015-07-30)
298
- [Full Changelog](https://github.com/chef-partners/vmware-vra-gem/compare/v1.0.0.rc1...v1.0.0.rc2)
351
+ [Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v1.0.0.rc1...v1.0.0.rc2)
299
352
 
300
353
  **Merged pull requests:**
301
354
 
302
- - Add resource ownership information [\#4](https://github.com/chef-partners/vmware-vra-gem/pull/4) ([adamleff](https://github.com/adamleff))
355
+ - Add resource ownership information [\#4](https://github.com/test-kitchen/vmware-vra-gem/pull/4) ([adamleff](https://github.com/adamleff))
356
+
357
+ ## [v1.0.0.rc1](https://github.com/test-kitchen/vmware-vra-gem/tree/v1.0.0.rc1) (2015-07-29)
303
358
 
304
- ## [v1.0.0.rc1](https://github.com/chef-partners/vmware-vra-gem/tree/v1.0.0.rc1) (2015-07-29)
305
359
  **Closed issues:**
306
360
 
307
- - general 500 server errors should generate better error messages [\#3](https://github.com/chef-partners/vmware-vra-gem/issues/3)
308
- - sanity-check the VRA base URL [\#2](https://github.com/chef-partners/vmware-vra-gem/issues/2)
361
+ - general 500 server errors should generate better error messages [\#3](https://github.com/test-kitchen/vmware-vra-gem/issues/3)
362
+ - sanity-check the VRA base URL [\#2](https://github.com/test-kitchen/vmware-vra-gem/issues/2)
309
363
 
310
364
  **Merged pull requests:**
311
365
 
312
- - initial release [\#1](https://github.com/chef-partners/vmware-vra-gem/pull/1) ([adamleff](https://github.com/adamleff))
313
-
314
-
315
-
316
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
366
+ - initial release [\#1](https://github.com/test-kitchen/vmware-vra-gem/pull/1) ([adamleff](https://github.com/adamleff))
data/Gemfile CHANGED
@@ -2,4 +2,7 @@
2
2
  source "https://rubygems.org"
3
3
 
4
4
  # Specify your gem's dependencies in vmware-vra-gem.gemspec
5
+ group :development do
6
+ gem "simplecov", require: false
7
+ end
5
8
  gemspec
data/README.md CHANGED
@@ -125,8 +125,10 @@ request = client.catalog.request(
125
125
  #<Vra::DeploymentRequest:0x00007fb7340b7438
126
126
  ...
127
127
  ```
128
- To request a deployment from a catalog item, you can use the above method with a project ID that has a cloud template version released to the project.
129
- The ID of the catalog item from which you are requesting the deployment should be also included, and the version of the released cloud template.
128
+ To request a deployment from a catalog item, you can use the above method with a project ID that has a cloud template version released to the project.
129
+
130
+ The ID of the catalog item from which you are requesting the deployment should be also included, and the version of the released cloud template. If the user doesn't specify a version explicitly, the latest version will be fetched automatically and will be used for the request.
131
+
130
132
  Additionally, the name of the deployment should be specified and it should be unique.
131
133
  The image mapping specifies the OS image for a VM and the flavor mapping specifies the CPU count and RAM of a VM.
132
134
 
@@ -73,12 +73,24 @@ module Vra
73
73
  data['iconId']
74
74
  end
75
75
 
76
+ def versions
77
+ client
78
+ .http_get_paginated_array!("/catalog/api/items/#{id}/versions")
79
+ .map { |v| v['id'] }
80
+ end
81
+
76
82
  def entitle!(opts = {})
77
83
  super(opts.merge(type: 'CatalogItemIdentifier'))
78
84
  end
79
85
 
80
- def self.entitle!(client, id)
81
- new(client, id: id).entitle!
86
+ class << self
87
+ def entitle!(client, id)
88
+ new(client, id: id).entitle!
89
+ end
90
+
91
+ def fetch_latest_version(client, id)
92
+ new(client, data: { 'id' => id }).versions&.first
93
+ end
82
94
  end
83
95
  end
84
96
  end
data/lib/vra/client.rb CHANGED
@@ -88,7 +88,7 @@ module Vra
88
88
  headers = {}
89
89
  headers['Accept'] = 'application/json'
90
90
  headers['Content-Type'] = 'application/json'
91
- headers['csp-auth-token'] = @access_token.value unless @access_token.value.nil?
91
+ headers['Authorization'] = 'Bearer ' + @access_token.value unless @access_token.value.nil?
92
92
 
93
93
  headers
94
94
  end
@@ -85,13 +85,21 @@ module Vra
85
85
 
86
86
  def validate!
87
87
  missing_params = []
88
- %i[image_mapping flavor_mapping name project_id version].each do |arg|
88
+ %i[image_mapping flavor_mapping name project_id].each do |arg|
89
89
  missing_params << arg if send(arg).nil?
90
90
  end
91
91
 
92
- return if missing_params.empty?
92
+ unless missing_params.empty?
93
+ raise ArgumentError, "Unable to submit request, required param(s) missing => #{missing_params.join(', ')}"
94
+ end
95
+
96
+ # If the user doesn't supply the catalog version, fetch the latest version and use it
97
+ # and if the API was unable to find a valid version, alert the user.
98
+ return unless @version.nil?
99
+
93
100
 
94
- raise ArgumentError, "Unable to submit request, required param(s) missing => #{missing_params.join(', ')}"
101
+ @version = CatalogItem.fetch_latest_version(client, catalog_id)
102
+ raise ArgumentError, 'Unable to fetch a valid catalog version' if @version.nil?
95
103
  end
96
104
 
97
105
  def send_request!
data/lib/vra/version.rb CHANGED
@@ -18,5 +18,5 @@
18
18
  #
19
19
 
20
20
  module Vra
21
- VERSION = "3.0.1"
21
+ VERSION = "3.1.2"
22
22
  end
@@ -122,4 +122,37 @@ describe Vra::CatalogItem do
122
122
  expect(catalog_item.type).to be_a(Vra::CatalogType)
123
123
  end
124
124
  end
125
+
126
+ describe '#versions' do
127
+ let(:versions_response) do
128
+ [{ id: '2', description: 'v2.0' }, { id: '1', description: 'v1.0' }]
129
+ end
130
+
131
+ before do
132
+ allow(client).to receive(:authorized?).and_return(true)
133
+ end
134
+
135
+ it 'should call the api to fetch the versions' do
136
+ expect(client)
137
+ .to receive(:http_get_paginated_array!)
138
+ .with('/catalog/api/items/catalog-12345/versions')
139
+ .and_return(versions_response)
140
+
141
+ described_class.fetch_latest_version(client, 'catalog-12345')
142
+ end
143
+
144
+ it 'should return the correct version' do
145
+ stub_request(:get, client.full_url('/catalog/api/items/catalog-12345/versions?$skip=0&$top=20'))
146
+ .to_return(
147
+ status: 200,
148
+ body: {
149
+ content: versions_response,
150
+ totalPages: 1
151
+ }.to_json,
152
+ headers: {}
153
+ )
154
+
155
+ expect(described_class.fetch_latest_version(client, 'catalog-12345')).to eq('2')
156
+ end
157
+ end
125
158
  end
data/spec/client_spec.rb CHANGED
@@ -57,13 +57,13 @@ describe Vra::Client do
57
57
  context 'when access token exists' do
58
58
  it 'has an Authorization header' do
59
59
  client.access_token = '12345'
60
- expect(client.request_headers.key?('csp-auth-token')).to be true
60
+ expect(client.request_headers.key?('Authorization')).to be true
61
61
  end
62
62
  end
63
63
 
64
64
  context 'when access token does not exist' do
65
65
  it 'does not have an Authorization header' do
66
- expect(client.request_headers.key?('csp-auth-token')).to be false
66
+ expect(client.request_headers.key?('Authorization')).to be false
67
67
  end
68
68
  end
69
69
  end
@@ -70,6 +70,45 @@ describe Vra::DeploymentRequest do
70
70
 
71
71
  expect { request.send(:validate!) }.not_to raise_error(ArgumentError)
72
72
  end
73
+
74
+ context 'versions' do
75
+ let(:dep_request) do
76
+ described_class.new(
77
+ client,
78
+ catalog_id,
79
+ image_mapping: 'centos',
80
+ name: 'sample dep',
81
+ flavor_mapping: 'small',
82
+ project_id: 'pro-123'
83
+ )
84
+ end
85
+
86
+ before do
87
+ allow(client).to receive(:authorized?).and_return(true)
88
+ end
89
+
90
+ it 'should not call the api to fetch versions if provided in the params' do
91
+ expect(client).not_to receive(:http_get_paginated_array!)
92
+
93
+ dep_request.version = '1'
94
+ dep_request.send(:validate!)
95
+ end
96
+
97
+ it 'should fetch version from api if version is blank' do
98
+ expect(client).to receive(:http_get_paginated_array!).and_return([{ 'id' => '2', 'description' => 'v2.0' }])
99
+
100
+ dep_request.send(:validate!)
101
+ expect(dep_request.version).to eq('2')
102
+ end
103
+
104
+ it 'should raise an exception if no valid versions found' do
105
+ expect(client).to receive(:http_get_paginated_array!).and_return([])
106
+
107
+ expect { dep_request.send(:validate!) }
108
+ .to raise_error(ArgumentError)
109
+ .with_message('Unable to fetch a valid catalog version')
110
+ end
111
+ end
73
112
  end
74
113
 
75
114
  describe '#additional parameters' do
data/vmware-vra.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "bundler", ">= 1.7"
25
25
  spec.add_development_dependency "chefstyle"
26
26
  spec.add_development_dependency "pry", "~> 0.10"
27
- spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "rake", "~> 13.0"
28
28
  spec.add_development_dependency "rspec", "~> 3.0"
29
29
  spec.add_development_dependency "webmock", "~> 3.5"
30
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmware-vra
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Leff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-25 00:00:00.000000000 Z
12
+ date: 2022-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi-yajl
@@ -87,14 +87,14 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '10.0'
90
+ version: '13.0'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '10.0'
97
+ version: '13.0'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rspec
100
100
  requirement: !ruby/object:Gem::Requirement
@@ -132,6 +132,7 @@ extra_rdoc_files: []
132
132
  files:
133
133
  - ".github/ISSUE_TEMPLATE.md"
134
134
  - ".github/PULL_REQUEST_TEMPLATE.md"
135
+ - ".github/workflows/unit.yml"
135
136
  - ".gitignore"
136
137
  - ".rubocop.yml"
137
138
  - CHANGELOG.md
@@ -206,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
207
  - !ruby/object:Gem::Version
207
208
  version: '0'
208
209
  requirements: []
209
- rubygems_version: 3.2.32
210
+ rubygems_version: 3.3.7
210
211
  signing_key:
211
212
  specification_version: 4
212
213
  summary: Client gem for interacting with VMware vRealize Automation.