1
0
mirror of https://github.com/vmware/vsphere-automation-sdk-python.git synced 2024-11-24 18:30:00 -05:00
vsphere-automation-sdk-python/samples/vsphere/vcenter/discovery_and_plan
anushah 582006c9b8 Adding new bindings and samples for vSphere 7.0
Signed-Off-By: Anusha Hegde <anushah@vmware.com>
2020-04-10 08:46:41 +05:30
..
__init__.py Adding new bindings and samples for vSphere 7.0 2020-04-10 08:46:41 +05:30
discovery_sample.py Adding new bindings and samples for vSphere 7.0 2020-04-10 08:46:41 +05:30
lcm_sample.py Adding new bindings and samples for vSphere 7.0 2020-04-10 08:46:41 +05:30
README.md Adding new bindings and samples for vSphere 7.0 2020-04-10 08:46:41 +05:30
update_sample.py Adding new bindings and samples for vSphere 7.0 2020-04-10 08:46:41 +05:30

This directory contains samples for the Discovery and Plan APIs. Discovery and Plan is a new feature for the VCSA. VMware Discovery and Plan solution consists of vSphere, vSAN, esx, drivers frimware, 2nd party products (NSX, VRA, ETC) and 3rd party products. Though it's a tightly integrated software stack, it's complex process to patch software for Clusters, including ESXi hosts and vCenter.

For more information, please review the official release notes.

Discovery and Plan having the followings APIs: * Discovery: Provides the user options to choose from, to add VMware products manually * Report: To download the report generated by the interop, precheck, etc operations. * Update client: Listing all available updates and upgrades for the products installed in the user( at the Moment we only do it for ESX and vCenter). Later on the user can select one of the patches available and can plan an actual patch or upgrade for the selected version.

Overview of the directory code samples:

* discovery_sample.py - running a simple workflow to discover the products . It's having below APIs.
GET https://{server}/lcm/rest/vcenter/lcm/discovery/product-catalog
GET https://{server}/lcm/rest/vcenter/lcm/discovery/associated-products
POST https://{server}/lcm/rest/vcenter/lcm/discovery/associated-products. Create spec as below.
CreateSpec {
   /**
    * The name of the product.
    */
    String productName;

   /**
    * Current product version.
    */
    String version;

   /**
    * The list of hostname/IPs of the instances of the VMware products
    * deployed in the customer environment.
    */
    Optional<List<String>> deployments;
}
GET https://{server}/lcm/rest/vcenter/lcm/discovery/associated-products/{product-id}
PATCH https://{server}/lcm/rest/vcenter/lcm/discovery/associated-products/{product-id}. Update spec as below.
UpdateSpec {
    /**
     * The list of hostname/IPs of the instances of the VMware products
     * deployed in the customer environment.
     */
    Optional<List<String>> deployments;

}
DELETE https://{server}/lcm/rest/vcenter/lcm/discovery/associated-products/{product-id}
* lcm_sample.py - running a simple workflow to download report.
GET https://{server}/lcm/rest/vcenter/lcm/reports/{report}
* update_sample.py - running a simple workflow to find updates and upgrades
GET https://{server}/lcm/rest/vcenter/lcm/update/pending
GET https://{server}/lcm/rest/vcenter/lcm/update/pending/{version}
POST https://{server}/rest/vcenter/lcm/update/pending/{version}/pre-upgrade-checks

To view the available command-line options:

 $ python discovery_sample.py --help
 $ python lcm_sample.py --help
 $ python update_sample.py --help

Running the samples:

$ python discovery_sample.py --server <vCenter Server IP> --username <username> --password <password> --skipverification
$ python lcm_sample.py --server <vCenter Server IP> --username <username> --password <password> --skipverification
$ python update_sample.py --server <vCenter Server IP> --username <username> --password <password> --skipverification

Testbed Requirement:

* 1 vCenter Server appliance version 7.0 or above are supported.