本文整理汇总了Python中cloudmesh_client.cloud.iaas.CloudProvider.CloudProvider.delete_secgroup方法的典型用法代码示例。如果您正苦于以下问题:Python CloudProvider.delete_secgroup方法的具体用法?Python CloudProvider.delete_secgroup怎么用?Python CloudProvider.delete_secgroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cloudmesh_client.cloud.iaas.CloudProvider.CloudProvider
的用法示例。
在下文中一共展示了CloudProvider.delete_secgroup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delete
# 需要导入模块: from cloudmesh_client.cloud.iaas.CloudProvider import CloudProvider [as 别名]
# 或者: from cloudmesh_client.cloud.iaas.CloudProvider.CloudProvider import delete_secgroup [as 别名]
def delete(cls,
category='general',
group=None,
name=None):
# name is anme of the rule
if category=='general':
if name is None and group is not None:
# delete the entire group
cls.cm.delete(kind="secgrouprule", group=group)
elif name is not None and group is not None:
# delete specific rule
cls.cm.delete(name=name, kind="secgrouprule", group=group)
elif name is None and group is None:
# delete all groups
cls.cm.delete(kind="secgrouprule")
if group == Default.secgroup or Default.secgroup is None:
cls.reset_defaults()
else:
provider = CloudProvider(category).provider
# delete on cloud
if group is not None:
provider.delete_secgroup(name)
# delete the entire group
elif group is None:
# delete all groups
pass
示例2: delete_secgroup
# 需要导入模块: from cloudmesh_client.cloud.iaas.CloudProvider import CloudProvider [as 别名]
# 或者: from cloudmesh_client.cloud.iaas.CloudProvider.CloudProvider import delete_secgroup [as 别名]
def delete_secgroup(cls, name=None, cloud=None):
try:
# Find the secgroup from the cloud
cloud_provider = CloudProvider(cloud).provider
result = cloud_provider.delete_secgroup(name)
return result
except Exception as ex:
Console.error("delete group")
示例3: delete_secgroup
# 需要导入模块: from cloudmesh_client.cloud.iaas.CloudProvider import CloudProvider [as 别名]
# 或者: from cloudmesh_client.cloud.iaas.CloudProvider.CloudProvider import delete_secgroup [as 别名]
def delete_secgroup(cls, label, cloud):
try:
# Find the secgroup from the cloud
cloud_provider = CloudProvider(cloud).provider
result = cloud_provider.delete_secgroup(label)
return result
except Exception as ex:
Console.error(ex.message, ex)
示例4: delete_group_cloud
# 需要导入模块: from cloudmesh_client.cloud.iaas.CloudProvider import CloudProvider [as 别名]
# 或者: from cloudmesh_client.cloud.iaas.CloudProvider.CloudProvider import delete_secgroup [as 别名]
def delete_group_cloud(cls, cloud, groupname):
provider = CloudProvider(cloud).provider
return provider.delete_secgroup(groupname)