本文整理汇总了Python中marvin.lib.base.VpcOffering.create方法的典型用法代码示例。如果您正苦于以下问题:Python VpcOffering.create方法的具体用法?Python VpcOffering.create怎么用?Python VpcOffering.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marvin.lib.base.VpcOffering
的用法示例。
在下文中一共展示了VpcOffering.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_02_create_vpc_from_offering_with_regionlevelvpc_service_capability
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def test_02_create_vpc_from_offering_with_regionlevelvpc_service_capability(self):
""" Test create VPC offering
"""
# Steps for validation
# 1. Create VPC Offering by specifying all supported Services
# 2. VPC offering should be created successfully.
if not self.isOvsPluginEnabled:
self.skipTest("OVS plugin should be enabled to run this test case")
self.debug("Creating inter VPC offering")
vpc_off = VpcOffering.create(
self.apiclient,
self.services["vpc_offering"]
)
vpc_off.update(self.apiclient, state='Enabled')
vpc = VPC.create(
self.apiclient,
self.services["vpc"],
vpcofferingid=vpc_off.id,
zoneid=self.zone.id,
account=self.account.name,
domainid=self.account.domainid,
networkDomain=self.account.domainid
)
self.assertEqual(vpc.distributedvpcrouter, True, "VPC created should have 'distributedvpcrouter' set to True")
try:
vpc.delete(self.apiclient)
except Exception as e:
self.fail("Failed to delete VPC network - %s" % e)
return
示例2: setUpClass
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def setUpClass(cls):
cls.testClient = super(TestVPC, cls).getClsTestClient()
cls.api_client = cls.testClient.getApiClient()
cls.hypervisor = cls.testClient.getHypervisorInfo()
cls.mgtSvrDetails = cls.config.__dict__["mgtSvr"][0].__dict__
cls.unsupportedHypervisor = False
if cls.hypervisor.lower() == 'hyperv':
cls._cleanup = []
cls.unsupportedHypervisor = True
return
cls.services = Services().services
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client)
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
cls.template = get_template(
cls.api_client,
cls.zone.id,
cls.services["ostype"]
)
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
cls.services["virtual_machine"]["template"] = cls.template.id
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offering"]
)
cls.vpc_off = VpcOffering.create(
cls.api_client,
cls.services["vpc_offering"]
)
cls.vpc_off.update(cls.api_client, state='Enabled')
cls._cleanup = [
cls.service_offering,
]
return
示例3: test_04_vpc_private_gateway_with_invalid_lswitch
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def test_04_vpc_private_gateway_with_invalid_lswitch(self):
self.logger.debug('Adding NSX device')
self.add_nicira_device(self.nicira_master_controller)
self.logger.debug('Creating VPC offering')
self.vpc_offering = VpcOffering.create(self.api_client, self.vpc_offering_services)
self.vpc_offering.update(self.api_client, state='Enabled')
self.test_cleanup.append(self.vpc_offering)
self.logger.debug('Creating VPC tier offering')
self.vpc_tier_offering = NetworkOffering.create(self.api_client, self.vpc_tier_offering_services, conservemode=False)
self.vpc_tier_offering.update(self.api_client, state='Enabled')
self.test_cleanup.append(self.vpc_tier_offering)
self.logger.debug('Creating private network offering')
self.private_network_offering = NetworkOffering.create(self.api_client, self.private_network_offering_services)
self.private_network_offering.update(self.api_client, state='Enabled')
self.test_cleanup.append(self.private_network_offering)
allow_all_acl_id = 'bd6d44f8-fc11-11e5-8fe8-5254001daa61'
bad_lswitch = 'lswitch:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
vpc = self.create_vpc()
network = self.create_vpc_tier(vpc)
virtual_machine = self.create_virtual_machine(network)
self.logger.debug('Creating private gateway')
with self.assertRaises(CloudstackAPIException) as cm:
self.create_private_gateway(vpc, "10.0.3.99", "10.0.3.100", allow_all_acl_id, bad_lswitch)
the_exception = cm.exception
the_message_matcher = "^.*Refusing to design this network because the specified lswitch (%s) does not exist.*$" % bad_lswitch
self.assertRegexpMatches(str(the_exception), the_message_matcher)
示例4: setUp
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def setUp(self):
self.routers = []
self.networks = []
self.ips = []
self.apiclient = self.testClient.getApiClient()
self.hypervisor = self.testClient.getHypervisorInfo()
self.account = Account.create(
self.apiclient,
self.services["account"],
admin=True,
domainid=self.domain.id)
self.logger.debug("Creating a VPC offering..")
self.vpc_off = VpcOffering.create(
self.apiclient,
self.services["vpc_offering"])
self.logger.debug("Enabling the VPC offering created")
self.vpc_off.update(self.apiclient, state='Enabled')
self.logger.debug("Creating a VPC network in the account: %s" % self.account.name)
self.services["vpc"]["cidr"] = '10.1.1.1/16'
self.vpc = VPC.create(
self.apiclient,
self.services["vpc"],
vpcofferingid=self.vpc_off.id,
zoneid=self.zone.id,
account=self.account.name,
domainid=self.account.domainid)
self.cleanup = [self.vpc, self.vpc_off, self.account]
return
示例5: setUpClass
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def setUpClass(cls):
cls.testClient = super(TestVPCRoutersBasic, cls).getClsTestClient()
cls.api_client = cls.testClient.getApiClient()
cls.hypervisor = cls.testClient.getHypervisorInfo()
cls.vpcSupported = True
cls._cleanup = []
if cls.hypervisor.lower() == 'hyperv':
cls.vpcSupported = False
return
cls.services = Services().services
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client)
cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
cls.template = get_template(
cls.api_client,
cls.zone.id,
cls.services["ostype"]
)
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
cls.services["virtual_machine"]["template"] = cls.template.id
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offering"]
)
cls.vpc_off = VpcOffering.create(
cls.api_client,
cls.services["vpc_offering"]
)
cls.vpc_off.update(cls.api_client, state='Enabled')
cls.account = Account.create(
cls.api_client,
cls.services["account"],
admin=True,
domainid=cls.domain.id
)
cls._cleanup = [cls.account]
cls._cleanup.append(cls.vpc_off)
#cls.debug("Enabling the VPC offering created")
cls.vpc_off.update(cls.api_client, state='Enabled')
# cls.debug("creating a VPC network in the account: %s" %
# cls.account.name)
cls.services["vpc"]["cidr"] = '10.1.1.1/16'
cls.vpc = VPC.create(
cls.api_client,
cls.services["vpc"],
vpcofferingid=cls.vpc_off.id,
zoneid=cls.zone.id,
account=cls.account.name,
domainid=cls.account.domainid
)
cls._cleanup.append(cls.service_offering)
return
示例6: create_VpcOffering
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def create_VpcOffering(cls, vpc_offering, suffix=None):
cls.debug("Creating VPC offering")
if suffix:
vpc_offering["name"] = "VPC_OFF-" + str(suffix)
vpc_off = VpcOffering.create(cls.api_client,
vpc_offering
)
# Enable VPC offering
vpc_off.update(cls.api_client, state="Enabled")
cls.debug("Created and Enabled VPC offering")
return vpc_off
示例7: create_VpcOffering
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def create_VpcOffering(self, vpc_offering, suffix=None):
self.debug("Creating VPC offering")
if suffix:
vpc_offering["name"] = "VPC_OFF-" + str(suffix)
vpc_off = VpcOffering.create(self.api_client,
vpc_offering
)
# Enable VPC offering
vpc_off.update(self.api_client, state="Enabled")
self.cleanup.append(vpc_off)
self.debug("Created and Enabled VPC offering")
return vpc_off
示例8: test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80(self):
"""
Test create, assign, remove of an Internal LB with roundrobin http traffic to 3 vm's in a Redundant VPC
"""
self.logger.debug("Starting test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80")
self.logger.debug("Creating a Redundant VPC offering..")
redundant_vpc_offering = VpcOffering.create(self.apiclient, self.services["redundant_vpc_offering"])
self.logger.debug("Enabling the Redundant VPC offering created")
redundant_vpc_offering.update(self.apiclient, state="Enabled")
self.cleanup.insert(0, redundant_vpc_offering)
self.execute_internallb_roundrobin_tests(redundant_vpc_offering)
示例9: _create_vpc_offering
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def _create_vpc_offering(self, offering_name):
vpc_off = None
if offering_name is not None:
self.logger.debug("Creating VPC offering: %s", offering_name)
vpc_off = VpcOffering.create(
self.apiclient,
self.services[offering_name]
)
self._validate_vpc_offering(vpc_off)
return vpc_off
示例10: test_01_create_vpc_offering_with_distributedrouter_service_capability
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def test_01_create_vpc_offering_with_distributedrouter_service_capability(self):
""" Test create VPC offering
"""
# Steps for validation
# 1. Create VPC Offering by specifying all supported Services
# 2. VPC offering should be created successfully.
self.debug("Creating inter VPC offering")
vpc_off = VpcOffering.create(self.apiclient, self.services["vpc_offering"])
self.debug("Check if the VPC offering is created successfully?")
self.cleanup.append(vpc_off)
self.validate_vpc_offering(vpc_off)
return
示例11: setUpClass
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def setUpClass(cls):
try:
cls._cleanup = []
cls.testClient = super(TestPortForwardingRules, cls).getClsTestClient()
cls.api_client = cls.testClient.getApiClient()
cls.services = cls.testClient.getParsedTestDataConfig()
cls.hypervisor = cls.testClient.getHypervisorInfo()
# Get Domain, Zone, Template
cls.domain = get_domain(cls.api_client)
cls.zone = get_zone(
cls.api_client,
cls.testClient.getZoneForTests())
cls.template = get_template(
cls.api_client,
cls.zone.id,
cls.services["ostype"]
)
if cls.zone.localstorageenabled:
cls.storagetype = 'local'
cls.services["service_offerings"][
"tiny"]["storagetype"] = 'local'
else:
cls.storagetype = 'shared'
cls.services["service_offerings"][
"tiny"]["storagetype"] = 'shared'
cls.services['mode'] = cls.zone.networktype
cls.services["virtual_machine"][
"hypervisor"] = cls.hypervisor
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
cls.services["virtual_machine"]["template"] = cls.template.id
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offerings"]["tiny"]
)
cls._cleanup.append(cls.service_offering)
cls.services['mode'] = cls.zone.networktype
cls.vpc_offering = VpcOffering.create(cls.api_client,
cls.services["vpc_offering"]
)
cls.vpc_offering.update(cls.api_client, state='Enabled')
cls._cleanup.append(cls.vpc_offering)
except Exception as e:
cls.tearDownClass()
raise Exception("Warning: Exception in setup : %s" % e)
return
示例12: test_04_rvpc_internallb_haproxy_stats_on_all_interfaces
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def test_04_rvpc_internallb_haproxy_stats_on_all_interfaces(self):
""" Test to verify access to loadbalancer haproxy admin stats page
when global setting network.loadbalancer.haproxy.stats.visibility is set to 'all'
with credentials from global setting network.loadbalancer.haproxy.stats.auth
using the uri from global setting network.loadbalancer.haproxy.stats.uri.
It uses a Redundant Routers VPC
"""
self.logger.debug("Starting test_04_rvpc_internallb_haproxy_stats_on_all_interfaces")
self.logger.debug("Creating a Redundant VPC offering..")
redundant_vpc_offering = VpcOffering.create(self.apiclient, self.services["redundant_vpc_offering"])
self.logger.debug("Enabling the Redundant VPC offering created")
redundant_vpc_offering.update(self.apiclient, state="Enabled")
self.execute_internallb_haproxy_tests(redundant_vpc_offering)
示例13: setUp
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def setUp(self):
self.logger.debug("Creating a VPC offering.")
self.vpc_off = VpcOffering.create(self.apiclient, self.services["vpc_offering"])
self.logger.debug("Enabling the VPC offering created")
self.vpc_off.update(self.apiclient, state="Enabled")
self.logger.debug("Creating a VPC network in the account: %s" % self.account.name)
self.vpc = VPC.create(
self.apiclient,
self.services["vpc"],
vpcofferingid=self.vpc_off.id,
zoneid=self.zone.id,
account=self.account.name,
domainid=self.account.domainid,
)
return
示例14: setUp
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def setUp(self):
self.hypervisor = self.testClient.getHypervisorInfo()
self.logger.debug("Creating a VPC offering.")
self.vpc_off = VpcOffering.create(self.apiclient, self.services["vpc_offering"])
self.logger.debug("Enabling the VPC offering created")
self.vpc_off.update(self.apiclient, state="Enabled")
self.logger.debug("Creating a VPC network in the account: %s" % self.account.name)
self.vpc = VPC.create(
self.apiclient,
self.services["vpc"],
vpcofferingid=self.vpc_off.id,
zoneid=self.zone.id,
account=self.account.name,
domainid=self.account.domainid,
)
self.cleanup = [self.vpc, self.vpc_off]
self.entity_manager.set_cleanup(self.cleanup)
return
示例15: create_vpc
# 需要导入模块: from marvin.lib.base import VpcOffering [as 别名]
# 或者: from marvin.lib.base.VpcOffering import create [as 别名]
def create_vpc(self, cidr='10.1.2.1/16'):
self.debug("Creating a VPC offering..")
self.services["vpc_offering"]["name"] = self.services["vpc_offering"]["name"] + str(cidr)
vpc_off = VpcOffering.create(
self.apiclient,
self.services["vpc_offering"]
)
self._cleanup.append(vpc_off)
self.debug("Enabling the VPC offering created")
vpc_off.update(self.apiclient, state='Enabled')
self.debug("Creating a VPC network in the account: %s" % self.account.name)
self.services["vpc"]["cidr"] = cidr
vpc = VPC.create(
self.apiclient,
self.services["vpc"],
vpcofferingid=vpc_off.id,
zoneid=self.zone.id,
account=self.account.name,
domainid=self.account.domainid
)
return vpc