Skip to content

Instantly share code, notes, and snippets.

View chelnak's full-sized avatar
👀
What's cooking?

Craig Gumbley chelnak

👀
What's cooking?
View GitHub Profile
var endpoint = "com.vmware.vcac.core.cafe.reservation.api";
var restClient = vCACCAFEHost.createRestClient(endpoint);
System.log(restClient.getUrl());
var resourceUrl = "reservations";
var response = restClient.get(resourceUrl);
//return type is vCACCAFEServiceResponse
var body = response.getBodyAsJson();
@chelnak
chelnak / networkProfile-Description.json
Created October 16, 2015 07:53
networkProfile-Description
{
"@type": "ExternalNetworkProfile",
"id": "7fc00c02-ece0-44ef-9376-edb6e04778b1",
"name": "CG-External-Profile",
"description": "",
"createdDate": "2015-10-16T06:48:56.000Z",
"lastModifiedDate": "2015-10-16T06:49:05.000Z",
"isHidden": false,
"definedRanges": [
{
### Keybase proof
I hereby claim:
* I am chelnak on github.
* I am craiggumbley (https://keybase.io/craiggumbley) on keybase.
* I have a public key whose fingerprint is 3A9D 572C FB5A 4DE0 DE61 6134 548D 2C03 3029 0698
To claim this, I am signing this object:
@chelnak
chelnak / CancelWorkflowTokens.ps1
Created February 24, 2016 15:30
Example of interacting with the control center action "Cancel all tokens of a workflow" in vRO
<#
Cancel all tokens of a workflow or a list of specific workflow tokens
Example body
{
"tokenIds" : [],
"workflowId" : "f75459b7-128d-4ff0-ad99-b9d454307eeb"
@chelnak
chelnak / Get-LatestGithubRelease.ps1
Last active January 25, 2021 23:32
Download the latest zip ball release of a github project
# --- Set the uri for the latest release
$URI = "https://api.github.com/repos/chelnak/vRAAPIClient/releases/latest"
# --- Query the API to get the url of the zip
$Response = Invoke-RestMethod -Method Get -Uri $URI
$ZipUrl = $Response.zipball_url
# --- Download the file to the current location
$OutputPath = "$((Get-Location).Path)\$($Response.name.Replace(" ","_")).zip"
Invoke-RestMethod -Method Get -Uri $ZipUrl -OutFile $OutputPath
@chelnak
chelnak / getResourcesProvisionedByRequest.js
Last active March 7, 2016 15:03
Get catalog item resources provisioned from a vRA request
/*
Name: getResourcesProvisionedByRequest
Input: vCACCAFEHost - vCACCAFE:VCACHost
Input: requestId - String
Output: void
Description: Get catalog item resources provisioned from a request
*/
var _requestId = "bc147f2c-1995-442b-8fc9-c769ec9bf9f4";
/*
Name: getvCACVirtualMachineSnapshots
Input: vCACHost - vCAC:VCACHost
Input: vCACVirtualMachine - vCAC:VirtualMachine
Output: Array/Properties
Description: Get snapshot information for a vCAC virtual machine
*/
//Get snapshot entities from the virtual machine
var properties = new Properties();
/*
Name: getLinkProperties
Input: vCACHost - vCAC:VCACHost
Input: vCACVirtualMachine - vCAC:VirtualMachine
Description: List the properties for a vCAC entity object link
*/
//Set the name of the link here:
var linkName = "VMDiskHardware";
@chelnak
chelnak / Create a vCloud Air reservation.ps1
Last active September 27, 2016 15:34
Creating reservations with PowervRA - This gist contains examples for creating vSphere and vCloud Air reservations
# --- Create a vCloud Air Reservation
# --- Get the compute resource id
$ComputeResource = Get-vRAReservationComputeResource -Type "vCloud Air" -Name "uk-slough-1-6 - VDC1 (vCloud Air)"
# --- Get the network definition
$NetworkDefinitionArray = @()
$Network1 = New-vRAReservationNetworkDefinition -Type "vCloud Air" -ComputeResourceId $ComputeResource.Id -NetworkPath "isolated-network"
$NetworkDefinitionArray += $Network1
@chelnak
chelnak / PowervRA-RequestBuilder.ps1
Created June 27, 2016 08:17
Example script to demonstrate how to submit multiple vRA catalog item requests with PowervRA from a predefined list. The example submits each request as a seperate PSJob. The status of each job can be monitored via the vRA web console and by using Get-Job.
<#
Example script to demonstrate how to submit multiple vRA catalog item requests
from a predefined list.
The example submits each request as a seperate PSJob. The status of each job can be
monitored via the vRA web console and by using Get-Job.
#>