fog-vcloud-director 0.1.5 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ec20f44fe7e72eaf434b28549b021ec6339a543
4
- data.tar.gz: 6d2f576b46b4b6dbec88d63179e04fbef82307e1
3
+ metadata.gz: 514a98d2a454438da4fe30d96a6d0cdad5c887bc
4
+ data.tar.gz: 5ce51eedb33d580d41edc21112a4173816cdc7b9
5
5
  SHA512:
6
- metadata.gz: b727d8661f9216de28e9bf3b3f55faf78fc51fa3a292f9d28874f505a32d0ab8e8e0a5723a5188eedf03283d69029a3a062072932b6e3e03557031699e8e96ef
7
- data.tar.gz: 99b56d01ca702bf9cc7bdf04eed389ae252f9973d2e8e0b76f3fdc45a3d6dab119c6671442332e94702839c8483c2ce0cd21cd9b8dafeaeb21eef907df5e3ac4
6
+ metadata.gz: 8fd4c6491d595e78692a39086e54a13d2f20e031d9f1d9b49bfaeafb11cc9505c76166c78d965bff459d65b0f5490d094a01c781b203b7886f351d9a9271a8a2
7
+ data.tar.gz: 78a26f8829d2843dbd51bb6922ef13ab66b396c28ec1e88c1c6ce722c0ab8fea0505bd14ace2e7c040ca46ccbb07ef29182ef38d7afcb3513d162944d4aa100e
@@ -380,6 +380,19 @@ module Fog
380
380
  @connection.reset
381
381
  end
382
382
 
383
+ def instantiate_template(options)
384
+ vapp_template_id = options[:template]
385
+ vapp_name = options[:stack_name]
386
+
387
+ # Remove unneeded options.
388
+ options.delete(:template)
389
+ options.delete(:stack_name)
390
+
391
+ response = instantiate_vapp_template(vapp_name, vapp_template_id, options)
392
+ process_task(response.body[:Tasks][:Task])
393
+ response.body[:href].split('/').last # returns the vapp_id if it was instantiated successfully.
394
+ end
395
+
383
396
  def request(params)
384
397
  begin
385
398
  do_request(params)
@@ -1,5 +1,6 @@
1
1
  require 'fog/core/collection'
2
2
  require 'fog/vcloud_director/models/compute/catalog'
3
+ require 'fog/vcloud_director/models/compute/catalog_item'
3
4
 
4
5
  module Fog
5
6
  module Compute
@@ -9,6 +10,13 @@ module Fog
9
10
 
10
11
  attribute :organization
11
12
 
13
+ def get_single_catalog_item(item_id)
14
+ item = service.get_catalog_item(item_id).body
15
+ return nil unless item
16
+ item[:vapp_template_id] = item[:Entity][:href].split('/').last
17
+ Fog::Compute::VcloudDirector::CatalogItem.new(item.merge({ :service => service, :collection => [] }))
18
+ end
19
+
12
20
  private
13
21
 
14
22
  def get_by_id(item_id)
@@ -19,6 +19,8 @@ module Fog
19
19
  def get_single_vapp(vapp_id)
20
20
  item = service.get_vapp(vapp_id).body
21
21
  return nil unless item
22
+ %w(:Link).each {|key_to_delete| item.delete(key_to_delete) }
23
+ service.add_id_from_href!(item)
22
24
  new(item)
23
25
  end
24
26
 
@@ -47,15 +47,15 @@ module Fog
47
47
  def generate_instantiate_vapp_template_request(options ={})
48
48
 
49
49
  #overriding some params so they work with new standardised generator
50
- options[:InstantiationParams] =
51
- {
52
- :NetworkConfig =>
53
- [{
54
- :networkName => options[:network_name],
55
- :networkHref => options[:network_uri],
56
- :fenceMode => 'bridged'
57
- }]
58
- } unless options[:InstantiationParams]
50
+ # options[:InstantiationParams] =
51
+ # {
52
+ # :NetworkConfig =>
53
+ # [{
54
+ # :networkName => options[:network_name],
55
+ # :networkHref => options[:network_uri],
56
+ # :fenceMode => 'bridged'
57
+ # }]
58
+ # } unless options[:InstantiationParams]
59
59
  options[:name] = options.delete(:vapp_name) if options[:vapp_name]
60
60
  options[:Description] = options.delete(:description) unless options[:Description]
61
61
  if options[:vms_config] then
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module VcloudDirector
3
- VERSION = "0.1.5".freeze
3
+ VERSION = "0.1.6".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-vcloud-director
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luka Zakrajšek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-17 00:00:00.000000000 Z
11
+ date: 2016-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core