A client to work with the JSON protocol generally contains the following parts, at minimum.
- The basic elements of the URL, including the address of the vCenter Server instance, the service endpoint specifier, and the version specifier.
- The credentials with which you authenticate your client session.
- Code to GET managed object properties, such as the
ServiceInstance
content, which contains managed object references to singletons, including theSessionManager
. - Code to POST requests that invoke methods on managed objects, such as
LoginByToken
. - A request to fetch the
ServiceInstance
content and extract theSessionManager
managed object reference. - A request to authenticate the client session with
SessionManager
. - A request to end the client session.
Following sections use fragments of Python code to show how you can build these parts of the request.