当前位置: 首页>>代码示例>>Python>>正文


Python Org.get_catalog_resource方法代码示例

本文整理汇总了Python中pyvcloud.vcd.org.Org.get_catalog_resource方法的典型用法代码示例。如果您正苦于以下问题:Python Org.get_catalog_resource方法的具体用法?Python Org.get_catalog_resource怎么用?Python Org.get_catalog_resource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyvcloud.vcd.org.Org的用法示例。


在下文中一共展示了Org.get_catalog_resource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_02_change_catalog_owner

# 需要导入模块: from pyvcloud.vcd.org import Org [as 别名]
# 或者: from pyvcloud.vcd.org.Org import get_catalog_resource [as 别名]
 def test_02_change_catalog_owner(self):
     logged_in_org = self.client.get_org()
     org = Org(self.client, resource=logged_in_org)
     org.change_catalog_owner(self.config['vcd']['catalog'],
                              self.config['vcd']['new_catalog_owner'])
     catalog_resource = org.get_catalog_resource(
         self.config['vcd']['catalog'], True)
     assert self.config['vcd']['new_catalog_owner'] \
            == catalog_resource.Owner.User.get('name')
开发者ID:rdbwebster,项目名称:pyvcloud,代码行数:11,代码来源:vcd_catalog.py

示例2: _fill_in_netpool_default

# 需要导入模块: from pyvcloud.vcd.org import Org [as 别名]
# 或者: from pyvcloud.vcd.org.Org import get_catalog_resource [as 别名]
    _fill_in_netpool_default(client, vdc_kwargs)
    # Now create the VDC.  
    admin_vdc_resource = org.create_org_vdc(**vdc_kwargs)
    # The 'admin_vdc_resource' is not a task but an AdminVdc entity.  Tasks
    # are two levels down.
    handle_task(client, admin_vdc_resource.Tasks.Task[0])
    org.reload()
    vdc_resource = org.get_vdc(cfg.vdc['vdc_name'])
    vdc = VDC(client, resource=vdc_resource)
    print("VDC now exists: {0}".format(vdc.name))

# Ensure the catalog exists.  For now we don't do anything special with
# permissions.  As with VDC's we reload the org if we create a catalog
# so that it's visible in future calls.
try:
    catalog_resource = org.get_catalog_resource(cfg.catalog['name'])
    print("Catalog already exists: {0}".format(cfg.catalog['name']))
except Exception:
    print("Catalog does not exist, creating: {0}".format(cfg.catalog['name']))
    catalog_kwargs = cfg.catalog
    catalog_resource = org.create_catalog(**catalog_kwargs)
    org.reload()
    print("Catalog now exists: {0}".format(catalog_resource.get('name')))

# Check for catalog_items containing OVF templates in the catalog and
# upload them if they are missing.
for catalog_item in cfg.catalog_items:
    try:
        catalog_item_resource = org.get_catalog_item(
            catalog_item['catalog_name'], catalog_item['item_name'])
        print("Catalog item exists: {0}".format(catalog_item['item_name']))
开发者ID:vmware,项目名称:pyvcloud,代码行数:33,代码来源:tenant-onboard.py


注:本文中的pyvcloud.vcd.org.Org.get_catalog_resource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。