vmonkey 0.10.0.pre → 0.11.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
  SHA1:
3
- metadata.gz: 94b84d944625a3fed4f778d798d14127bcc3db46
4
- data.tar.gz: cdbab5dd79c3121c4f7ad7cf8afa55a3ededac79
3
+ metadata.gz: 151ce3a9f5e0fd86c90160eeaeaeb86beb1c1ed2
4
+ data.tar.gz: 76482a7d3c1ae75380e5a142e92f022b8e5b6fb2
5
5
  SHA512:
6
- metadata.gz: 545a13b97d6e3fd513a086f7aa83838df1bc69078bc37eadcdf4dd3bac599294bddce0079950d79820596e0d02cecdf28656ebf46b0baec3ab89f8b2a33878e1
7
- data.tar.gz: dc88378c152a0423314177d553402004baf9d72ca119fde9437aeb62fbe91aa103d0b02de1ae84b8399b2e46d1d624a13a243c226d2ddb2e3c95777dbf0e5dce
6
+ metadata.gz: f6f5c3793741a9b35673d528f5ebbedf5f4deb1bbb6c6aebfb06a0756c77401dc1ee1bdde6dcf0580715e3b7b56cc68f4e147fc619bffa5731823173b8476528
7
+ data.tar.gz: afd7fa870b0a69de22aa4f84479740ae75f7dd71fab238656ef0e96182fb3206068316a2b034ae98c5becb6f641ce0a05b9845c543f650ab70398c624b57a4c4
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # VMonkey
2
2
 
3
- VMonkey is a cheeky little feller who wants so very badly to make interacintg with vSphere more enjoyable. Let VMonkey fetch your VMs, clone your templates, set your properties, and more. VMonkey tinkers around in the uglier parts of the vSphere API so you don't have to. Enjoy!
3
+ VMonkey is a cheeky little feller who wants so very badly to make interacting with vSphere more enjoyable. Let VMonkey fetch your VMs, clone your templates, set your properties, and more. VMonkey tinkers around in the uglier parts of the vSphere API so you don't have to. Enjoy!
4
4
 
5
5
  ## Installation
6
6
 
@@ -69,7 +69,7 @@ vm.annotation
69
69
  vm.annotation = 'VMonkey is hot'
70
70
 
71
71
  vm.move_to '/path/to/some_folder/clone_name' # moves the VM or raises if the destination exists
72
- vm.move_to! '/path/to/some_folder/clone_name' # moves the VM, overwrting the detinsation VM if necessary
72
+ vm.move_to! '/path/to/some_folder/clone_name' # moves the VM, overwriting the destination VM if necessary
73
73
 
74
74
  vm.clone_to '/path/to/some_folder/clone_name' # clones the VM to a Folder
75
75
  vm.clone_to '/path/to/some_vapp/clone_name' # clones the VM to a VirtualApp
@@ -1,3 +1,3 @@
1
1
  module Vmonkey
2
- VERSION = '0.10.0.pre'
2
+ VERSION = '0.11.0'
3
3
  end
@@ -17,4 +17,12 @@ class RbVmomi::VIM::Folder
17
17
  x if x.is_a? type
18
18
  end
19
19
 
20
+ def templates
21
+ self.childEntity.grep(RbVmomi::VIM::VirtualMachine).select { |v| v.config && v.config.template }
22
+ end
23
+
24
+ def vms
25
+ self.childEntity.grep(RbVmomi::VIM::VirtualMachine).select { |v| v.config.nil? || (v.config && !v.config.template) }
26
+ end
27
+
20
28
  end
@@ -37,6 +37,16 @@ module RbVmomi
37
37
  vm(path) || raise("VirtualMachine not found. [#{path}]")
38
38
  end
39
39
 
40
+ def template(path)
41
+ t = vm path
42
+ return t if t && t.config && t.config.template
43
+ return nil
44
+ end
45
+
46
+ def template!(path)
47
+ template(path) || raise("Template not found. [#{path}]")
48
+ end
49
+
40
50
  def vm_by_uuid(uuid)
41
51
  dc.vmFolder.findByUuid uuid, RbVmomi::VIM::VirtualMachine, dc
42
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmonkey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0.pre
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dupras
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-03 00:00:00.000000000 Z
12
+ date: 2015-01-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -29,73 +29,73 @@ dependencies:
29
29
  name: rbvmomi
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ~>
33
33
  - !ruby/object:Gem::Version
34
34
  version: '1.5'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ~>
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.5'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: bundler
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ~>
47
47
  - !ruby/object:Gem::Version
48
48
  version: '1.6'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ~>
54
54
  - !ruby/object:Gem::Version
55
55
  version: '1.6'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rake
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ">="
60
+ - - '>='
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ">="
67
+ - - '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - "~>"
74
+ - - ~>
75
75
  - !ruby/object:Gem::Version
76
76
  version: '2.14'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - "~>"
81
+ - - ~>
82
82
  - !ruby/object:Gem::Version
83
83
  version: '2.14'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: rspec-its
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ">="
88
+ - - '>='
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ">="
95
+ - - '>='
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
- description: " simple to use vsphere methods "
98
+ description: ' simple to use vsphere methods '
99
99
  email:
100
100
  - brian@duprasville.com
101
101
  - dsmith@rallydev.com
@@ -103,7 +103,7 @@ executables: []
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
- - ".gitignore"
106
+ - .gitignore
107
107
  - CHANGELOG.md
108
108
  - Gemfile
109
109
  - LICENSE.txt
@@ -137,17 +137,17 @@ require_paths:
137
137
  - lib
138
138
  required_ruby_version: !ruby/object:Gem::Requirement
139
139
  requirements:
140
- - - ">="
140
+ - - '>='
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0'
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ">"
145
+ - - '>='
146
146
  - !ruby/object:Gem::Version
147
- version: 1.3.1
147
+ version: '0'
148
148
  requirements: []
149
149
  rubyforge_project:
150
- rubygems_version: 2.2.2
150
+ rubygems_version: 2.0.14
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: simple to use vsphere methods