Ops Center

 Domain Type Schema with JSON file

  • Hitachi Ops Center
  • Hitachi Ops Center
Shaik Khalid Akram Akbar's profile image
Shaik Khalid Akram Akbar posted 07-30-2018 20:36

Hi all,

I am trying to use  "External Resource provider" to get values for a Input property.

The External Resource provider is a simply getting the values from a json file that  is created from CMRest call.

pastedimage_1

The Contents of the file /tmp/hostgroupinfo.json is like below

{

  "data" : [ {

    "hostGroup" : {

      "hostGroupId" : "CL1-A,0",

      "portId" : "CL1-A",

      "hostGroupNumber" : 0,

      "hostGroupName" : "1A-G00",

      "hostMode" : "LINUX/IRIX",

      "storageDeviceId" : "832000451572"

    },

    "ldev" : {

      "ldevId" : 1024,

      "clprId" : 0,

      "emulationType" : "OPEN-V-CVS",

      "byteFormatCapacity" : "50.00 G",

      "blockCapacity" : 104857600,

      "attributes" : [ "CVS", "HDP" ],

      "label" : "test to delete",

      "status" : "NML",

      "mpBladeId" : 0,

      "poolId" : 0,

      "numOfUsedBlock" : 0,

      "isFullAllocationEnabled" : false,

      "dataReductionStatus" : "DISABLED",

      "dataReductionMode" : "disabled",

      "storageDeviceId" : "832000451572",

      "isDefined" : true

    },

    "lun" : {

      "lunId" : "CL1-A,0,0",

      "lun" : 0,

      "storageDeviceId" : "832000451572"

    }

  } ],

  "offset" : 0,

  "count" : 1,

  "totalCount" : 79

}

While  defining the Domain Type and Domain type Schema for the Input property,  I am  having issues in reading the contents of the file :

I am defining the Domain Type Schema like below :

 

pastedimage_5

 

But the in the Service request preview  the data does not load up :

 

pastedimage_6

 

I am missing the Domain Type Schema, Tried to modify the Schema by parsing  the content in the https://jsonschema.net/  but still couldn't get the data parsed. Any pointers on how to create a Schema for the Contents in the file.

 

 

Thank  you  in advance

Akram


#HitachiOpsCenter
Data Conversion's profile image
Data Conversion

Hi Akram,

It seems the inconsistency between the data format on json file and Domain Type Schema/GUI Definition exists.

From the GUI Definition which I can see, I am assuming you are trying to show the Host Group information. However, the json file you are trying to use is containing the data other than Host Group (e.g. LUN, LDEV).

One way to solve this situation is to modify the data on json file. If you can make the data as a list of Host Group data only like below, you will see the Host Group data on HAD GUI with the current Domain Type Schema/GUI Definition.

{

  "data" : [ {

        "hostGroupId" : "CL1-A,0",

        "portId" : "CL1-A",

        "hostGroupNumber" : 0,

        "hostGroupName" : "1A-G00",

        "hostMode" : "LINUX/IRIX",

        "storageDeviceId" : "832000451572"

  } ]

}

Hope this will help.

Anyway, the solution will be change based on what you would like to accomplish here. So please let us know a little more detail what you would like to do, if the above does not fit to your case. (e.g. if you planning to show the LDEV/LUN information as a list on GUI as well as the host group from the same json file, please tell us so)

Shaik Khalid Akram Akbar's profile image
Shaik Khalid Akram Akbar

Hi Tomoya,

Thank you for the response. The objective was to use an already existing JSON file instead of querying a  external resource Provider via  REST API call,  to reduce the time delay to load the information for many number of Hostgroups/LDEVS.

In my above example for simplicity I was first trying to get the hostGroupId/hostGroupname first to see if that works.

I am trying to get the table like below for the input Property List.

pastedimage_1

But when reading the JSON file I am  not able to get the Schema correct when the Properties are an Array of Objects having its own properties.

Regards,

Akram.

Hidenori Akatoki's profile image
Hidenori Akatoki

Hi Akram,

Thank you for your question.

It seems like that your JSON data is combined hostgroup, LUN and LDEV info. And based on the current HAD spec, I think when you want to show JSON data as a table, need to specify JSON data with one hierarchy like following as described Tomoya.

pastedimage_0

And when you define domain type as follows:

pastedimage_1

You can see the data in the GUI based on the specified domain type and JSON data.

pastedimage_2

I hope this will help.

Thanks,

Akatoki

Shaik Khalid Akram Akbar's profile image
Shaik Khalid Akram Akbar

Hello Akatoki,

Thank you for the response.

Okay, so the HAD spec would want the Objects in One Hierarchy for representing in a table schema.

Thank you for the inputs. I will parse the JSON and make the required fields in one Hierarchy.

Regards,

Akram