< Back

Invoke-VCAVQuery

Sat Jan 18, 2020 9:53 pm

NAME Invoke-VCAVQuery



SYNOPSIS

Query the vCloud Availability (VCAV) API





SYNTAX

Invoke-VCAVQuery [[-Uri] <String>] [[-QueryPath] <String>] [[-Method] {Default | Get | Head | Post | Put | Delete

| Trace | Options | Merge | Patch}] [[-Headers] <Hashtable>] [[-Filter] <Hashtable>] [[-ContentType] <String>]

[[-Body] <String>] [<CommonParameters>]





DESCRIPTION

Invoke-VCAVQuery queries the vCloud Availability API for the specified resource

which is returned as a PSCustomObject. Parameters can be specified to limit

the returned results by a filter (see Examples).





PARAMETERS

-Uri <String>

An optional parameter containing the absolute URI to be queried, note that if

this parameter is used the -QueryPath and -Filter parameters are ignored.



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-QueryPath <String>

An optional parameter containing the API resource to retrieve.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Method

An optional parameter containing the HTML method to use in the query

(default='Get' if not specified)



Required? false

Position? 3

Default value Get

Accept pipeline input? false

Accept wildcard characters? false



-Headers <Hashtable>

An optional parameter containing any additional HTML headers to pass to the API

note that the 'X-VCAV-Auth' token is populated automatically based on existing

sessions to the API and the 'Accept' token is automatically set to the value

'application/vnd.vmware.h4-v3+json;charset=UTF-8' if not specified. This is

appropriate for the majority of VCAV API queries.



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Filter <Hashtable>

An optional parameter to restrict the results returned by encoding additional

filters in the query Uri. See https://code.vmware.com/apis/441/vcav for

details of the valid filter parameters for each method call.



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ContentType <String>

An optional parameter specifying the HTML ContentType of the submitted API

request, generally this should only be specified for requests which send data

to the API using the -Body parameter.



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Body <String>

An optional parameter specifying the JSON document to be submitted to the VCAV

API, generally this will also require setting the -ContentType parameter.



Required? false

Position? 7

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

A PSCustomObject containing the resources from the API call or an error.





NOTES





For queries which can return a large number of results (>100 typically) use

the Invoke-VCAVPagedQuery cmdlet to ensure that all results are retrieved.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get a list of VCAV organizations:



Invoke-VCAVQuery -QueryPath 'inventory/orgs'









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Retrieve a list of VCAV sites:



Invoke-VCAVQuery -QueryPath 'sites'









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Retrieve the current connection details for this VCAV session:



Invoke-VCAVQuery -QueryPath 'sessions'











RELATED LINKS