本文整理汇总了Python中pyvcloud.vcd.vapp.VApp.remove_access_settings方法的典型用法代码示例。如果您正苦于以下问题:Python VApp.remove_access_settings方法的具体用法?Python VApp.remove_access_settings怎么用?Python VApp.remove_access_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.vcd.vapp.VApp
的用法示例。
在下文中一共展示了VApp.remove_access_settings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_1001_remove_all_vapp_access
# 需要导入模块: from pyvcloud.vcd.vapp import VApp [as 别名]
# 或者: from pyvcloud.vcd.vapp.VApp import remove_access_settings [as 别名]
def test_1001_remove_all_vapp_access(self):
logged_in_org = self.client.get_org()
org = Org(self.client, resource=logged_in_org)
vdc_resource = org.get_vdc(self.config['vcd']['vdc'])
vdc = VDC(self.client, resource=vdc_resource)
vapp_resource = vdc.get_vapp(self.config['vcd']['vapp'])
vapp = VApp(self.client, resource=vapp_resource)
control_access = vapp.remove_access_settings(remove_all=True)
self.assertFalse(hasattr(control_access, 'AccessSettings'))
示例2: remove
# 需要导入模块: from pyvcloud.vcd.vapp import VApp [as 别名]
# 或者: from pyvcloud.vcd.vapp.VApp import remove_access_settings [as 别名]
def remove(ctx, vapp_name, access_list, all):
try:
if all:
click.confirm(
'Do you want to remove all access settings from the vapp '
'\'%s\'' % vapp_name,
abort=True)
restore_session(ctx, vdc_required=True)
client = ctx.obj['client']
vdc_href = ctx.obj['profiles'].get('vdc_href')
vdc = VDC(client, href=vdc_href)
vapp = VApp(client, resource=vdc.get_vapp(vapp_name))
vapp.remove_access_settings(
access_settings_list=acl_str_to_list_of_dict(access_list),
remove_all=all)
stdout('Access settings removed from vapp \'%s\'.' % vapp_name, ctx)
except Exception as e:
stderr(e, ctx)
示例3: test_1004_remove_vapp_access
# 需要导入模块: from pyvcloud.vcd.vapp import VApp [as 别名]
# 或者: from pyvcloud.vcd.vapp.VApp import remove_access_settings [as 别名]
def test_1004_remove_vapp_access(self):
logged_in_org = self.client.get_org()
org = Org(self.client, resource=logged_in_org)
vdc_resource = org.get_vdc(self.config['vcd']['vdc'])
vdc = VDC(self.client, resource=vdc_resource)
vapp_resource = vdc.get_vapp(self.config['vcd']['vapp'])
vapp = VApp(self.client, resource=vapp_resource)
control_access = vapp.remove_access_settings(
access_settings_list=[
{'name': self.config['vcd']['access_user'], 'type': 'user'}
])
assert len(control_access.AccessSettings.AccessSetting) == 1