diff --git a/docs/client/samples/vSphere-Automation-Client-SDK-Python-Samples-README.html b/docs/client/samples/vSphere-Automation-Client-SDK-Python-Samples-README.html index 7d2e03a6..dbf63a6f 100644 --- a/docs/client/samples/vSphere-Automation-Client-SDK-Python-Samples-README.html +++ b/docs/client/samples/vSphere-Automation-Client-SDK-Python-Samples-README.html @@ -138,28 +138,28 @@ The following table shows the sample sub-directories and their contents.
Directory | Description |
---|---|
vsphere.samples.common | Samples common classes and abstractions; This package does NOT contain any sample |
vsphere.samples.vim.helpers | Samples and utilities for accessing and manipulating VC objects using pyVmomi |
vsphere.samples.lookupservice | Service discovery sample using lookup service APIs |
vsphere.samples.vcenter | vAPI samples for managing vSphere infrastructure and virtual machines |
vsphere.samples.workflow | Various vAPI work flow samples |
vsphere.samples.inventory | Samples for inventory APIs for retrieving information about vCenter datastore and network objects. |
samples.vsphere.common | Samples common classes and abstractions; This package does NOT contain any sample |
samples.vsphere.vim.helpers | Samples and utilities for accessing and manipulating VC objects using pyVmomi |
samples.vsphere.lookupservice | Service discovery sample using lookup service APIs |
samples.vsphere.vcenter | vAPI samples for managing vSphere infrastructure and virtual machines |
samples.vsphere.workflow | Various vAPI work flow samples |
samples.vsphere.inventory | Samples for inventory APIs for retrieving information about vCenter datastore and network objects. |
-The directory vsphere.samples.vcenter contains samples for the vSphere infrastructure and virtual machine APIs. +The directory samples.vsphere.vcenter contains samples for the vSphere infrastructure and virtual machine APIs. You have two options to run samples inside this package:
$ cd /path/to/VMware-vSphere-Automation-SDK-Python-<version>/client/bin
raise MultipleManagementNodeException(MultipleManagementNodeException.format(result)) -vsphere.samples.common.lookup_service_helper.MultipleManagementNodeException: Multiple Management Node Found on server +samples.vsphere.common.lookup_service_helper.MultipleManagementNodeException: Multiple Management Node Found on server Node name: vcenter-1.example.com uuid: de2afd86-790e-11e4-9c20-0200087f55c6 Node name: vcenter-2.example.com uuid: 545da868-7910-11e4-81e1-020008e89d83diff --git a/vsphere/__init__.py b/samples/__init__.py similarity index 100% rename from vsphere/__init__.py rename to samples/__init__.py diff --git a/samples/vsphere/README.md b/samples/vsphere/README.md new file mode 100644 index 00000000..a868adfd --- /dev/null +++ b/samples/vsphere/README.md @@ -0,0 +1,14 @@ +#Client Samples + +The following table shows the sample sub-directories and their contents. + +Directory | Description +------------------------------- | ------------- +samples.vsphere.common | Samples common classes and abstractions; This package does NOT contain any sample +samples.vsphere.contentlibrary | Samples for content library APIs +samples.vsphere.inventory | Samples for inventory APIs for retrieving information about vCenter datastore and network objects. +samples.vsphere.lookupservice | Samples for lookup service APIs +samples.vsphere.tagging | Samples for tagging APIs +samples.vsphere.vcenter | Samples for managing vSphere infrastructure and virtual machines +samples.vsphere.vim | Samples and utilities for accessing and manipulating VC objects using pyVmomi +samples.vsphere.workflow | Various vAPI work flow samples (TODO) diff --git a/vsphere/samples/vcenter/__init__.py b/samples/vsphere/__init__.py similarity index 100% rename from vsphere/samples/vcenter/__init__.py rename to samples/vsphere/__init__.py diff --git a/vsphere/samples/__init__.py b/samples/vsphere/common/__init__.py similarity index 100% rename from vsphere/samples/__init__.py rename to samples/vsphere/common/__init__.py diff --git a/vsphere/samples/common/id_generator.py b/samples/vsphere/common/id_generator.py similarity index 100% rename from vsphere/samples/common/id_generator.py rename to samples/vsphere/common/id_generator.py diff --git a/vsphere/samples/common/logging_context.py b/samples/vsphere/common/logging_context.py similarity index 100% rename from vsphere/samples/common/logging_context.py rename to samples/vsphere/common/logging_context.py diff --git a/vsphere/samples/common/lookup_service_helper.py b/samples/vsphere/common/lookup_service_helper.py similarity index 99% rename from vsphere/samples/common/lookup_service_helper.py rename to samples/vsphere/common/lookup_service_helper.py index da35a9a0..3d1474b1 100644 --- a/vsphere/samples/common/lookup_service_helper.py +++ b/samples/vsphere/common/lookup_service_helper.py @@ -15,9 +15,9 @@ __copyright__ = 'Copyright 2013 VMware, Inc. All rights reserved.' import os from suds.client import Client -from vsphere.samples.common.logging_context import LoggingContext +from samples.vsphere.common.logging_context import LoggingContext -logger = LoggingContext.get_logger('vsphere.samples.common.lookup_service_helper') +logger = LoggingContext.get_logger('samples.vsphere.common.lookup_service_helper') class LookupServiceHelper(object): diff --git a/vsphere/samples/common/platform_service_controller.py b/samples/vsphere/common/platform_service_controller.py similarity index 88% rename from vsphere/samples/common/platform_service_controller.py rename to samples/vsphere/common/platform_service_controller.py index 8cbe8c49..dab61741 100644 --- a/vsphere/samples/common/platform_service_controller.py +++ b/samples/vsphere/common/platform_service_controller.py @@ -14,14 +14,14 @@ __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2013, 2016 VMware, Inc. All rights reserved.' - -from vsphere.samples.common import sso from vmware.vapi.security.sso import create_saml_bearer_security_context -from vsphere.samples.common.lookup_service_helper import LookupServiceHelper -from vsphere.samples.common.logging_context import LoggingContext -from vsphere.samples.common.ssl_helper import get_unverified_context +from samples.vsphere.common import sso +from samples.vsphere.common.logging_context import LoggingContext +from samples.vsphere.common.lookup_service_helper import LookupServiceHelper -logger = LoggingContext.get_logger('vsphere.samples.common.platform_service_controller') +from samples.common.ssl_helper import get_unverified_context + +logger = LoggingContext.get_logger('samples.vsphere.common.platform_service_controller') class PlatformServiceController(object): diff --git a/vsphere/samples/common/sample_base.py b/samples/vsphere/common/sample_base.py similarity index 95% rename from vsphere/samples/common/sample_base.py rename to samples/vsphere/common/sample_base.py index 31cd31a9..b6308536 100644 --- a/vsphere/samples/common/sample_base.py +++ b/samples/vsphere/common/sample_base.py @@ -16,9 +16,9 @@ __copyright__ = 'Copyright 2013, 2016 VMware, Inc. All rights reserved.' import argparse import traceback -from vsphere.samples.common.service_manager_factory import ServiceManagerFactory -from vsphere.samples.common.logging_context import LoggingContext -from vsphere.samples.common.sample_config import SampleConfig +from samples.vsphere.common.service_manager_factory import ServiceManagerFactory +from samples.vsphere.common.logging_context import LoggingContext +from samples.vsphere.common.sample_config import SampleConfig logger = LoggingContext.get_logger(__name__) diff --git a/vsphere/samples/common/sample_cli.py b/samples/vsphere/common/sample_cli.py similarity index 100% rename from vsphere/samples/common/sample_cli.py rename to samples/vsphere/common/sample_cli.py diff --git a/vsphere/samples/common/sample_config.py b/samples/vsphere/common/sample_config.py similarity index 100% rename from vsphere/samples/common/sample_config.py rename to samples/vsphere/common/sample_config.py diff --git a/vsphere/samples/common/sample_util.py b/samples/vsphere/common/sample_util.py similarity index 97% rename from vsphere/samples/common/sample_util.py rename to samples/vsphere/common/sample_util.py index 1bbb9ca9..40321297 100644 --- a/vsphere/samples/common/sample_util.py +++ b/samples/vsphere/common/sample_util.py @@ -13,8 +13,8 @@ from six.moves import cStringIO from vmware.vapi.bindings.struct import PrettyPrinter -from vsphere.samples.common import sample_cli -from vsphere.samples.vcenter.setup import testbed +from samples.vsphere.common import sample_cli +from samples.vsphere.vcenter.setup import testbed def pp(value): diff --git a/vsphere/samples/common/service_manager.py b/samples/vsphere/common/service_manager.py similarity index 90% rename from vsphere/samples/common/service_manager.py rename to samples/vsphere/common/service_manager.py index 9148388a..a141cc20 100644 --- a/vsphere/samples/common/service_manager.py +++ b/samples/vsphere/common/service_manager.py @@ -14,12 +14,12 @@ __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2013, 2016 VMware, Inc. All rights reserved.' from pyVim.connect import SmartConnect, Disconnect +from samples.vsphere.common import vapiconnect +from samples.vsphere.common.logging_context import LoggingContext -from vsphere.samples.common import vapiconnect -from vsphere.samples.common.logging_context import LoggingContext -from vsphere.samples.common.ssl_helper import get_unverified_context +from samples.common.ssl_helper import get_unverified_context -logger = LoggingContext.get_logger('vsphere.samples.common.service_manager') +logger = LoggingContext.get_logger('samples.vsphere.common.service_manager') class ServiceManager(object): diff --git a/vsphere/samples/common/service_manager_factory.py b/samples/vsphere/common/service_manager_factory.py similarity index 95% rename from vsphere/samples/common/service_manager_factory.py rename to samples/vsphere/common/service_manager_factory.py index 87d5420c..ad32e89c 100644 --- a/vsphere/samples/common/service_manager_factory.py +++ b/samples/vsphere/common/service_manager_factory.py @@ -13,7 +13,7 @@ __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2013, 2016 VMware, Inc. All rights reserved.' -from vsphere.samples.common.service_manager import ServiceManager +from samples.vsphere.common.service_manager import ServiceManager class ServiceManagerFactory(object): diff --git a/vsphere/samples/common/ssl_helper.py b/samples/vsphere/common/ssl_helper.py similarity index 100% rename from vsphere/samples/common/ssl_helper.py rename to samples/vsphere/common/ssl_helper.py diff --git a/vsphere/samples/common/sso.py b/samples/vsphere/common/sso.py similarity index 99% rename from vsphere/samples/common/sso.py rename to samples/vsphere/common/sso.py index 820c7fa9..cea579e1 100644 --- a/vsphere/samples/common/sso.py +++ b/samples/vsphere/common/sso.py @@ -19,14 +19,14 @@ try: import httplib except ImportError: import http.client as httplib -import re +import base64 import cgi +import hashlib +import re import sys import time -import base64 -import hashlib - from uuid import uuid4 + try: from StringIO import StringIO except ImportError: @@ -36,8 +36,6 @@ try: except ImportError: from urllib.parse import urlparse -from vsphere.samples.common.ssl_helper import get_unverified_context - # Third-party imports. from lxml import etree diff --git a/vsphere/samples/common/vapiconnect.py b/samples/vsphere/common/vapiconnect.py similarity index 100% rename from vsphere/samples/common/vapiconnect.py rename to samples/vsphere/common/vapiconnect.py diff --git a/vsphere/samples/contentlibrary/README.md b/samples/vsphere/contentlibrary/README.md similarity index 100% rename from vsphere/samples/contentlibrary/README.md rename to samples/vsphere/contentlibrary/README.md diff --git a/vsphere/samples/contentlibrary/__init__.py b/samples/vsphere/contentlibrary/__init__.py similarity index 100% rename from vsphere/samples/contentlibrary/__init__.py rename to samples/vsphere/contentlibrary/__init__.py diff --git a/vsphere/samples/contentlibrary/contentupdate/__init__.py b/samples/vsphere/contentlibrary/contentupdate/__init__.py similarity index 100% rename from vsphere/samples/contentlibrary/contentupdate/__init__.py rename to samples/vsphere/contentlibrary/contentupdate/__init__.py diff --git a/vsphere/samples/contentlibrary/contentupdate/content_update.py b/samples/vsphere/contentlibrary/contentupdate/content_update.py similarity index 95% rename from vsphere/samples/contentlibrary/contentupdate/content_update.py rename to samples/vsphere/contentlibrary/contentupdate/content_update.py index 53fea493..74c58d64 100644 --- a/vsphere/samples/contentlibrary/contentupdate/content_update.py +++ b/samples/vsphere/contentlibrary/contentupdate/content_update.py @@ -14,16 +14,16 @@ except ImportError: import urllib.request as urllib2 from com.vmware.content.library.item_client import UpdateSessionModel -from vsphere.samples.common.id_generator import generate_random_uuid -from vsphere.samples.common.logging_context import LoggingContext -from vsphere.samples.common.sample_base import SampleBase -from vsphere.samples.contentlibrary.lib.cls_api_client import ClsApiClient -from vsphere.samples.contentlibrary.lib.cls_api_helper import ClsApiHelper +from samples.vsphere.common.id_generator import generate_random_uuid +from samples.vsphere.common.logging_context import LoggingContext +from samples.vsphere.common.sample_base import SampleBase +from samples.vsphere.contentlibrary.lib.cls_api_client import ClsApiClient +from samples.vsphere.contentlibrary.lib.cls_api_helper import ClsApiHelper __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2016 VMware, Inc. All rights reserved.' -logger = LoggingContext.get_logger('vsphere.samples.contentlibrary.content_update') +logger = LoggingContext.get_logger('samples.vsphere.contentlibrary.content_update') class ContentUpdate(SampleBase): diff --git a/vsphere/samples/contentlibrary/crud/__init__.py b/samples/vsphere/contentlibrary/crud/__init__.py similarity index 100% rename from vsphere/samples/contentlibrary/crud/__init__.py rename to samples/vsphere/contentlibrary/crud/__init__.py diff --git a/vsphere/samples/contentlibrary/crud/library_crud.py b/samples/vsphere/contentlibrary/crud/library_crud.py similarity index 91% rename from vsphere/samples/contentlibrary/crud/library_crud.py rename to samples/vsphere/contentlibrary/crud/library_crud.py index 9f83f5ac..85ff04e7 100644 --- a/vsphere/samples/contentlibrary/crud/library_crud.py +++ b/samples/vsphere/contentlibrary/crud/library_crud.py @@ -16,18 +16,18 @@ from com.vmware.content_client import LibraryModel from com.vmware.content.library_client import StorageBacking -from vsphere.samples.common.id_generator import generate_random_uuid -from vsphere.samples.common.sample_base import SampleBase -from vsphere.samples.common.logging_context import LoggingContext -from vsphere.samples.contentlibrary.lib.cls_api_client import ClsApiClient -from vsphere.samples.vim.helpers.get_datastore_by_name import get_datastore_id +from samples.vsphere.common.id_generator import generate_random_uuid +from samples.vsphere.common.sample_base import SampleBase +from samples.vsphere.common.logging_context import LoggingContext +from samples.vsphere.contentlibrary.lib.cls_api_client import ClsApiClient +from samples.vsphere.vim.helpers.get_datastore_by_name import get_datastore_id __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2016 VMware, Inc. All rights reserved. -- VMware Confidential' -logger = LoggingContext.get_logger('vsphere.samples.contentlibrary') +logger = LoggingContext.get_logger('samples.vsphere.contentlibrary') class LibraryCrud(SampleBase): diff --git a/vsphere/samples/contentlibrary/isomount/__init__.py b/samples/vsphere/contentlibrary/isomount/__init__.py similarity index 100% rename from vsphere/samples/contentlibrary/isomount/__init__.py rename to samples/vsphere/contentlibrary/isomount/__init__.py diff --git a/vsphere/samples/contentlibrary/isomount/iso_mount.py b/samples/vsphere/contentlibrary/isomount/iso_mount.py similarity index 90% rename from vsphere/samples/contentlibrary/isomount/iso_mount.py rename to samples/vsphere/contentlibrary/isomount/iso_mount.py index c64fdb11..7854d56a 100644 --- a/vsphere/samples/contentlibrary/isomount/iso_mount.py +++ b/samples/vsphere/contentlibrary/isomount/iso_mount.py @@ -12,21 +12,18 @@ * NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. """ +from samples.vsphere.common.logging_context import LoggingContext +from samples.vsphere.common.sample_base import SampleBase +from samples.vsphere.contentlibrary.lib.cls_api_client import ClsApiClient +from samples.vsphere.contentlibrary.lib.cls_api_helper import ClsApiHelper -import os - -from vsphere.samples.common.sample_base import SampleBase -from vsphere.samples.common.logging_context import LoggingContext -from vsphere.samples.contentlibrary.lib.cls_api_client import ClsApiClient -from vsphere.samples.contentlibrary.lib.cls_api_helper import ClsApiHelper -from vsphere.samples.vcenter.helper.vm_helper import get_vm - +from samples.vsphere.vcenter.helper.vm_helper import get_vm __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2016 VMware, Inc. All rights reserved.' -logger = LoggingContext.get_logger('vsphere.samples.contentlibrary.iso_mount') +logger = LoggingContext.get_logger('samples.vsphere.contentlibrary.iso_mount') class IsoMount(SampleBase): diff --git a/vsphere/samples/contentlibrary/lib/__init__.py b/samples/vsphere/contentlibrary/lib/__init__.py similarity index 100% rename from vsphere/samples/contentlibrary/lib/__init__.py rename to samples/vsphere/contentlibrary/lib/__init__.py diff --git a/vsphere/samples/contentlibrary/lib/cls_api_client.py b/samples/vsphere/contentlibrary/lib/cls_api_client.py similarity index 100% rename from vsphere/samples/contentlibrary/lib/cls_api_client.py rename to samples/vsphere/contentlibrary/lib/cls_api_client.py diff --git a/vsphere/samples/contentlibrary/lib/cls_api_helper.py b/samples/vsphere/contentlibrary/lib/cls_api_helper.py similarity index 97% rename from vsphere/samples/contentlibrary/lib/cls_api_helper.py rename to samples/vsphere/contentlibrary/lib/cls_api_helper.py index 0a680a45..b1bb85b7 100644 --- a/vsphere/samples/contentlibrary/lib/cls_api_helper.py +++ b/samples/vsphere/contentlibrary/lib/cls_api_helper.py @@ -26,14 +26,14 @@ from com.vmware.content.library.item_client import (DownloadSessionModel, UpdateSessionModel) from com.vmware.content.library.item.downloadsession_client import File as DownloadSessionFile from com.vmware.content.library.item.updatesession_client import File as UpdateSessionFile -from vsphere.samples.common.id_generator import generate_random_uuid -from vsphere.samples.common.logging_context import LoggingContext -from vsphere.samples.vim.helpers.get_datastore_by_name import get_datastore_id +from samples.vsphere.common.id_generator import generate_random_uuid +from samples.vsphere.common.logging_context import LoggingContext +from samples.vsphere.vim.helpers.get_datastore_by_name import get_datastore_id __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2016 VMware, Inc. All rights reserved.' -logger = LoggingContext.get_logger('vsphere.samples.contentlibrary.lib') +logger = LoggingContext.get_logger('samples.vsphere.contentlibrary.lib') class ClsApiHelper(object): diff --git a/vsphere/samples/contentlibrary/lib/cls_sync_helper.py b/samples/vsphere/contentlibrary/lib/cls_sync_helper.py similarity index 100% rename from vsphere/samples/contentlibrary/lib/cls_sync_helper.py rename to samples/vsphere/contentlibrary/lib/cls_sync_helper.py diff --git a/vsphere/samples/contentlibrary/ovfdeploy/__init__.py b/samples/vsphere/contentlibrary/ovfdeploy/__init__.py similarity index 100% rename from vsphere/samples/contentlibrary/ovfdeploy/__init__.py rename to samples/vsphere/contentlibrary/ovfdeploy/__init__.py diff --git a/vsphere/samples/contentlibrary/ovfdeploy/deploy_ovf_template.py b/samples/vsphere/contentlibrary/ovfdeploy/deploy_ovf_template.py similarity index 93% rename from vsphere/samples/contentlibrary/ovfdeploy/deploy_ovf_template.py rename to samples/vsphere/contentlibrary/ovfdeploy/deploy_ovf_template.py index c4cae006..f979202c 100644 --- a/vsphere/samples/contentlibrary/ovfdeploy/deploy_ovf_template.py +++ b/samples/vsphere/contentlibrary/ovfdeploy/deploy_ovf_template.py @@ -22,19 +22,19 @@ from com.vmware.vcenter.ovf_client import LibraryItem from pyVmomi import vim -from vsphere.samples.common.id_generator import generate_random_uuid -from vsphere.samples.common.sample_base import SampleBase -from vsphere.samples.common.logging_context import LoggingContext -from vsphere.samples.contentlibrary.lib.cls_api_client import ClsApiClient -from vsphere.samples.contentlibrary.lib.cls_api_helper import ClsApiHelper -from vsphere.samples.vim.helpers.vim_utils import ( +from samples.vsphere.common.id_generator import generate_random_uuid +from samples.vsphere.common.sample_base import SampleBase +from samples.vsphere.common.logging_context import LoggingContext +from samples.vsphere.contentlibrary.lib.cls_api_client import ClsApiClient +from samples.vsphere.contentlibrary.lib.cls_api_helper import ClsApiHelper +from samples.vsphere.vim.helpers.vim_utils import ( get_obj, get_obj_by_moId, poweron_vm, poweroff_vm, delete_object) __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2016 VMware, Inc. All rights reserved.' -logger = LoggingContext.get_logger('vsphere.samples.contentlibrary.deploy_ovf_template') +logger = LoggingContext.get_logger('samples.vsphere.contentlibrary.deploy_ovf_template') class DeployOvfTemplate(SampleBase): diff --git a/vsphere/samples/contentlibrary/ovfimport/__init__.py b/samples/vsphere/contentlibrary/ovfimport/__init__.py similarity index 100% rename from vsphere/samples/contentlibrary/ovfimport/__init__.py rename to samples/vsphere/contentlibrary/ovfimport/__init__.py diff --git a/vsphere/samples/contentlibrary/ovfimport/ovf_import_export.py b/samples/vsphere/contentlibrary/ovfimport/ovf_import_export.py similarity index 92% rename from vsphere/samples/contentlibrary/ovfimport/ovf_import_export.py rename to samples/vsphere/contentlibrary/ovfimport/ovf_import_export.py index 0c6a7070..d8e558d0 100644 --- a/vsphere/samples/contentlibrary/ovfimport/ovf_import_export.py +++ b/samples/vsphere/contentlibrary/ovfimport/ovf_import_export.py @@ -21,19 +21,19 @@ except ImportError: from com.vmware.content_client import LibraryModel from com.vmware.content.library_client import ItemModel, StorageBacking -from vsphere.samples.common.id_generator import generate_random_uuid -from vsphere.samples.common.sample_base import SampleBase -from vsphere.samples.common.logging_context import LoggingContext -from vsphere.samples.contentlibrary.lib.cls_api_client import ClsApiClient -from vsphere.samples.contentlibrary.lib.cls_api_helper import ClsApiHelper -from vsphere.samples.vim.helpers.get_datastore_by_name import get_datastore_id +from samples.vsphere.common.id_generator import generate_random_uuid +from samples.vsphere.common.sample_base import SampleBase +from samples.vsphere.common.logging_context import LoggingContext +from samples.vsphere.contentlibrary.lib.cls_api_client import ClsApiClient +from samples.vsphere.contentlibrary.lib.cls_api_helper import ClsApiHelper +from samples.vsphere.vim.helpers.get_datastore_by_name import get_datastore_id __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2016 VMware, Inc. All rights reserved.' -logger = LoggingContext.get_logger('vsphere.samples.contentlibrary.ovef_import_export') +logger = LoggingContext.get_logger('samples.vsphere.contentlibrary.ovef_import_export') class OvfImportExport(SampleBase): diff --git a/vsphere/samples/contentlibrary/publishsubscribe/__init__.py b/samples/vsphere/contentlibrary/publishsubscribe/__init__.py similarity index 100% rename from vsphere/samples/contentlibrary/publishsubscribe/__init__.py rename to samples/vsphere/contentlibrary/publishsubscribe/__init__.py diff --git a/vsphere/samples/contentlibrary/publishsubscribe/library_publish_subscribe.py b/samples/vsphere/contentlibrary/publishsubscribe/library_publish_subscribe.py similarity index 95% rename from vsphere/samples/contentlibrary/publishsubscribe/library_publish_subscribe.py rename to samples/vsphere/contentlibrary/publishsubscribe/library_publish_subscribe.py index ebbc9ff6..c518dbe8 100644 --- a/vsphere/samples/contentlibrary/publishsubscribe/library_publish_subscribe.py +++ b/samples/vsphere/contentlibrary/publishsubscribe/library_publish_subscribe.py @@ -20,18 +20,18 @@ except ImportError: from com.vmware.content_client import LibraryModel from com.vmware.content.library_client import (ItemModel, PublishInfo, StorageBacking, SubscriptionInfo) -from vsphere.samples.common.id_generator import generate_random_uuid -from vsphere.samples.common.sample_base import SampleBase -from vsphere.samples.common.logging_context import LoggingContext -from vsphere.samples.contentlibrary.lib.cls_api_client import ClsApiClient -from vsphere.samples.contentlibrary.lib.cls_api_helper import ClsApiHelper -from vsphere.samples.contentlibrary.lib.cls_sync_helper import ClsSyncHelper +from samples.vsphere.common.id_generator import generate_random_uuid +from samples.vsphere.common.sample_base import SampleBase +from samples.vsphere.common.logging_context import LoggingContext +from samples.vsphere.contentlibrary.lib.cls_api_client import ClsApiClient +from samples.vsphere.contentlibrary.lib.cls_api_helper import ClsApiHelper +from samples.vsphere.contentlibrary.lib.cls_sync_helper import ClsSyncHelper __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2016 VMware, Inc. All rights reserved.' -logger = LoggingContext.get_logger('vsphere.samples.contentlibrary.library_publish_subscribe') +logger = LoggingContext.get_logger('samples.vsphere.contentlibrary.library_publish_subscribe') class LibraryPublishSubscribe(SampleBase): diff --git a/vsphere/samples/contentlibrary/resources/isoImages/test-2.iso b/samples/vsphere/contentlibrary/resources/isoImages/test-2.iso similarity index 100% rename from vsphere/samples/contentlibrary/resources/isoImages/test-2.iso rename to samples/vsphere/contentlibrary/resources/isoImages/test-2.iso diff --git a/vsphere/samples/contentlibrary/resources/isoImages/test.iso b/samples/vsphere/contentlibrary/resources/isoImages/test.iso similarity index 100% rename from vsphere/samples/contentlibrary/resources/isoImages/test.iso rename to samples/vsphere/contentlibrary/resources/isoImages/test.iso diff --git a/vsphere/samples/contentlibrary/resources/plainVmTemplate/plain-vm.ovf b/samples/vsphere/contentlibrary/resources/plainVmTemplate/plain-vm.ovf similarity index 100% rename from vsphere/samples/contentlibrary/resources/plainVmTemplate/plain-vm.ovf rename to samples/vsphere/contentlibrary/resources/plainVmTemplate/plain-vm.ovf diff --git a/vsphere/samples/contentlibrary/resources/plainVmTemplate/plain-vm.vmdk b/samples/vsphere/contentlibrary/resources/plainVmTemplate/plain-vm.vmdk similarity index 100% rename from vsphere/samples/contentlibrary/resources/plainVmTemplate/plain-vm.vmdk rename to samples/vsphere/contentlibrary/resources/plainVmTemplate/plain-vm.vmdk diff --git a/vsphere/samples/contentlibrary/resources/simpleVmTemplate/descriptor.ovf b/samples/vsphere/contentlibrary/resources/simpleVmTemplate/descriptor.ovf similarity index 100% rename from vsphere/samples/contentlibrary/resources/simpleVmTemplate/descriptor.ovf rename to samples/vsphere/contentlibrary/resources/simpleVmTemplate/descriptor.ovf diff --git a/vsphere/samples/contentlibrary/resources/simpleVmTemplate/disk-0.vmdk b/samples/vsphere/contentlibrary/resources/simpleVmTemplate/disk-0.vmdk similarity index 100% rename from vsphere/samples/contentlibrary/resources/simpleVmTemplate/disk-0.vmdk rename to samples/vsphere/contentlibrary/resources/simpleVmTemplate/disk-0.vmdk diff --git a/vsphere/samples/contentlibrary/vmcapture/__init__.py b/samples/vsphere/contentlibrary/vmcapture/__init__.py similarity index 100% rename from vsphere/samples/contentlibrary/vmcapture/__init__.py rename to samples/vsphere/contentlibrary/vmcapture/__init__.py diff --git a/vsphere/samples/contentlibrary/vmcapture/vm_template_capture.py b/samples/vsphere/contentlibrary/vmcapture/vm_template_capture.py similarity index 91% rename from vsphere/samples/contentlibrary/vmcapture/vm_template_capture.py rename to samples/vsphere/contentlibrary/vmcapture/vm_template_capture.py index 8e681742..49dc754d 100644 --- a/vsphere/samples/contentlibrary/vmcapture/vm_template_capture.py +++ b/samples/vsphere/contentlibrary/vmcapture/vm_template_capture.py @@ -17,17 +17,18 @@ try: except ImportError: import urllib.request as urllib2 from com.vmware.vcenter.ovf_client import LibraryItem -from vsphere.samples.common.id_generator import generate_random_uuid -from vsphere.samples.common.sample_base import SampleBase -from vsphere.samples.common.logging_context import LoggingContext -from vsphere.samples.contentlibrary.lib.cls_api_client import ClsApiClient -from vsphere.samples.contentlibrary.lib.cls_api_helper import ClsApiHelper -from vsphere.samples.vcenter.helper.vm_helper import get_vm +from samples.vsphere.common.id_generator import generate_random_uuid +from samples.vsphere.common.logging_context import LoggingContext +from samples.vsphere.common.sample_base import SampleBase +from samples.vsphere.contentlibrary.lib.cls_api_client import ClsApiClient +from samples.vsphere.contentlibrary.lib.cls_api_helper import ClsApiHelper + +from samples.vsphere.vcenter.helper.vm_helper import get_vm __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2016 VMware, Inc. All rights reserved.' -logger = LoggingContext.get_logger('vsphere.samples.contentlibrary.vm_template_capture') +logger = LoggingContext.get_logger('samples.vsphere.contentlibrary.vm_template_capture') class CaptureVMTemplateToContentLibrary(SampleBase): diff --git a/vsphere/samples/common/__init__.py b/samples/vsphere/inventory/__init__.py similarity index 100% rename from vsphere/samples/common/__init__.py rename to samples/vsphere/inventory/__init__.py diff --git a/vsphere/samples/inventory/find_cl_datastore.py b/samples/vsphere/inventory/find_cl_datastore.py similarity index 92% rename from vsphere/samples/inventory/find_cl_datastore.py rename to samples/vsphere/inventory/find_cl_datastore.py index d73cb643..6980edca 100644 --- a/vsphere/samples/inventory/find_cl_datastore.py +++ b/samples/vsphere/inventory/find_cl_datastore.py @@ -17,11 +17,11 @@ __copyright__ = 'Copyright 2014, 2016 VMware, Inc. All rights reserved.' import pyVmomi from com.vmware.content_client import Library from com.vmware.vcenter.inventory_client import Datastore -from vsphere.samples.vim.helpers.vim_utils import get_obj_by_moId -from vsphere.samples.common.sample_base import SampleBase -from vsphere.samples.common.logging_context import LoggingContext +from samples.vsphere.vim.helpers.vim_utils import get_obj_by_moId +from samples.vsphere.common.sample_base import SampleBase +from samples.vsphere.common.logging_context import LoggingContext -logger = LoggingContext.get_logger('vsphere.samples.inventory.find_cl_datastore') +logger = LoggingContext.get_logger('samples.vsphere.inventory.find_cl_datastore') class FindClDatastore(SampleBase): @@ -31,7 +31,7 @@ class FindClDatastore(SampleBase): Step 2: Find out the content library storage backing. Step 3: Find out the vCenter object from the storage ID using datastore inventory API. Note: This sample needs an existing content library on the server - (Please refer to vsphere.samples.contentlibrary.library_crud for details on how to create a content library) + (Please refer to samples.vsphere.contentlibrary.library_crud for details on how to create a content library) """ def __init__(self): SampleBase.__init__(self, self.__doc__) diff --git a/vsphere/samples/inventory/__init__.py b/samples/vsphere/lookupservice/__init__.py similarity index 100% rename from vsphere/samples/inventory/__init__.py rename to samples/vsphere/lookupservice/__init__.py diff --git a/vsphere/samples/lookupservice/print_services.py b/samples/vsphere/lookupservice/print_services.py similarity index 93% rename from vsphere/samples/lookupservice/print_services.py rename to samples/vsphere/lookupservice/print_services.py index e6fb274e..4620ec4d 100644 --- a/vsphere/samples/lookupservice/print_services.py +++ b/samples/vsphere/lookupservice/print_services.py @@ -14,11 +14,11 @@ __author__ = 'VMware, Inc.' __copyright__ = 'Copyright 2014 VMware, Inc. All rights reserved.' import argparse -from vsphere.samples.common.sample_config import SampleConfig -from vsphere.samples.common.lookup_service_helper import LookupServiceHelper -from vsphere.samples.common.logging_context import LoggingContext +from samples.vsphere.common.sample_config import SampleConfig +from samples.vsphere.common.lookup_service_helper import LookupServiceHelper +from samples.vsphere.common.logging_context import LoggingContext -logger = LoggingContext.get_logger('vsphere.samples.lookupservice.print_services') +logger = LoggingContext.get_logger('samples.vsphere.lookupservice.print_services') class PrintServices(object): diff --git a/vsphere/samples/tagging/README.md b/samples/vsphere/tagging/README.md similarity index 100% rename from vsphere/samples/tagging/README.md rename to samples/vsphere/tagging/README.md diff --git a/vsphere/samples/tagging/__init__.py b/samples/vsphere/tagging/__init__.py similarity index 100% rename from vsphere/samples/tagging/__init__.py rename to samples/vsphere/tagging/__init__.py diff --git a/vsphere/samples/tagging/tagging_workflow.py b/samples/vsphere/tagging/tagging_workflow.py similarity index 97% rename from vsphere/samples/tagging/tagging_workflow.py rename to samples/vsphere/tagging/tagging_workflow.py index 47b4d0a7..97431bbc 100644 --- a/vsphere/samples/tagging/tagging_workflow.py +++ b/samples/vsphere/tagging/tagging_workflow.py @@ -19,11 +19,11 @@ import time from com.vmware.vapi.std_client import DynamicID from com.vmware.cis.tagging_client import ( Category, CategoryModel, Tag, TagAssociation) -from vsphere.samples.vim.helpers.get_cluster_by_name import get_cluster_id -from vsphere.samples.common.sample_base import SampleBase -from vsphere.samples.common.logging_context import LoggingContext +from samples.vsphere.vim.helpers.get_cluster_by_name import get_cluster_id +from samples.vsphere.common.sample_base import SampleBase +from samples.vsphere.common.logging_context import LoggingContext -logger = LoggingContext.get_logger('vsphere.samples.workflow.tagging_workflow') +logger = LoggingContext.get_logger('samples.vsphere.workflow.tagging_workflow') class TaggingWorkflow(SampleBase): diff --git a/vsphere/samples/vcenter/vm/__init__.py b/samples/vsphere/vcenter/__init__.py similarity index 100% rename from vsphere/samples/vcenter/vm/__init__.py rename to samples/vsphere/vcenter/__init__.py diff --git a/vsphere/samples/lookupservice/__init__.py b/samples/vsphere/vcenter/helper/__init__.py similarity index 100% rename from vsphere/samples/lookupservice/__init__.py rename to samples/vsphere/vcenter/helper/__init__.py diff --git a/vsphere/samples/vcenter/helper/cluster_helper.py b/samples/vsphere/vcenter/helper/cluster_helper.py similarity index 95% rename from vsphere/samples/vcenter/helper/cluster_helper.py rename to samples/vsphere/vcenter/helper/cluster_helper.py index aa3f5236..f4b6b2ea 100644 --- a/vsphere/samples/vcenter/helper/cluster_helper.py +++ b/samples/vsphere/vcenter/helper/cluster_helper.py @@ -12,7 +12,7 @@ from com.vmware.vcenter_client import Cluster -from vsphere.samples.vcenter.helper import datacenter_helper +from samples.vsphere.vcenter.helper import datacenter_helper def get_cluster(stub_config, datacenter_name, cluster_name): diff --git a/vsphere/samples/vcenter/helper/datacenter_helper.py b/samples/vsphere/vcenter/helper/datacenter_helper.py similarity index 100% rename from vsphere/samples/vcenter/helper/datacenter_helper.py rename to samples/vsphere/vcenter/helper/datacenter_helper.py diff --git a/vsphere/samples/vcenter/helper/datastore_helper.py b/samples/vsphere/vcenter/helper/datastore_helper.py similarity index 95% rename from vsphere/samples/vcenter/helper/datastore_helper.py rename to samples/vsphere/vcenter/helper/datastore_helper.py index 1825f8f7..b4ade49c 100644 --- a/vsphere/samples/vcenter/helper/datastore_helper.py +++ b/samples/vsphere/vcenter/helper/datastore_helper.py @@ -12,7 +12,7 @@ from com.vmware.vcenter_client import Datastore -from vsphere.samples.vcenter.helper import datacenter_helper +from samples.vsphere.vcenter.helper import datacenter_helper def get_datastore(stub_config, datacenter_name, datastore_name): diff --git a/vsphere/samples/vcenter/helper/folder_helper.py b/samples/vsphere/vcenter/helper/folder_helper.py similarity index 96% rename from vsphere/samples/vcenter/helper/folder_helper.py rename to samples/vsphere/vcenter/helper/folder_helper.py index 06974f01..1a675278 100644 --- a/vsphere/samples/vcenter/helper/folder_helper.py +++ b/samples/vsphere/vcenter/helper/folder_helper.py @@ -12,7 +12,7 @@ from com.vmware.vcenter_client import Folder -from vsphere.samples.vcenter.helper import datacenter_helper +from samples.vsphere.vcenter.helper import datacenter_helper def get_folder(stub_config, datacenter_name, folder_name): diff --git a/vsphere/samples/vcenter/helper/network_helper.py b/samples/vsphere/vcenter/helper/network_helper.py similarity index 98% rename from vsphere/samples/vcenter/helper/network_helper.py rename to samples/vsphere/vcenter/helper/network_helper.py index 553feb90..0fd7b7d4 100644 --- a/vsphere/samples/vcenter/helper/network_helper.py +++ b/samples/vsphere/vcenter/helper/network_helper.py @@ -12,7 +12,7 @@ from com.vmware.vcenter_client import Network -from vsphere.samples.vcenter.helper import datacenter_helper +from samples.vsphere.vcenter.helper import datacenter_helper def get_standard_network_backing(stub_config, diff --git a/vsphere/samples/vcenter/helper/resource_pool_helper.py b/samples/vsphere/vcenter/helper/resource_pool_helper.py similarity index 95% rename from vsphere/samples/vcenter/helper/resource_pool_helper.py rename to samples/vsphere/vcenter/helper/resource_pool_helper.py index ef653b85..9481be72 100644 --- a/vsphere/samples/vcenter/helper/resource_pool_helper.py +++ b/samples/vsphere/vcenter/helper/resource_pool_helper.py @@ -12,7 +12,7 @@ from com.vmware.vcenter_client import ResourcePool -from vsphere.samples.vcenter.helper import datacenter_helper +from samples.vsphere.vcenter.helper import datacenter_helper def get_resource_pool(stub_config, datacenter_name): diff --git a/vsphere/samples/vcenter/helper/vm_helper.py b/samples/vsphere/vcenter/helper/vm_helper.py similarity index 100% rename from vsphere/samples/vcenter/helper/vm_helper.py rename to samples/vsphere/vcenter/helper/vm_helper.py diff --git a/vsphere/samples/vcenter/helper/vm_placement_helper.py b/samples/vsphere/vcenter/helper/vm_placement_helper.py similarity index 91% rename from vsphere/samples/vcenter/helper/vm_placement_helper.py rename to samples/vsphere/vcenter/helper/vm_placement_helper.py index 77fb1e9c..d6a9b4dc 100644 --- a/vsphere/samples/vcenter/helper/vm_placement_helper.py +++ b/samples/vsphere/vcenter/helper/vm_placement_helper.py @@ -12,9 +12,9 @@ from com.vmware.vcenter_client import VM -from vsphere.samples.vcenter.helper import datastore_helper -from vsphere.samples.vcenter.helper import folder_helper -from vsphere.samples.vcenter.helper import resource_pool_helper +from samples.vsphere.vcenter.helper import datastore_helper +from samples.vsphere.vcenter.helper import folder_helper +from samples.vsphere.vcenter.helper import resource_pool_helper def get_placement_spec_for_resource_pool(stub_config, diff --git a/vsphere/samples/vcenter/setup/README.md b/samples/vsphere/vcenter/setup/README.md similarity index 100% rename from vsphere/samples/vcenter/setup/README.md rename to samples/vsphere/vcenter/setup/README.md diff --git a/vsphere/samples/vcenter/helper/__init__.py b/samples/vsphere/vcenter/setup/__init__.py similarity index 100% rename from vsphere/samples/vcenter/helper/__init__.py rename to samples/vsphere/vcenter/setup/__init__.py diff --git a/vsphere/samples/vcenter/setup/backend_directory.py b/samples/vsphere/vcenter/setup/backend_directory.py similarity index 98% rename from vsphere/samples/vcenter/setup/backend_directory.py rename to samples/vsphere/vcenter/setup/backend_directory.py index 262d0725..117b571c 100644 --- a/vsphere/samples/vcenter/setup/backend_directory.py +++ b/samples/vsphere/vcenter/setup/backend_directory.py @@ -10,7 +10,7 @@ * NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. """ -from vsphere.samples.vim.file import (detect_directory, +from samples.vsphere.vim.file import (detect_directory, create_directory, delete_directory) diff --git a/vsphere/samples/vcenter/setup/cluster.py b/samples/vsphere/vcenter/setup/cluster.py similarity index 98% rename from vsphere/samples/vcenter/setup/cluster.py rename to samples/vsphere/vcenter/setup/cluster.py index b7b98c17..033d2604 100644 --- a/vsphere/samples/vcenter/setup/cluster.py +++ b/samples/vsphere/vcenter/setup/cluster.py @@ -14,7 +14,7 @@ import pyVim.task from com.vmware.vcenter_client import Cluster from pyVmomi import vim -from vsphere.samples.vcenter.helper import cluster_helper +from samples.vsphere.vcenter.helper import cluster_helper def detect_cluster(context): diff --git a/vsphere/samples/vcenter/setup/datacenter.py b/samples/vsphere/vcenter/setup/datacenter.py similarity index 100% rename from vsphere/samples/vcenter/setup/datacenter.py rename to samples/vsphere/vcenter/setup/datacenter.py diff --git a/vsphere/samples/vcenter/setup/datastore.py b/samples/vsphere/vcenter/setup/datastore.py similarity index 100% rename from vsphere/samples/vcenter/setup/datastore.py rename to samples/vsphere/vcenter/setup/datastore.py diff --git a/vsphere/samples/vcenter/setup/floppy_image.py b/samples/vsphere/vcenter/setup/floppy_image.py similarity index 93% rename from vsphere/samples/vcenter/setup/floppy_image.py rename to samples/vsphere/vcenter/setup/floppy_image.py index c67bf585..1fd721f6 100644 --- a/vsphere/samples/vcenter/setup/floppy_image.py +++ b/samples/vsphere/vcenter/setup/floppy_image.py @@ -10,10 +10,10 @@ * NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. """ -from vsphere.samples.vim import datastore_file -from vsphere.samples.vim.file import (detect_file, delete_file, +from samples.vsphere.vim import datastore_file +from samples.vsphere.vim.file import (detect_file, delete_file, parse_datastore_path) -from vsphere.samples.vim.inventory import get_datastore_mo +from samples.vsphere.vim.inventory import get_datastore_mo def setup_floppy_image(context): diff --git a/vsphere/samples/vcenter/setup/folder.py b/samples/vsphere/vcenter/setup/folder.py similarity index 98% rename from vsphere/samples/vcenter/setup/folder.py rename to samples/vsphere/vcenter/setup/folder.py index 7bdfa655..dbe563c3 100644 --- a/vsphere/samples/vcenter/setup/folder.py +++ b/samples/vsphere/vcenter/setup/folder.py @@ -14,7 +14,7 @@ import pyVim.task from com.vmware.vcenter_client import (Folder) from pyVmomi import vim -from vsphere.samples.vcenter.helper import datacenter_helper +from samples.vsphere.vcenter.helper import datacenter_helper def detect_vm_folder(context, datacenter_name, folder_name): diff --git a/vsphere/samples/vcenter/setup/host.py b/samples/vsphere/vcenter/setup/host.py similarity index 100% rename from vsphere/samples/vcenter/setup/host.py rename to samples/vsphere/vcenter/setup/host.py diff --git a/vsphere/samples/vcenter/setup/iso_image.py b/samples/vsphere/vcenter/setup/iso_image.py similarity index 93% rename from vsphere/samples/vcenter/setup/iso_image.py rename to samples/vsphere/vcenter/setup/iso_image.py index 901da7f4..d63c93c4 100644 --- a/vsphere/samples/vcenter/setup/iso_image.py +++ b/samples/vsphere/vcenter/setup/iso_image.py @@ -10,10 +10,10 @@ * NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. """ -from vsphere.samples.vim import datastore_file -from vsphere.samples.vim.file import (detect_file, delete_file, +from samples.vsphere.vim import datastore_file +from samples.vsphere.vim.file import (detect_file, delete_file, parse_datastore_path) -from vsphere.samples.vim.inventory import get_datastore_mo +from samples.vsphere.vim.inventory import get_datastore_mo def setup_iso_image(context): diff --git a/vsphere/samples/vcenter/setup/main.py b/samples/vsphere/vcenter/setup/main.py similarity index 85% rename from vsphere/samples/vcenter/setup/main.py rename to samples/vsphere/vcenter/setup/main.py index b8f174cd..9d20a1b4 100644 --- a/vsphere/samples/vcenter/setup/main.py +++ b/samples/vsphere/vcenter/setup/main.py @@ -18,17 +18,17 @@ Script that runs through all the setup and samples. """ import pyVim.connect +from samples.vsphere.common import sample_util +from samples.vsphere.common import vapiconnect +from samples.vsphere.vcenter.setup import testbed +from samples.vsphere.vcenter.setup.setup_cli import build_arg_parser +from samples.vsphere.vcenter.setup.testbed_setup import cleanup as testbed_cleanup +from samples.vsphere.vcenter.setup.testbed_setup import setup as testbed_setup +from samples.vsphere.vcenter.setup.testbed_setup import validate as testbed_validate +from samples.vsphere.vcenter.vm.main import cleanup as sample_cleanup +from samples.vsphere.vcenter.vm.main import run as sample_run -from vsphere.samples.common import sample_util -from vsphere.samples.common import vapiconnect -from vsphere.samples.common.ssl_helper import get_unverified_context -from vsphere.samples.vcenter.setup import testbed -from vsphere.samples.vcenter.setup.setup_cli import build_arg_parser -from vsphere.samples.vcenter.setup.testbed_setup import cleanup as testbed_cleanup -from vsphere.samples.vcenter.setup.testbed_setup import setup as testbed_setup -from vsphere.samples.vcenter.setup.testbed_setup import validate as testbed_validate -from vsphere.samples.vcenter.vm.main import cleanup as sample_cleanup -from vsphere.samples.vcenter.vm.main import run as sample_run +from samples.common.ssl_helper import get_unverified_context # Parse command line params for setup script diff --git a/vsphere/samples/vcenter/setup/network.py b/samples/vsphere/vcenter/setup/network.py similarity index 100% rename from vsphere/samples/vcenter/setup/network.py rename to samples/vsphere/vcenter/setup/network.py diff --git a/vsphere/samples/vcenter/setup/setup_cli.py b/samples/vsphere/vcenter/setup/setup_cli.py similarity index 100% rename from vsphere/samples/vcenter/setup/setup_cli.py rename to samples/vsphere/vcenter/setup/setup_cli.py diff --git a/vsphere/samples/vcenter/setup/testbed.py b/samples/vsphere/vcenter/setup/testbed.py similarity index 100% rename from vsphere/samples/vcenter/setup/testbed.py rename to samples/vsphere/vcenter/setup/testbed.py diff --git a/vsphere/samples/vcenter/setup/testbed_setup.py b/samples/vsphere/vcenter/setup/testbed_setup.py similarity index 85% rename from vsphere/samples/vcenter/setup/testbed_setup.py rename to samples/vsphere/vcenter/setup/testbed_setup.py index 014a52aa..3a9843fb 100644 --- a/vsphere/samples/vcenter/setup/testbed_setup.py +++ b/samples/vsphere/vcenter/setup/testbed_setup.py @@ -10,15 +10,15 @@ * NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. """ -import vsphere.samples.vcenter.setup.backend_directory as backend_directory -import vsphere.samples.vcenter.setup.cluster as cluster -import vsphere.samples.vcenter.setup.datacenter as datacenter -import vsphere.samples.vcenter.setup.datastore as datastore -import vsphere.samples.vcenter.setup.floppy_image as floppy_image -import vsphere.samples.vcenter.setup.folder as folder -import vsphere.samples.vcenter.setup.host as host -import vsphere.samples.vcenter.setup.iso_image as iso_image -import vsphere.samples.vcenter.setup.network as network +import samples.vsphere.vcenter.setup.backend_directory as backend_directory +import samples.vsphere.vcenter.setup.cluster as cluster +import samples.vsphere.vcenter.setup.datacenter as datacenter +import samples.vsphere.vcenter.setup.datastore as datastore +import samples.vsphere.vcenter.setup.floppy_image as floppy_image +import samples.vsphere.vcenter.setup.folder as folder +import samples.vsphere.vcenter.setup.host as host +import samples.vsphere.vcenter.setup.iso_image as iso_image +import samples.vsphere.vcenter.setup.network as network """ Setup Simple Testbed: Which provides the prerequisites for using the VM API diff --git a/vsphere/samples/vcenter/vm/README.md b/samples/vsphere/vcenter/vm/README.md similarity index 94% rename from vsphere/samples/vcenter/vm/README.md rename to samples/vsphere/vcenter/vm/README.md index b0843015..d1a74e0c 100644 --- a/vsphere/samples/vcenter/vm/README.md +++ b/samples/vsphere/vcenter/vm/README.md @@ -25,14 +25,14 @@ This directory contains samples for vCenter virtual machine APIs: You have two options to run samples inside this package: 1. Run the whole sample suite which contains all vcenter samples using main.py - in vsphere.samples.vcenter.setup package. + in samples.vsphere.vcenter.setup package. Please see the README in the setup package for detailed steps. 2. Run an individual sample in an existing environment. You can either pass the testbed settings through command line arguments or specify them in setup.py in the setup package. - For example, to run the create_default_vm sample in the vsphere.samples.vcenter.vm.create package: + For example, to run the create_default_vm sample in the samples.vsphere.vcenter.vm.create package: * $ cd /path/to/VMware-vSphere-Automation-SDK-Python-