vsphere-schema
vsphere-schema
is a collection of vSphere API schemas in JSON format along with a few methods to navigate the schema. Versions 2.5
- 6.0
are currently included. All data has been scraped from VMware
provided documentation and compiled using vsphere-doc-scrape
.
Format
vSphere Objects are stored in the following format. Objects with circular references have those references replaced with a "[Circular]"
<Version>
{Object}
- API version, keyed on the version string 2.5
- 6.0
<Type Name>
type
{string}
- Name of the type- [
inherits
]{string}
- The name of the type that this Type inherits from properties
{Object}
- Hash of properties and their types- [
<Property Name>
]{Object | string}
- Either an XML data type string or a Type object
- [
methods
{Object}
- Hash of methods- [
<Method Name>
]{Object}
- Method object- [
deprecated
]{string | boolean}
- Name of the replacement method or if true completely removed params
{Object} - Parameter hash<Param Name>
{Object}
- Parameter objectrequired
{boolean}
- If the parameter is requiredtype
{string}
- Type name
returns
{string | none}
- Type returned by the method
- [
- [
API
version
)
.getSchema(A simple method to get a specific schema
Parameters
version
{string}
- API version2.5
-6.0
Returns
{Object}
- The schema object
version
, type
, method
)
.hasMethod(Check if a method exists
Parameters
version
{string}
- API version2.5
-6.0
type
{string}
- Type namemethod
{string}
- Method name
Returns
{boolean}
- Whether the method exists
version
, type
, property
)
.hasProperty(Check if a property exists
Parameters
version
{string}
- API version2.5
-6.0
type
{string}
- Type nameproperty
{string}
- Property name
Returns
{boolean}
- Whether the property exists
version
, type
, property
)
.getProperty(Get a property
Parameters
version
{string}
- API version2.5
-6.0
type
{string}
- Type nameproperty
{string}
- Property name
Returns
{*}
- The property
version
)
.getEventTypes(Gets the names of all Types ending with Event
Parameters
version
{string}
- API version2.5
-6.0
Returns
{string[]}
- Event Type names
Examples
var vschema = ; // access version 4.1var v41 = vschema'4.1'console; // or using the getSchema method get version 5.0var v50 = vschema;console; // check if a property existsvar pExists = vschema;// pExists = true // get a specific propertyvar prop = vschema; // check if a method existsvar mExists = vschema;// mExists = false