DX NetOps

 View Only
  • 1.  CA Spectrum RESTful API - Retrieve all attributes for Model Type

    Posted Aug 12, 2015 02:53 PM

    We currently have a Spectrum 9 and a Spectrum 10 environment.

     

    Currently, I have to manually export a CSV of all attributes in OneClick by choosing a model, going to it's attributes, and performing at export.  The export is then used by the library we have developed that's able to query the API.

    I would like to be able to retrieve a list of all attributes (Their ID, Name, etc.) based on either a specified Model Class (Router, Server, etc.), or a complete list of attributes which has the Model Class(es) that the attribute applies to via the RESTful API or any other automated fashion that's reliable and would eliminate the manual process of the CSV export.

     

    Is there a way of doing this?

     

    Thanks in advance! !



  • 2.  Re: CA Spectrum RESTful API - Retrieve all attributes for Model Type
    Best Answer

    Posted Aug 12, 2015 04:16 PM

    I do not know if there is a way to get this information using RESTful API but you can get a list of all the attributes for a model or model type using the Command Line Interface (CLI) "show attributes" command.

     

    For a model type you need to supply the model type handle and enter the command as follows (this example is model type 0x3d0002 which is the GnSNMPDev model type):

     

    > ./show attributes mth=0x3d0002

    Id          Name                             Type              Flags

    0x10000     Modeltype_Name                   Text String       R,S,M

    0x10001     Modeltype_Handle                 Modeltype Handle  R,S,M

    0x10004     Contact_Status                   Integer           R,W,G,M,D,L

    0x10009     Security_String                  Text String       R,W,O,M,D

    0x1000a     Condition                        Integer           R,W,G,M,D

    0x1000b     Condition_Value                  Integer           R,W,G,M

    0x1000c     Value_When_Yellow                Integer           R,W,V,M,D

    0x1000d     Value_When_Orange                Integer           R,W,V,M,D

    0x1000e     Value_When_Red                   Integer           R,W,V,M,D

    0x1000f     Composite_Condition              Integer           R,W,G,M

    0x10010     Yellow_Threshold                 Integer           R,W,G,V,M,D

    .

    .

    .

     

     

    For a specific model you need to supply the model handle of the model (for this example, the model handle is for a Cisco 7606 router modeled using the Rtr_Cisco model type:

     

    > ./show attributes mh=0x4001d0 | more

    Id          Name                              Iid                  Value

    0x10000     Modeltype_Name                                         Rtr_Cisco

    0x10001     Modeltype_Handle                                       0x21000c

    0x10004     Contact_Status                                         1

    0x10009     Security_String

    0x1000a     Condition                                              0

    .

    .

    .

     

    Joe



  • 3.  Re: CA Spectrum RESTful API - Retrieve all attributes for Model Type

    Posted Aug 12, 2015 04:38 PM

    Thanks!  Does this mean that this functionality is definitely not

    available via RESTful?

     

    Latch Kostov

    U.S. Bank

    1200 Energy Park Dr

    Saint Paul, MN 55108

    latchezar.kostov@usbank.com



  • 4.  Re: CA Spectrum RESTful API - Retrieve all attributes for Model Type

    Posted Aug 12, 2015 05:28 PM

    I can see how you can get individual attibute values from a model using RESTful but I do not see a way to get ALL attributes like the CLI command.

     

    Joe



  • 5.  Re: CA Spectrum RESTful API - Retrieve all attributes for Model Type

    Posted Aug 14, 2015 09:50 AM

    If you use the 'show attributes' command, remember to use:

     

    export CLIMNAMEWIDTH=64

     

    so you can see the names without being truncated. I use 64, but in some cases you might want it longer.

     

    This sets the Maximum column width for the ModelName.

     

    I've also been looking if this information is available via REST, but haven't found it yet.



  • 6.  RE: Re: CA Spectrum RESTful API - Retrieve all attributes for Model Type

    Posted Jan 03, 2024 08:31 AM

    Hi, 

    Did anyone find option to do this using API. Even i have a requirement to pull certain attributes of a container which are in hierarchy.




  • 7.  RE: Re: CA Spectrum RESTful API - Retrieve all attributes for Model Type

    Posted Jan 08, 2024 02:47 AM

    For pulling certain attributes, you need to specify them in the request. The thread here was for all attributes of a certain MT. 



    ------------------------------
    Cătălin Fărcășanu
    Senior Consultant
    SolvIT Networks
    ------------------------------