Пример #1
0
 def create_networkConfigSection(network_name, network_href, fence_mode):
     parentNetwork = vcloudType.ReferenceType(href=network_href)
     configuration = vcloudType.NetworkConfigurationType()
     configuration.set_ParentNetwork(parentNetwork)
     configuration.set_FenceMode(fence_mode)
     networkConfig = vcloudType.VAppNetworkConfigurationType()
     networkConfig.set_networkName(network_name)
     networkConfig.set_Configuration(configuration)
     info = vcloudType.Msg_Type()
     info.set_valueOf_("Configuration parameters for logical networks")
     networkConfigSection = vcloudType.NetworkConfigSectionType()
     networkConfigSection.add_NetworkConfig(networkConfig)
     networkConfigSection.set_Info(info)
     return networkConfigSection
Пример #2
0
 def create_networkConfigSection(network_name, network_href, fence_mode, prev_network_config_section=None):
     parentNetwork = vcloudType.ReferenceType(href=network_href, name=network_name)
     configuration = vcloudType.NetworkConfigurationType()
     configuration.set_ParentNetwork(parentNetwork)
     configuration.set_FenceMode(fence_mode)
     networkConfig = vcloudType.VAppNetworkConfigurationType()
     networkConfig.set_networkName(network_name)
     networkConfig.set_Configuration(configuration)
     info = vcloudType.Msg_Type()
     info.set_valueOf_("Configuration parameters for logical networks")
     networkConfigSection = None
     if prev_network_config_section is None:
         networkConfigSection = vcloudType.NetworkConfigSectionType()
     else:
         networkConfigSection = prev_network_config_section
     networkConfigSection.add_NetworkConfig(networkConfig)
     networkConfigSection.set_Info(vAppType.cimString(valueOf_="Network config"))
     return networkConfigSection