CA Spectrum Model handler list
search cancel

CA Spectrum Model handler list

book

Article ID: 233867

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

How to get the list of model handlers in ca spectrum . 

We used the following command 

This can be done using the Command Line Interface (CLI) “show enumerations” command.

In the following command, 0x11ee8 is the attribute id for Model_Class and 0x3d0002 is the model type handle for the GnSNMPDev model type.

[spectrum@spectrum vnmsh]$ ./show enumerations attr=0x11ee8 mth=0x3d0002

But we specifically  need the list for "users " . 

Also If you want to fetch the via API , user for a particular group  how to fetch it ?

 

Environment

Release : 10.4

Component :

Cause

Out of the Box we dont have a direct APIs to get the details 

Resolution

Steps need to be tried

Users list in test system

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=Rt8Hcy89Uf5hj7YiSO2eYw==

Model handles of these are as below
admin mh - 0x861b558
user 1 mh - 0x861b55a
user 2 mh - 0x861b55b

As admin is the group so it will have a left model handle association

Relation:
Name                             RelationID        Type
Has_Member                 0x00010022     MANY_TO_MANY

Below query will give the all the models which has left model association with admin model handle

http://ocserver/spectrum/restful/associations/relation/0x00010022/model/0x861b558?side=left

Output:

https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=ucAgjrzgMrnowumYXuowkg==

So now you need to capture the right model handles from the output and you need to use model api to get the user details

Now try to use below api

URL:

http://ocserver/spectrum/restful/models

Body:

<?xml version="1.0" encoding="UTF-8"?>

 

<rs:model-request xsi:schemaLocation="https://ocserver.example.com/314JB9FcM3nczj9AWv8unmM7GS?u=http%3A%2F%2Fwww.ca.com%2Fspectrum%2Frestful%2Fschema%2Frequest ../../../xsd/Request.xsd " xmlns:xsi="https:///ocserver.example.com/3NScEAgyQio6JUiCUTH9qYe7GS?u=http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance" xmlns:rs="https://ocserver.example.com/314JB9FcM3nczj9AWv8unmM7GS?u=http%3A%2F%2Fwww.ca.com%2Fspectrum%2Frestful%2Fschema%2Frequest" throttlesize="2">


<rs:target-models>
<rs:model mh="0x861b55a"/>
<rs:model mh="0x861b55b"/>
</rs:target-models>

<rs:requested-attribute id="0x1006e"/>
<rs:requested-attribute id="0x10000"/>


</rs:model-request>

Do a Post

now you will be able to see below info in the output

 

Output:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model-response-list xmlns="https://ocserver.example.com/39wGKzkbPQbAKsvdSVnt4DM7GS?u=http%3A%2F%2Fwww.ca.com%2Fspectrum%2Frestful%2Fschema%2Fresponse" total-models="2" throttle="2" error="EndOfResults">
    <model-responses>
        <model mh="0x861b55a">
            <attribute id="0x1006e">user1</attribute>
            <attribute id="0x10000">User</attribute>
        </model>
        <model mh="0x861b55b">
            <attribute id="0x1006e">user2</attribute>
            <attribute id="0x10000">User</attribute>
        </model>
    </model-responses>
</model-response-list>