Skip to content

JSON Repository Format Update and now with SCSI Codes

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:

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:

 

3 thoughts on “JSON Repository Format Update and now with SCSI Codes”

Leave a Reply

Your email address will not be published. Required fields are marked *