diff --git a/samples/vsphere/sso/README.md b/samples/vsphere/sso/README.md index 271089db..1d5aae48 100644 --- a/samples/vsphere/sso/README.md +++ b/samples/vsphere/sso/README.md @@ -1,9 +1,14 @@ This directory contains samples for Platform Service Controller, SSO and Lookup Service APIs: +The vSphere Automation SDK for Python samples use the vSphere Automation Lookup Service +to obtain the URLs for other vSphere Automation services (SSO, vAPI, VIM, SPBM, etc.). +The SDK contains the Lookup Service WSDL files. The samples use the python SUDS client +for accessing the lookup service. The Lookup Service WSDL files are located in wsdl/ directory. + Running the samples * $ cd /path/to/vsphere-automation-sdk-python-samples/bin - * $ ./run_sample.sh ../samples/vsphere/tagging/tagging_workflow.py --server --username --password --clustername --categoryname --categorydesc --tagname -tagdesc -v + * $ ./run_sample.sh ../samples/vsphere/sso/print_services.py --lswsdlurl file:///path/to/vsphere-automation-sdk-python-samples/samples/vsphere/sso/wsdl/lookupservice.wsdl --lssoapurl https:///lookupservice/sdk -v * Testbed Requirement: - 1 vCenter Server diff --git a/samples/vsphere/sso/print_services.py b/samples/vsphere/sso/print_services.py index 17aac42b..68cb054c 100644 --- a/samples/vsphere/sso/print_services.py +++ b/samples/vsphere/sso/print_services.py @@ -32,8 +32,13 @@ class PrintServices(object): def options(self): self.argparser = argparse.ArgumentParser(description=self.__doc__) # setup the argument parser - self.argparser.add_argument('-lswsdlurl', '--lswsdlurl', help='Lookup service WSDL URL') - self.argparser.add_argument('-lssoapurl', '--lssoapurl', help='Lookup service SOAP URL') + self.argparser.add_argument('-w', '--lswsdlurl', + help='Lookup service WSDL URL') + self.argparser.add_argument('-s', '--lssoapurl', + help='Lookup service SOAP URL') + self.argparser.add_argument('-v', '--skipverification', + action='store_true', + help='Do not verify server certificate') self.args = self.argparser.parse_args() # parse all the sample arguments when they are all set def setup(self): @@ -45,9 +50,13 @@ class PrintServices(object): assert self.lssoapurl is not None print('lssoapurl: {0}'.format(self.lssoapurl)) + self.skip_verification = self.args.skipverification + def execute(self): print('Connecting to lookup service url: {0}'.format(self.lssoapurl)) - lookupservicehelper = LookupServiceHelper(wsdl_url=self.lswsdlurl, soap_url=self.lssoapurl) + lookupservicehelper = LookupServiceHelper(wsdl_url=self.lswsdlurl, + soap_url=self.lssoapurl, + skip_verification=self.skip_verification) lookupservicehelper.connect() # print the PSC nodes and SSO service endpoint URLs