vmware-vra 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -14
- data/CHANGELOG.md +8 -1
- data/Gemfile +1 -1
- data/README.md +1 -1
- data/Rakefile +8 -5
- data/lib/vra.rb +11 -11
- data/lib/vra/catalog.rb +3 -3
- data/lib/vra/catalog_item.rb +14 -14
- data/lib/vra/catalog_request.rb +9 -9
- data/lib/vra/client.rb +29 -27
- data/lib/vra/exceptions.rb +5 -5
- data/lib/vra/http.rb +9 -9
- data/lib/vra/request.rb +6 -6
- data/lib/vra/request_parameters.rb +7 -7
- data/lib/vra/requests.rb +2 -2
- data/lib/vra/resource.rb +69 -69
- data/lib/vra/resources.rb +1 -1
- data/lib/vra/version.rb +1 -1
- data/spec/catalog_item_spec.rb +61 -61
- data/spec/catalog_request_spec.rb +61 -61
- data/spec/catalog_spec.rb +58 -58
- data/spec/client_spec.rb +187 -187
- data/spec/http_spec.rb +59 -59
- data/spec/request_spec.rb +43 -43
- data/spec/requests_spec.rb +15 -15
- data/spec/resource_spec.rb +163 -163
- data/spec/resources_spec.rb +15 -15
- data/spec/spec_helper.rb +2 -2
- data/vmware-vra.gemspec +18 -18
- metadata +18 -17
data/spec/resources_spec.rb
CHANGED
@@ -17,31 +17,31 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
19
|
|
20
|
-
require
|
20
|
+
require "spec_helper"
|
21
21
|
|
22
22
|
describe Vra::Resources do
|
23
23
|
let(:client) do
|
24
|
-
Vra::Client.new(username:
|
25
|
-
password:
|
26
|
-
tenant:
|
27
|
-
base_url:
|
24
|
+
Vra::Client.new(username: "user@corp.local",
|
25
|
+
password: "password",
|
26
|
+
tenant: "tenant",
|
27
|
+
base_url: "https://vra.corp.local")
|
28
28
|
end
|
29
29
|
|
30
30
|
let(:resources) { Vra::Resources.new(client) }
|
31
31
|
|
32
|
-
describe
|
33
|
-
it
|
32
|
+
describe "#all_resources" do
|
33
|
+
it "calls the resources API endpoint" do
|
34
34
|
expect(client).to receive(:http_get_paginated_array!)
|
35
|
-
.with(
|
35
|
+
.with("/catalog-service/api/consumer/resources")
|
36
36
|
.and_return([])
|
37
37
|
|
38
38
|
resources.all_resources
|
39
39
|
end
|
40
40
|
|
41
|
-
it
|
41
|
+
it "returns an array of resource objects" do
|
42
42
|
allow(client).to receive(:http_get_paginated_array!)
|
43
|
-
.with(
|
44
|
-
.and_return([ {
|
43
|
+
.with("/catalog-service/api/consumer/resources")
|
44
|
+
.and_return([ { "id" => "1" }, { "id" => "2" } ])
|
45
45
|
|
46
46
|
items = resources.all_resources
|
47
47
|
|
@@ -50,11 +50,11 @@ describe Vra::Resources do
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
describe
|
54
|
-
it
|
55
|
-
expect(Vra::Resource).to receive(:new).with(client, id:
|
53
|
+
describe "#by_id" do
|
54
|
+
it "returns a resource object" do
|
55
|
+
expect(Vra::Resource).to receive(:new).with(client, id: "12345")
|
56
56
|
|
57
|
-
resources.by_id(
|
57
|
+
resources.by_id("12345")
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
data/spec/spec_helper.rb
CHANGED
data/vmware-vra.gemspec
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
# frozen_string_literal: true
|
3
|
-
lib = File.expand_path(
|
3
|
+
lib = File.expand_path("../lib", __FILE__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require
|
5
|
+
require "vra/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name =
|
8
|
+
spec.name = "vmware-vra"
|
9
9
|
spec.version = Vra::VERSION
|
10
|
-
spec.authors = [
|
11
|
-
spec.email = [
|
12
|
-
spec.summary =
|
10
|
+
spec.authors = ["Adam Leff", "JJ Asghar"]
|
11
|
+
spec.email = ["jj@chef.io"]
|
12
|
+
spec.summary = "Client gem for interacting with VMware vRealize Automation."
|
13
13
|
spec.description = spec.summary
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
14
|
+
spec.homepage = "https://github.com/chef-partners/vmware-vra-gem"
|
15
|
+
spec.license = "Apache 2.0"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0")
|
18
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
-
spec.require_paths = [
|
20
|
+
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency
|
23
|
-
spec.add_dependency
|
22
|
+
spec.add_dependency "chefstyle"
|
23
|
+
spec.add_dependency "ffi-yajl", "~> 2.2"
|
24
|
+
spec.add_dependency "passwordmasker", "~> 1.2"
|
24
25
|
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
30
|
-
spec.add_development_dependency
|
31
|
-
spec.add_development_dependency 'github_changelog_generator'
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
29
|
+
spec.add_development_dependency "webmock", "~> 1.21"
|
30
|
+
spec.add_development_dependency "pry", "~> 0.10"
|
31
|
+
spec.add_development_dependency "github_changelog_generator"
|
32
32
|
end
|
metadata
CHANGED
@@ -1,15 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vmware-vra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Leff
|
8
|
+
- JJ Asghar
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
12
|
date: 2017-03-14 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: chefstyle
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
13
28
|
- !ruby/object:Gem::Dependency
|
14
29
|
name: ffi-yajl
|
15
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,20 +109,6 @@ dependencies:
|
|
94
109
|
- - "~>"
|
95
110
|
- !ruby/object:Gem::Version
|
96
111
|
version: '1.21'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rubocop
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0.35'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0.35'
|
111
112
|
- !ruby/object:Gem::Dependency
|
112
113
|
name: pry
|
113
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,7 +139,7 @@ dependencies:
|
|
138
139
|
version: '0'
|
139
140
|
description: Client gem for interacting with VMware vRealize Automation.
|
140
141
|
email:
|
141
|
-
-
|
142
|
+
- jj@chef.io
|
142
143
|
executables: []
|
143
144
|
extensions: []
|
144
145
|
extra_rdoc_files: []
|
@@ -183,7 +184,7 @@ files:
|
|
183
184
|
- spec/resources_spec.rb
|
184
185
|
- spec/spec_helper.rb
|
185
186
|
- vmware-vra.gemspec
|
186
|
-
homepage:
|
187
|
+
homepage: https://github.com/chef-partners/vmware-vra-gem
|
187
188
|
licenses:
|
188
189
|
- Apache 2.0
|
189
190
|
metadata: {}
|