Skip to content

Commit 63dbb27

Browse files
author
Tianhao He
committed
New sample to demonstrates the VMTX push sync workflow to publish and subscribe VMTX items
1 parent 1e26c68 commit 63dbb27

File tree

3 files changed

+433
-2
lines changed

3 files changed

+433
-2
lines changed

samples/vsphere/contentlibrary/lib/cls_api_client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
* *******************************************************
3-
* Copyright VMware, Inc. 2016-2018. All Rights Reserved.
3+
* Copyright VMware, Inc. 2016-2019. All Rights Reserved.
44
* SPDX-License-Identifier: MIT
55
* *******************************************************
66
*
@@ -17,7 +17,7 @@
1717
from com.vmware.content_client import (Library,
1818
LocalLibrary,
1919
SubscribedLibrary)
20-
from com.vmware.content.library_client import Item, SubscribedItem
20+
from com.vmware.content.library_client import Item, SubscribedItem, Subscriptions
2121
from com.vmware.content.library.item_client import DownloadSession
2222
from com.vmware.content.library.item_client import UpdateSession
2323
from com.vmware.content.library.item.downloadsession_client import File as DownloadSessionFile
@@ -77,6 +77,9 @@ def __init__(self, service_manager):
7777
# machine templates
7878
self.vmtx_service = VmtxLibraryItem(self.service_manager.stub_config)
7979

80+
# ####
81+
self.subscriptions = Subscriptions(self.service_manager.stub_config)
82+
8083
# Creates the service that communicates with virtual machines
8184
self.vm_service = VM(self.service_manager.stub_config)
8285
# TODO: Add the other CLS services, eg. storage, config, type
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""
2+
* *******************************************************
3+
* Copyright VMware, Inc. 2019. All Rights Reserved.
4+
* SPDX-License-Identifier: MIT
5+
* *******************************************************
6+
*
7+
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
8+
* WARRANTIES OR CONDITIONS OF ANY KIND, WHETHER ORAL OR WRITTEN,
9+
* EXPRESS OR IMPLIED. THE AUTHOR SPECIFICALLY DISCLAIMS ANY IMPLIED
10+
* WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY,
11+
* NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
12+
"""
13+
14+
15+
__author__ = 'VMware, Inc.'
16+
17+
18+
# Required to distribute different parts of this
19+
# package as multiple distribution
20+
try:
21+
import pkg_resources
22+
pkg_resources.declare_namespace(__name__)
23+
except ImportError:
24+
from pkgutil import extend_path
25+
__path__ = extend_path(__path__, __name__) # @ReservedAssignment

0 commit comments

Comments
 (0)