Whenever I create databases with information like ESXi Versions, vCenter Versions or VMware's HCL I try make these available to be used for automation or in scripts. JSON is my data-type of choice but I figured that another structure might be easier to handle in some circumstances. This is why I've now created separate versions where it is now possible to access the information with keys.
Here is an example of the old ESXi Releases JSON File (List), and the new V2 (Hashtable):
Having a key, instead of plain lists allows accessing data faster. Instead of looping through the object or using search functions...:
$esxiReleases = Invoke-WebRequest -Uri http://www.virten.net/repo/esxiReleases.json | ConvertFrom-Json Foreach ($release in $esxiReleases.data.esxiReleases) { If ($vmHost.Build -eq $release.Build) { [...]
...with V2 you can simply access build information by its key (Build number):
$esxiReleases = Invoke-WebRequest -Uri http://www.virten.net/repo/esxiReleasesV2.json | ConvertFrom-Json $esxiReleases.data.esxiReleases.($vmHost.Build)
The following files are now available in V2:
http://www.virten.net/repo/esxiReleases.json
http://www.virten.net/repo/esxiReleasesV2.json
http://www.virten.net/repo/vcenterReleases.json
http://www.virten.net/repo/vcenterReleasesV2.json
Of course, I'm going to maintain both versions in each case, so there is no need to change old scripts.
I've also added the database backing my SCSI Sense Code Decoder to my JSON repository. This allows you to implement the decoder in your troubleshooting software or use it in scripts (or just wait a couple of days as I'm also writing a script for decoding in PowerShell). As mentioned above, there are two versions:
www.virten.net/repo/scsicodes.json - Plain List
www.virten.net/repo/scsicodesV2.json - New format with keys
Hi,
Are there plans at all to add the VCSA version into the JSON extracts at all (eg. "7.0.3.01500")?
J G
Added to the JSON as field "version".
Florian,
Thanks for that. I'll check it out.
Jason