vmware-vra 3.1.3 → 3.2.0

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: 9f5265a1fb658c84986b019f01469ae9143300a5b0b36eda4825458ef28cc738
4
- data.tar.gz: 638b354ab5cd83171f560e7eefcb53ebe4e773f3b7fc2b9ef5b7260fee5288fd
3
+ metadata.gz: 0e0045f6ebfa8fa27f8842d7d99cab6caebbfed8dde6143caeca4f3586b84e89
4
+ data.tar.gz: f44441731dd50642476d4a47c0e5d7c0d2bd957cb262cd10f566011ff902b299
5
5
  SHA512:
6
- metadata.gz: 9c0e6ead2fc7eb2c8de12f87f5bcee61b7358f17061beb62f6f312521a4f29e2787d8018f22029c092aa86754c55c16918df13a457df304d48f6663d35d6f164
7
- data.tar.gz: b425f0d3c34074720708d91ac06f6c1421e1e2020f786a02c903dbbce028df413eb16056e21995a3e34f9f5b01a3a9f93935287282d53e9607a33ffcff608e75
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 tenant ID from your vRA administrator.
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', tenant: 'mytenant', base_url: 'https://vra.corp.local', verify_ssl: true)
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', tenant: 'mytenant', base_url: 'https://vra.corp.local', verify_ssl: true, page_size: 100)
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
- @tenant = opts[:tenant]
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': @tenant,
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 tenant is required" if @tenant.nil?
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
@@ -71,6 +71,10 @@ module Vra
71
71
  status == "CREATE_FAILED"
72
72
  end
73
73
 
74
+ def completion_details
75
+ requests.last.details
76
+ end
77
+
74
78
  def completed?
75
79
  successful? || failed?
76
80
  end
data/lib/vra/request.rb CHANGED
@@ -76,6 +76,10 @@ module Vra
76
76
  status == "FAILED"
77
77
  end
78
78
 
79
+ def details
80
+ request_data["details"]
81
+ end
82
+
79
83
  private
80
84
 
81
85
  attr_reader :request_data, :client
data/lib/vra/version.rb CHANGED
@@ -18,5 +18,5 @@
18
18
  #
19
19
 
20
20
  module Vra
21
- VERSION = "3.1.3"
21
+ VERSION = "3.2.0"
22
22
  end
@@ -24,7 +24,7 @@ describe Vra::CatalogItem do
24
24
  Vra::Client.new(
25
25
  username: "user@corp.local",
26
26
  password: "password",
27
- tenant: "tenant",
27
+ domain: "domain",
28
28
  base_url: "https://vra.corp.local"
29
29
  )
30
30
  end
@@ -23,7 +23,7 @@ describe Vra::CatalogSource do
23
23
  Vra::Client.new(
24
24
  username: "user@corp.local",
25
25
  password: "password",
26
- tenant: "tenant",
26
+ domain: "domain",
27
27
  base_url: "https://vra.corp.local"
28
28
  )
29
29
  end
data/spec/catalog_spec.rb CHANGED
@@ -24,7 +24,7 @@ describe Vra::Catalog do
24
24
  Vra::Client.new(
25
25
  username: "user@corp.local",
26
26
  password: "password",
27
- tenant: "tenant",
27
+ domain: "domain",
28
28
  base_url: "https://vra.corp.local"
29
29
  )
30
30
  end
@@ -23,7 +23,7 @@ describe Vra::CatalogType do
23
23
  Vra::Client.new(
24
24
  username: "user@corp.local",
25
25
  password: "password",
26
- tenant: "tenant",
26
+ domain: "domain",
27
27
  base_url: "https://vra.corp.local"
28
28
  )
29
29
  end
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
- tenant: "tenant",
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: "tenant",
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
- tenant: "tenant",
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
- tenant: "tenant",
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
- tenant: "tenant",
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 tenant is missing" do
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
- tenant: "tenant"
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
- tenant: "tenant",
563
+ domain: "domain",
564
564
  base_url: "something-that-is-not-a-HTTP-URI"
565
565
  )
566
566
  end
@@ -24,7 +24,7 @@ describe Vra::DeploymentRequest do
24
24
  Vra::Client.new(
25
25
  username: "user@corp.local",
26
26
  password: "password",
27
- tenant: "tenant",
27
+ domain: "domain",
28
28
  base_url: "https://vra.corp.local"
29
29
  )
30
30
  end
@@ -24,7 +24,7 @@ describe ::Vra::Deployment do
24
24
  Vra::Client.new(
25
25
  username: "user@corp.local",
26
26
  password: "password",
27
- tenant: "tenant",
27
+ domain: "domain",
28
28
  base_url: "https://vra.corp.local"
29
29
  )
30
30
  end
@@ -24,7 +24,7 @@ describe ::Vra::Deployments do
24
24
  Vra::Client.new(
25
25
  username: "user@corp.local",
26
26
  password: "password",
27
- tenant: "tenant",
27
+ domain: "domain",
28
28
  base_url: "https://vra.corp.local"
29
29
  )
30
30
  end
data/spec/request_spec.rb CHANGED
@@ -37,7 +37,7 @@ describe Vra::Request do
37
37
  Vra::Client.new(
38
38
  username: "user@corp.local",
39
39
  password: "password",
40
- tenant: "tenant",
40
+ domain: "domain",
41
41
  base_url: "https://vra.corp.local"
42
42
  )
43
43
  end
@@ -25,7 +25,7 @@ describe Vra::Resource do
25
25
  Vra::Client.new(
26
26
  username: "user@corp.local",
27
27
  password: "password",
28
- tenant: "tenant",
28
+ domain: "domain",
29
29
  base_url: "https://vra.corp.local"
30
30
  )
31
31
  end
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.1.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-05-26 00:00:00.000000000 Z
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.3
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: