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://testSpectrum/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://testSpectrum/spectrum/restful/models

Body:

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

<!-- CA Technologies, Inc. One CA Plaza Islandia, NY 11749 USA Copyright (c) 2012 CA Technologies, Inc. All rights reserved. IN NO EVENT SHALL CA TECHNOLOGIES INCORPORATED BE LIABLE FOR ANY INCIDENTAL, INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING BUT NOT LIMITED TO LOST PROFITS) ARISING OUT OF OR RELATED TO THIS SOFTWARE, EVEN IF CA TECHNOLOGIES INCORPORATED HAS BEEN ADVISED OF, KNOWN, OR SHOULD HAVE KNOWN, THE POSSIBILITY OF SUCH DAMAGES. -->

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