fog-vsphere 1.5.1 → 1.5.2
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 +4 -0
- data/CONTRIBUTORS.md +1 -0
- data/README.md +78 -12
- data/gemfiles/Gemfile.1.9.2+ +3 -3
- data/lib/fog/vsphere/requests/compute/get_virtual_machine.rb +15 -4
- data/lib/fog/vsphere/version.rb +1 -1
- data/tests/helper.rb +2 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc6ccb1f44c8afade6e70efc449d05184c446f52
|
4
|
+
data.tar.gz: 39d5496413d90ce5b393e43e110f03f87565c07e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b638f779c9567d64812575781c204ca1c5ae6b7c2efff64520383c09f67941661f8f70dff3ce4feb59718f83c972cb4ac69d8d26de1c139dd08734342a8ff204
|
7
|
+
data.tar.gz: 8dd2017c1de9dc207c280b02c0d768d757cfc29db69e9627392e61433788e7aa29946f1cad921d8b05225b18b7615422d5268adbc7bbb9b56634d51df7c1be3b
|
data/CHANGELOG.md
CHANGED
data/CONTRIBUTORS.md
CHANGED
@@ -14,6 +14,7 @@
|
|
14
14
|
* Francois Herbert <F.Herbert@massey.ac.nz>
|
15
15
|
* Francois Herbert <fherbert@oss.co.nz>
|
16
16
|
* Francois Herbert <francois@herbert.org.nz>
|
17
|
+
* Guido Günther <agx@sigxcpu.org>
|
17
18
|
* Ivan Nečas <inecas@redhat.com>
|
18
19
|
* Ivo Reznicek <ireznice@googlemail.com>
|
19
20
|
* J.R. Garcia <jr@garciaole.com>
|
data/README.md
CHANGED
@@ -1,31 +1,97 @@
|
|
1
|
-
# Fog
|
1
|
+
# Fog vSphere
|
2
|
+
> VMware vSphere® provider for the Fog cloud services library
|
2
3
|
|
3
|
-
[![Gem Version]
|
4
|
+
[![Gem Version][gemfury-image]][gemfury-url]
|
5
|
+
[![Build Status][travis-image]][travis-url]
|
6
|
+
[![Dependency Status][gemnasium-image]][gemnasium-url]
|
7
|
+
[![Test Coverage][coverage-image]][coverage-url]
|
8
|
+
[![Code Climate][climate-image]][climate-url]
|
4
9
|
|
5
|
-
|
10
|
+
The VMware vSphere® provider allows you to use the abstractions of the Fog cloud services library to communicate with vSphere.
|
6
11
|
|
7
12
|
## Installation
|
8
13
|
|
9
|
-
|
14
|
+
To use this gem in your application, add this line to your Gemfile:
|
10
15
|
|
16
|
+
```ruby
|
11
17
|
gem 'fog-vsphere'
|
18
|
+
```
|
12
19
|
|
13
20
|
And then execute:
|
14
21
|
|
15
|
-
|
22
|
+
```bash
|
23
|
+
bundle
|
24
|
+
```
|
16
25
|
|
17
26
|
Or install it yourself as:
|
18
27
|
|
19
|
-
|
28
|
+
```bash
|
29
|
+
gem install fog-vsphere
|
30
|
+
```
|
20
31
|
|
21
32
|
## Usage
|
22
33
|
|
23
|
-
|
34
|
+
To connect to your vSphere instance with Fog vSphere:
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
require 'fog/vsphere'
|
38
|
+
|
39
|
+
compute = Fog::Compute.new(
|
40
|
+
provider: :vsphere,
|
41
|
+
vsphere_username: 'username',
|
42
|
+
vsphere_password: 'password',
|
43
|
+
vsphere_server: 'server.example.com',
|
44
|
+
vsphere_expected_pubkey_hash: '0123456789abcdef0123456789abcdef',
|
45
|
+
vsphere_ssl: true,
|
46
|
+
vsphere_rev: '6.0'
|
47
|
+
)
|
48
|
+
```
|
49
|
+
|
50
|
+
From there you can create, destroy, list, and modify most things related to vSphere. Some examples include:
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
# continued from previous example
|
54
|
+
|
55
|
+
# List datacenters
|
56
|
+
compute.list_datacenters
|
57
|
+
#=> [{id: 'datacenter-1', name: 'DC1', path: ['DC1'], status: 'gray'},
|
58
|
+
#=> {id: 'datacenter-2', name: 'DC2', path: ['DC2'], status: 'gray'}]
|
59
|
+
|
60
|
+
# Get datacenter by name
|
61
|
+
compute.get_datacenter('DC1')
|
62
|
+
#=> {name: 'DC1', status: 'gray', path: ['DC1']}
|
63
|
+
|
64
|
+
# List virtual machines
|
65
|
+
compute.list_virtual_machines
|
66
|
+
#=> [{'id' => 'ab589f9a-af35-428e-9690-9b96587d86f3',
|
67
|
+
#=> 'name' => 'TestVM',
|
68
|
+
#=> 'uuid' => 'fc51eb7a-fa50-4d96-bd16-63972b49f52f',
|
69
|
+
#=> ...
|
70
|
+
|
71
|
+
# List a VM's SCSI controllers
|
72
|
+
compute.list_vm_scsi_controllers('ab589f9a-af35-428e-9690-9b96587d86f3')
|
73
|
+
#=> [<Fog::Compute::Vsphere::SCSIController
|
74
|
+
#=> shared_bus='noSharing',
|
75
|
+
#=> type='VirtualLsiLogicController',
|
76
|
+
#=> unit_number=7,
|
77
|
+
#=> key=1000,
|
78
|
+
#=> server_id=nil
|
79
|
+
#=> >]
|
80
|
+
```
|
81
|
+
|
82
|
+
There is a lot more you can do as well! We are working on providing better documentation right now. For now, you can look at the [RubyDocs](http://www.rubydoc.info/gems/fog-vsphere/), browse what's available with [Pry](http://pryrepl.org/), and view the documentation for [Fog](http://fog.io). We hope to have much more documentation and plenty of examples soon.
|
24
83
|
|
25
84
|
## Contributing
|
26
85
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
86
|
+
To contribute to this project, add an issue or pull request. For more info on what that means or how to do it, see [this guide](https://guides.github.com/activities/contributing-to-open-source/#contributing) from GitHub.
|
87
|
+
|
88
|
+
[climate-image]: https://codeclimate.com/github/fog/fog-vsphere.svg
|
89
|
+
[climate-url]: https://codeclimate.com/github/fog/fog-vsphere
|
90
|
+
[coverage-image]: https://codeclimate.com/github/fog/fog-vsphere/badges/coverage.svg
|
91
|
+
[coverage-url]: https://codeclimate.com/github/fog/fog-vsphere/coverage
|
92
|
+
[gemfury-image]: https://badge.fury.io/rb/fog-vsphere.svg
|
93
|
+
[gemfury-url]: http://badge.fury.io/rb/fog-vsphere
|
94
|
+
[gemnasium-image]: https://gemnasium.com/fog/fog-vsphere.svg
|
95
|
+
[gemnasium-url]: https://gemnasium.com/fog/fog-vsphere
|
96
|
+
[travis-image]: https://travis-ci.org/fog/fog-vsphere.svg?branch=master
|
97
|
+
[travis-url]: https://travis-ci.org/fog/fog-vsphere
|
data/gemfiles/Gemfile.1.9.2+
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'codeclimate-test-reporter', group: :test, require: nil
|
4
|
-
|
3
|
+
gem 'codeclimate-test-reporter', '~> 1.0', group: :test, require: nil
|
4
|
+
gem 'json', '~> 1.8.0'
|
5
5
|
gem 'net-ssh', '~> 2.9'
|
6
6
|
gem 'rubocop', '~> 0.41.0'
|
7
|
-
gem '
|
7
|
+
gem 'simplecov', '~> 0.12.0'
|
8
8
|
|
9
9
|
gemspec :path => '..'
|
@@ -40,12 +40,23 @@ module Fog
|
|
40
40
|
if name.include?('/')
|
41
41
|
folder = File.dirname(name)
|
42
42
|
basename = File.basename(name)
|
43
|
-
vms.find
|
43
|
+
vms.find do |v|
|
44
|
+
begin
|
45
|
+
v["name"] == basename && v.parent.pretty_path.include?(folder)
|
46
|
+
rescue RbVmomi::VIM::ManagedObjectNotFound
|
47
|
+
false
|
48
|
+
end
|
49
|
+
end
|
44
50
|
else
|
45
|
-
vms.find
|
51
|
+
vms.find do |v|
|
52
|
+
begin
|
53
|
+
v["name"] == name
|
54
|
+
rescue RbVmomi::VIM::ManagedObjectNotFound
|
55
|
+
false
|
56
|
+
end
|
57
|
+
end
|
46
58
|
end
|
47
|
-
end
|
48
|
-
|
59
|
+
end
|
49
60
|
end
|
50
61
|
|
51
62
|
class Mock
|
data/lib/fog/vsphere/version.rb
CHANGED
data/tests/helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-vsphere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- J.R. Garcia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|