vcloud-walker 3.2.1 → 3.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 3.2.2 (2014-05-01)
2
+
3
+ - Use pessimistic version dependency for vcloud-core
4
+
1
5
  ## 3.2.1 (2014-04-22)
2
6
 
3
7
  Bugfixes:
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # VCloud Walker
2
2
 
3
- Vcloud-walker is a command line tool, to describe different VMware vCloud Director 5.1 entities. It uses Fog under the hood.
3
+ Vcloud-walker is a command line tool, to describe different VMware vCloud
4
+ Director 5.1 entities. It uses Fog under the hood.
4
5
 
5
6
  ## Installation
6
7
 
@@ -24,7 +25,8 @@ You can perform following operations with walker.
24
25
  #### Walk vdcs:
25
26
  vcloud-walk vdcs
26
27
 
27
- describes all vdcs within given organization. This includes vapp, vm and network information.
28
+ describes all vdcs within given organization. This includes vapp, vm and network
29
+ information.
28
30
 
29
31
  #### Walk catalogs:
30
32
  vcloud-walk catalogs
@@ -39,54 +41,52 @@ describes all organization networks.
39
41
  #### Walk edgegateways:
40
42
  vcloud-walk edgegateways
41
43
 
42
- describes all edgegateway for given organization. Each edgegateway includes configuration for firewall, load balancer and nat services.
44
+ describes all edgegateway for given organization. Each edgegateway includes
45
+ configuration for firewall, load balancer and nat services.
43
46
 
44
47
  #### Walk entire organization:
45
48
  vcloud-walk organization
46
49
 
47
- describes the entire organization, which includes edgegateway, catalogs, networks and vdcs within an organization.
50
+ describes the entire organization, which includes edgegateway, catalogs,
51
+ networks and vdcs within an organization.
48
52
 
49
- ### Credentials
53
+ ## Credentials
50
54
 
51
- You will need to specify the credentials for your VMware environment. Vcloud-walker uses fog to query the VMware api,
52
- which offers two ways to do this.
55
+ vCloud Walker is based around [fog](http://fog.io/). To use it you'll need to give it
56
+ credentials that allow it to talk to a vCloud Director environment.
53
57
 
54
- #### 1. Create a `.fog` file containing your credentials
58
+ 1. Create a '.fog' file in your home directory.
55
59
 
56
- An example of .fog file is:
60
+ For example:
57
61
 
58
- ````
59
- default:
60
- vcloud_director_username: 'user_id@org_id'
61
- vcloud_director_password: 'password'
62
- vcloud_director_host: 'api_endpoint'
63
- ````
62
+ test_credentials:
63
+ vcloud_director_host: 'host.api.example.com'
64
+ vcloud_director_username: 'username@org_name'
65
+ vcloud_director_password: ''
64
66
 
65
- To understand more about `.fog` files, visit the 'Credentials' section here => http://fog.io/about/getting_started.html.
67
+ 2. Obtain a session token. First, curl the API:
66
68
 
67
- ### 2. Log on externally and supply your session token
69
+ curl -D- -d '' \
70
+ -H 'Accept: application/*+xml;version=5.1' -u '<username>@<org_name>' \
71
+ https://<host.api.example.com>/api/sessions
68
72
 
69
- You can choose to log on externally by interacting independently with the API and supplying your session token to the
70
- tool by setting the `FOG_VCLOUD_TOKEN` ENV variable. This option reduces the risk footprint by allowing the user to
71
- store their credentials in safe storage. The default token lifetime is '30 minutes idle' - any activity extends the life by another 30 mins.
73
+ This will prompt for your password.
72
74
 
73
- A basic example of this would be the following:
75
+ From the headers returned, the value of the `x-vcloud-authorization` header is your
76
+ session token, and this will be valid for 30 minutes idle - any activity will extend
77
+ its life by another 30 minutes.
74
78
 
75
- curl
76
- -D-
77
- -d ''
78
- -H 'Accept: application/*+xml;version=5.1' -u '<user>@<org>'
79
- https://host.com/api/sessions
79
+ 3. Specify your credentials and session token at the beginning of the command. For example:
80
80
 
81
- This will prompt for your password.
81
+ FOG_CREDENTIAL=test_credentials \
82
+ FOG_VCLOUD_TOKEN=AAAABBBBBCCCCCCDDDDDDEEEEEEFFFFF= \
83
+ vcloud-walk organization
82
84
 
83
- From the headers returned, select the header below
85
+ You may find it easier to export one or both of the values as environment variables.
84
86
 
85
- x-vcloud-authorization: AAAABBBBBCCCCCCDDDDDDEEEEEEFFFFF=
87
+ **NB** It is also possible to sidestep the need for the session token by saving your
88
+ password in the fog file. This is **not recommended**.
86
89
 
87
- Use token as ENV var FOG_VCLOUD_TOKEN
88
-
89
- FOG_VCLOUD_TOKEN=AAAABBBBBCCCCCCDDDDDDEEEEEEFFFFF= vcloud-walk organization
90
90
 
91
91
  ### Output
92
92
 
@@ -95,6 +95,16 @@ You can use command line option ```--yaml``` for yaml output.
95
95
 
96
96
  Find sample json output in docs/examples directory.
97
97
 
98
+ ## The vCloud API
99
+
100
+ vCloud Tools currently use version 5.1 of the [vCloud API](http://pubs.vmware.com/vcd-51/index.jsp?topic=%2Fcom.vmware.vcloud.api.doc_51%2FGUID-F4BF9D5D-EF66-4D36-A6EB-2086703F6E37.html). Version 5.5 may work but is not currently supported. You should be able to access the 5.1 API in a 5.5 environment, and this *is* currently supported.
101
+
102
+ The default version is defined in [Fog](https://github.com/fog/fog/blob/244a049918604eadbcebd3a8eaaf433424fe4617/lib/fog/vcloud_director/compute.rb#L32).
103
+
104
+ If you want to be sure you are pinning to 5.1, or use 5.5, you can set the API version to use in your fog file, e.g.
105
+
106
+ `vcloud_director_api_version: 5.1`
107
+
98
108
  ## Debugging
99
109
 
100
110
  `export EXCON_DEBUG=true` - this will print out the API requests and responses.
data/jenkins.sh CHANGED
@@ -7,9 +7,6 @@ git clean -fdx
7
7
  bundle install --path "${HOME}/bundles/${JOB_NAME}"
8
8
  bundle exec rake
9
9
 
10
- ./scripts/generate_fog_conf_file.sh
11
- export FOG_RC=fog_integration_test.config
12
- bundle exec rake integration_test
13
- rm fog_integration_test.config
10
+ RUBYOPT="-r ./tools/fog_credentials" bundle exec rake integration_test
14
11
 
15
12
  bundle exec rake publish_gem
@@ -2,10 +2,4 @@
2
2
  set -e
3
3
  bundle install --path "${HOME}/bundles/${JOB_NAME}"
4
4
 
5
- ./scripts/generate_fog_conf_file.sh
6
-
7
- export FOG_RC=fog_integration_test.config
8
-
9
- bundle exec rake integration_test
10
-
11
- rm fog_integration_test.config
5
+ RUBYOPT="-r ./tools/fog_credentials" bundle exec rake integration_test
@@ -1,5 +1,5 @@
1
1
  module Vcloud
2
2
  module Walker
3
- VERSION = '3.2.1'
3
+ VERSION = '3.2.2'
4
4
  end
5
5
  end
@@ -0,0 +1,17 @@
1
+ # Initialiser for getting vCloud credentials into Fog from Jenkins build
2
+ # parameters, without needing to write them to disk. To be used with:
3
+ #
4
+ # RUBYOPT="-r ./tools/fog_credentials" bundle exec integration
5
+ #
6
+ # Replace with FOG_VCLOUD_TOKEN support when we have a tool:
7
+ #
8
+ # https://www.pivotaltracker.com/story/show/68989754
9
+ #
10
+ require 'bundler/setup'
11
+ require 'fog'
12
+
13
+ Fog.credentials = {
14
+ :vcloud_director_host => ENV['API_HOST'],
15
+ :vcloud_director_username => ENV['API_USERNAME'],
16
+ :vcloud_director_password => ENV['API_PASSWORD'],
17
+ }
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.add_runtime_dependency 'json', '~> 1.8.0'
26
26
  s.add_runtime_dependency 'methadone'
27
27
  s.add_runtime_dependency 'fog', '>= 1.21.0'
28
- s.add_runtime_dependency 'vcloud-core', '>= 0.0.12'
28
+ s.add_runtime_dependency 'vcloud-core', '~> 0.0.12'
29
29
  s.add_development_dependency 'simplecov', '~> 0.8.2'
30
30
  s.add_development_dependency 'gem_publisher', '1.2.0'
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcloud-walker
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-22 00:00:00.000000000 Z
12
+ date: 2014-05-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -128,7 +128,7 @@ dependencies:
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
- - - ! '>='
131
+ - - ~>
132
132
  - !ruby/object:Gem::Version
133
133
  version: 0.0.12
134
134
  type: :runtime
@@ -136,7 +136,7 @@ dependencies:
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  none: false
138
138
  requirements:
139
- - - ! '>='
139
+ - - ~>
140
140
  - !ruby/object:Gem::Version
141
141
  version: 0.0.12
142
142
  - !ruby/object:Gem::Dependency
@@ -211,7 +211,6 @@ files:
211
211
  - scripts/configure_walker_ci_vse.rb
212
212
  - scripts/data/walker_ci/carrenza.yaml
213
213
  - scripts/data/walker_ci/skyscape.yaml
214
- - scripts/generate_fog_conf_file.sh
215
214
  - spec/fog_interface_spec.rb
216
215
  - spec/integration/vcloud_walker_spec.rb
217
216
  - spec/spec_helper.rb
@@ -226,6 +225,7 @@ files:
226
225
  - spec/walk/vapp_spec.rb
227
226
  - spec/walk/vdcs_spec.rb
228
227
  - spec/walk/vm_spec.rb
228
+ - tools/fog_credentials.rb
229
229
  - vcloud-walker.gemspec
230
230
  homepage: https://github.com/alphagov/vcloud-walker
231
231
  licenses:
@@ -242,7 +242,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
242
242
  version: '0'
243
243
  segments:
244
244
  - 0
245
- hash: 425878083933319331
245
+ hash: 523235107079612422
246
246
  required_rubygems_version: !ruby/object:Gem::Requirement
247
247
  none: false
248
248
  requirements:
@@ -251,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
251
  version: '0'
252
252
  segments:
253
253
  - 0
254
- hash: 425878083933319331
254
+ hash: 523235107079612422
255
255
  requirements: []
256
256
  rubyforge_project:
257
257
  rubygems_version: 1.8.23
@@ -1,6 +0,0 @@
1
- cat <<EOF >fog_integration_test.config
2
- default:
3
- vcloud_director_username: '$API_USERNAME'
4
- vcloud_director_password: '$API_PASSWORD'
5
- vcloud_director_host: '$API_HOST'
6
- EOF