The Invoke-RubrikRESTCall allows users to make raw API endpoint calls to the Rubrik REST interface. The user will need to manage the format of both the endpoint call(including resource ids) and body, but provides the option to make cmdlet independent API calls for automating Rubrik actions through PowerShell. The Rubrik API reference is found on the Rubrik device at: \/docs/v1 \/docs/v1/playground
EXAMPLES
EXAMPLE 1
Invoke-RubrikRESTCall -Endpoint 'vmware/vm' -Method GET
Retrieve the raw output for all VMWare VMs being managed by the Rubrik device.
EXAMPLE 2
Invoke-RubrikRESTCall -Endpoint 'vmware/vm' -Method GET -Query @{'name'='msf-sql2016'}
Retrieve the raw output for the VMWare VM msf-sql2016 using a query parameter.
Invoke-RubrikRESTCall -Endpoint 'fileset_template/bulk' -Method POST -Body $body -BodyAsArray
Creates a new fileset from the given fileset template and the given host id supporting Direct Archive. Since fileset_template/bulk expects an array, we force the single item array with the BodyAsArray parameter.
EXAMPLE 5
Invoke-RubrikRESTCall -Endpoint 'fileset_template/bulk' -Method POST -Body '{"isPassthrough":true,"shareId":"HostShare:::11111","templateId":"FilesetTemplate:::22222"}' -BodyAsJson
Creates a new fileset from the given fileset template and the given host id supporting Direct Archive. Since fileset_template/bulk expects an array, we force the single item array with the BodyAsArray parameter.
EXAMPLE 6
Invoke-RubrikRESTCall -api internal -Endpoint nutanix/cluster/NutanixCluster:::d34d42c0-5468-4c37-a3cf-4376baf018e4/refresh -Method post
Refreshes the information of the Nutanix cluster
EXAMPLE 7
Invoke-RubrikRESTCall -api internal -Endpoint nutanix/cluster/NutanixCluster:::d34d42c0-5468-4c37-a3cf-4376baf018e4/refresh -Method post -Verbose -WhatIf
Displays Verbose information while not executing the query
Gather all information directly from the endpoint without having to specify any header details or authentication. Get is implicitly assumed unless explicitly specified.
Gather all information directly from the endpoint to gather request data without having to specify any header details or authentication. Get is implicitly assumed unless explicitly specified.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
NOTES
Written by Matt Altimar & Mike Fal for community usage Twitter: @Mike_Fal GitHub: mikefal