vmware-vra 3.1.3 → 3.2.0
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/CHANGELOG.md +6 -0
- data/README.md +3 -3
- data/lib/vra/client.rb +14 -3
- data/lib/vra/deployment.rb +4 -0
- data/lib/vra/request.rb +4 -0
- data/lib/vra/version.rb +1 -1
- data/spec/catalog_item_spec.rb +1 -1
- data/spec/catalog_source_spec.rb +1 -1
- data/spec/catalog_spec.rb +1 -1
- data/spec/catalog_type_spec.rb +1 -1
- data/spec/client_spec.rb +8 -8
- data/spec/deployment_request_spec.rb +1 -1
- data/spec/deployment_spec.rb +1 -1
- data/spec/deployments_spec.rb +1 -1
- data/spec/request_spec.rb +1 -1
- data/spec/resource_spec.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e0045f6ebfa8fa27f8842d7d99cab6caebbfed8dde6143caeca4f3586b84e89
|
4
|
+
data.tar.gz: f44441731dd50642476d4a47c0e5d7c0d2bd957cb262cd10f566011ff902b299
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae31f69005d0e71b02712f75486619e8e68b22265ba5d45874a7f96e2c83ee75f5eea71d9c0bcd6eb8bad93bc8e3cf254b1fb1b2d2d0dbefb1447a7b3f26419d
|
7
|
+
data.tar.gz: c8c59ca96efa6784ddcad31204fa1e23b2c9119e5173a829cd87fdfb4f08fefd0af0eb84366593f3f731259da3b71c840e9471e743852acdd80a52fc68734e8b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [3.2.0](https://github.com/test-kitchen/vmware-vra-gem/tree/v3.2.0) (2022-12-19)
|
4
|
+
|
5
|
+
- Updated the tenant attribute to domain
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/test-kitchen/vmware-vra-gem/compare/v3.1.3...v3.2.0)
|
8
|
+
|
3
9
|
## [3.1.3](https://github.com/test-kitchen/vmware-vra-gem/tree/v3.1.3) (2022-05-26)
|
4
10
|
|
5
11
|
- Use regular admin catalog endpoint to fetch catalog items
|
data/README.md
CHANGED
@@ -47,10 +47,10 @@ require 'vra'
|
|
47
47
|
=> true
|
48
48
|
```
|
49
49
|
|
50
|
-
Then, set up your client object. You will need to know your
|
50
|
+
Then, set up your client object. You will need to know your domain from your vRA administrator.
|
51
51
|
|
52
52
|
```shell
|
53
|
-
client = Vra::Client.new(username: 'devmgr@corp.local', password: 'mypassword',
|
53
|
+
client = Vra::Client.new(username: 'devmgr@corp.local', password: 'mypassword', domain: 'domain.corp.local', base_url: 'https://vra.corp.local', verify_ssl: true)
|
54
54
|
=> #<Vra::Client:0x000000034c0df8 ... >
|
55
55
|
```
|
56
56
|
|
@@ -234,7 +234,7 @@ deployment.requests
|
|
234
234
|
vRA paginates API requests where lists of items are returned. By default, this gem will ask vRA to provide items in groups of 20. However, as reported in [Issue 10](https://github.com/chef-partners/vmware-vra-gem/issues/10), it appears vRA may have a pagination bug. You can change the default page size from 20 to a value of your choice by passing in a `page_size` option when setting up the client:
|
235
235
|
|
236
236
|
```ruby
|
237
|
-
vra = Vra::Client.new(username: 'devmgr@corp.local', password: 'mypassword',
|
237
|
+
vra = Vra::Client.new(username: 'devmgr@corp.local', password: 'mypassword', domain: 'domain.corp.local', base_url: 'https://vra.corp.local', verify_ssl: true, page_size: 100)
|
238
238
|
```
|
239
239
|
|
240
240
|
... or setting `page_size` on the client object after you've created it:
|
data/lib/vra/client.rb
CHANGED
@@ -33,7 +33,8 @@ module Vra
|
|
33
33
|
@base_url = opts[:base_url]
|
34
34
|
@username = opts[:username]
|
35
35
|
@password = PasswordMasker.new(opts[:password])
|
36
|
-
@
|
36
|
+
@domain = fetch_domain(opts)
|
37
|
+
|
37
38
|
@verify_ssl = opts.fetch(:verify_ssl, true)
|
38
39
|
@refresh_token = PasswordMasker.new(nil)
|
39
40
|
@access_token = PasswordMasker.new(nil)
|
@@ -80,7 +81,7 @@ module Vra
|
|
80
81
|
{
|
81
82
|
'username': @username,
|
82
83
|
'password': @password.value,
|
83
|
-
'domain': @
|
84
|
+
'domain': @domain,
|
84
85
|
}
|
85
86
|
end
|
86
87
|
|
@@ -231,7 +232,7 @@ module Vra
|
|
231
232
|
|
232
233
|
def validate_client_options!
|
233
234
|
raise ArgumentError, "Username and password are required" if @username.nil? || @password.value.nil?
|
234
|
-
raise ArgumentError, "A
|
235
|
+
raise ArgumentError, "A domain is required" if @domain.nil?
|
235
236
|
raise ArgumentError, "A base URL is required" if @base_url.nil?
|
236
237
|
raise ArgumentError, "Base URL #{@base_url} is not a valid URI." unless valid_uri?(@base_url)
|
237
238
|
end
|
@@ -242,5 +243,15 @@ module Vra
|
|
242
243
|
rescue URI::InvalidURIError
|
243
244
|
false
|
244
245
|
end
|
246
|
+
|
247
|
+
private
|
248
|
+
|
249
|
+
# This is for backward compatibility, if someone still uses tenant key to pass the domain,
|
250
|
+
# it should also work.
|
251
|
+
def fetch_domain(opts)
|
252
|
+
return opts[:tenant] if opts.key?(:tenant) && !opts.key?(:domain)
|
253
|
+
|
254
|
+
opts[:domain]
|
255
|
+
end
|
245
256
|
end
|
246
257
|
end
|
data/lib/vra/deployment.rb
CHANGED
data/lib/vra/request.rb
CHANGED
data/lib/vra/version.rb
CHANGED
data/spec/catalog_item_spec.rb
CHANGED
data/spec/catalog_source_spec.rb
CHANGED
data/spec/catalog_spec.rb
CHANGED
data/spec/catalog_type_spec.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -26,7 +26,7 @@ describe Vra::Client do
|
|
26
26
|
{
|
27
27
|
username: "user@corp.local",
|
28
28
|
password: "password",
|
29
|
-
|
29
|
+
domain: "domain",
|
30
30
|
base_url: "https://vra.corp.local",
|
31
31
|
}
|
32
32
|
end
|
@@ -136,7 +136,7 @@ describe Vra::Client do
|
|
136
136
|
{
|
137
137
|
username: "user@corp.local",
|
138
138
|
password: "password",
|
139
|
-
domain: "
|
139
|
+
domain: "domain",
|
140
140
|
}.to_json
|
141
141
|
end
|
142
142
|
|
@@ -414,7 +414,7 @@ describe Vra::Client do
|
|
414
414
|
let(:unverified_client) do
|
415
415
|
Vra::Client.new(username: "user@corp.local",
|
416
416
|
password: "password",
|
417
|
-
|
417
|
+
domain: "domain",
|
418
418
|
base_url: "https://vra.corp.local",
|
419
419
|
verify_ssl: false)
|
420
420
|
end
|
@@ -503,7 +503,7 @@ describe Vra::Client do
|
|
503
503
|
let(:client) do
|
504
504
|
described_class.new(
|
505
505
|
password: "password",
|
506
|
-
|
506
|
+
domain: "domain",
|
507
507
|
base_url: "https://vra.corp.local"
|
508
508
|
)
|
509
509
|
end
|
@@ -517,7 +517,7 @@ describe Vra::Client do
|
|
517
517
|
let(:client) do
|
518
518
|
described_class.new(
|
519
519
|
username: "username",
|
520
|
-
|
520
|
+
domain: "domain",
|
521
521
|
base_url: "https://vra.corp.local"
|
522
522
|
)
|
523
523
|
end
|
@@ -527,7 +527,7 @@ describe Vra::Client do
|
|
527
527
|
end
|
528
528
|
end
|
529
529
|
|
530
|
-
context "when
|
530
|
+
context "when domain is missing" do
|
531
531
|
let(:client) do
|
532
532
|
described_class.new(
|
533
533
|
username: "username",
|
@@ -546,7 +546,7 @@ describe Vra::Client do
|
|
546
546
|
described_class.new(
|
547
547
|
username: "username",
|
548
548
|
password: "password",
|
549
|
-
|
549
|
+
domain: "domain"
|
550
550
|
)
|
551
551
|
end
|
552
552
|
|
@@ -560,7 +560,7 @@ describe Vra::Client do
|
|
560
560
|
described_class.new(
|
561
561
|
username: "username",
|
562
562
|
password: "password",
|
563
|
-
|
563
|
+
domain: "domain",
|
564
564
|
base_url: "something-that-is-not-a-HTTP-URI"
|
565
565
|
)
|
566
566
|
end
|
data/spec/deployment_spec.rb
CHANGED
data/spec/deployments_spec.rb
CHANGED
data/spec/request_spec.rb
CHANGED
data/spec/resource_spec.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vmware-vra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Leff
|
8
8
|
- JJ Asghar
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi-yajl
|
@@ -192,7 +192,7 @@ homepage: https://github.com/chef-partners/vmware-vra-gem
|
|
192
192
|
licenses:
|
193
193
|
- Apache 2.0
|
194
194
|
metadata: {}
|
195
|
-
post_install_message:
|
195
|
+
post_install_message:
|
196
196
|
rdoc_options: []
|
197
197
|
require_paths:
|
198
198
|
- lib
|
@@ -207,8 +207,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
209
|
requirements: []
|
210
|
-
rubygems_version: 3.2.
|
211
|
-
signing_key:
|
210
|
+
rubygems_version: 3.2.32
|
211
|
+
signing_key:
|
212
212
|
specification_version: 4
|
213
213
|
summary: Client gem for interacting with VMware vRealize Automation.
|
214
214
|
test_files:
|