DX NetOps

 View Only
  • 1.  How to create a model within a static global collection via REST API?

    Posted Aug 10, 2017 04:18 PM

    I am uncertain of how to create a device model that is associated with a specific, static global collection via REST.  If anyone has any guidance, it would be of great help.  Thank you in advance!



  • 2.  Re: How to create a model within a static global collection via REST API?
    Best Answer

    Posted Aug 10, 2017 04:28 PM

    When a model is statically added to a GC, Spectrum creates a staticGlobalCollects relation id 0x0001003b between the GC and the model. The following is an example:

     

    LMHandle      LMName       Relation                       RMHandle       RMName
    0x2000169    GC_Name     staticGlobalCollects     0x20000ec      Device Model Name

     

    So after creating the device model using the REST API, create the staticGlobalCollects relation between the GC and the device model.

     

    Joe



  • 3.  Re: How to create a model within a static global collection via REST API?

    Posted Aug 17, 2017 06:57 AM

    Just a note - when using the REST API or VNMsh, you need to create the relation on every landscape that contains a member of the Global Collection. e.g. if you have 10 devices you want in the GC spread out on 3 of 10 landscapes, you will need to create a global collection model on the 3 landscapes and then create the device models (by adding the devices if not already there) then you need to create the relation for each of the devices.

     

    E.g.:

     

    Create GC (POST):

     

    http://<OC_IP>:<PORT>/spectrum/restful/model?landscapeid=0x100000&mtypeid=0x10474&attr=0x1006e&val=<GC_Name>

     

    Associate GC:

    http://<OC_IP>:<PORT>/spectrum/restful/associations/relation/0x1003b/leftmodel/<Model Handle of GC>/rightmodel/<Device Model Handle>

     

    Note: This is a static global collection - ie. you copy the devices into the global collection and the GC never changes.

    If you wanted to create a dynamic global collection (uses some sort of logic to populate the GC) - you would need to modify the dynamicCriteriaXML attribute (0x12a6a).