Class: Azure::VirtualNetworkManagement::VirtualNetworkManagementService

Inherits:
BaseManagement::BaseManagementService show all
Defined in:
lib/azure/virtual_network_management/virtual_network_management_service.rb

Overview

VirtualNetworkManagementService

Instance Method Summary collapse

Methods inherited from BaseManagement::BaseManagementService

#create_affinity_group, #delete_affinity_group, #get_affinity_group, #list_affinity_groups, #list_locations, #list_role_sizes, #update_affinity_group, #validate_configuration

Constructor Details

#initializeVirtualNetworkManagementService

Returns a new instance of VirtualNetworkManagementService.



21
22
23
# File 'lib/azure/virtual_network_management/virtual_network_management_service.rb', line 21

def initialize
  super()
end

Instance Method Details

#list_virtual_networksObject

Public: Gets a list of virtual network services available under the current subscription.

See msdn.microsoft.com/en-us/library/azure/jj157185.aspx

Returns an array of Azure::VirtualNetworkServiceManagement::VirtualNetwork objects



32
33
34
35
36
37
# File 'lib/azure/virtual_network_management/virtual_network_management_service.rb', line 32

def list_virtual_networks
  request_path = '/services/networking/virtualnetwork'
  request = BaseManagement::ManagementHttpRequest.new(:get, request_path, nil)
  response = request.call
  Serialization.virtual_network_from_xml(response)
end

#set_network_configuration(*args) ⇒ Object



39
40
41
42
43
44
45
46
47
48
# File 'lib/azure/virtual_network_management/virtual_network_management_service.rb', line 39

def set_network_configuration(*args)
  if args.length == 1
    set_virtual_network_using_xml(args[0])
  elsif args.length == 4 || args.length == 3
    args[3] ||= { subnet: [], dns: [] }
    set_virtual_network(args[0], args[1], args[2], args[3])
  else
    raise 'Wrong number of arguments'
  end
end