本文整理汇总了Python中pyvcloud.vcd.org.Org.add_catalog_access_settings方法的典型用法代码示例。如果您正苦于以下问题:Python Org.add_catalog_access_settings方法的具体用法?Python Org.add_catalog_access_settings怎么用?Python Org.add_catalog_access_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.vcd.org.Org
的用法示例。
在下文中一共展示了Org.add_catalog_access_settings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add
# 需要导入模块: from pyvcloud.vcd.org import Org [as 别名]
# 或者: from pyvcloud.vcd.org.Org import add_catalog_access_settings [as 别名]
def add(ctx, catalog_name, access_list):
try:
restore_session(ctx)
client = ctx.obj['client']
in_use_org_href = ctx.obj['profiles'].get('org_href')
org = Org(client, in_use_org_href)
org.add_catalog_access_settings(
catalog_name=catalog_name,
access_settings_list=acl_str_to_list_of_dict(access_list))
stdout('Access settings added to catalog \'%s\'.' % catalog_name, ctx)
except Exception as e:
stderr(e, ctx)
示例2: test_04_add_catalog_access
# 需要导入模块: from pyvcloud.vcd.org import Org [as 别名]
# 或者: from pyvcloud.vcd.org.Org import add_catalog_access_settings [as 别名]
def test_04_add_catalog_access(self):
org_in_use = self.client.get_org_by_name(
self.config['vcd']['org_in_use'])
org = Org(self.client, resource=org_in_use)
control_access = org.add_catalog_access_settings(
self.config['vcd']['catalog'],
access_settings_list=[
{'name': self.config['vcd']['access_user1'], 'type': 'user',
'access_level': 'ReadOnly'},
{'name': self.config['vcd']['access_user'], 'type': 'user',
'access_level':'Change'},
{'name': self.config['vcd']['access_org'], 'type': 'org',
'access_level': 'ReadOnly'}
])
assert len(control_access.AccessSettings.AccessSetting) == 3