How to get Spectrum Model Attributes via REST API

Document ID:  TEC1528074
Last Modified Date:  07/14/2017
{{active ? 'Hide' : 'Show'}} Technical Document Details

Products

  • CA Spectrum

Releases

  • CA Spectrum:Release:10.0
  • CA Spectrum:Release:10.1
  • CA Spectrum:Release:10.1.1
  • CA Spectrum:Release:10.1.2
  • CA Spectrum:Release:10.2
  • CA Spectrum:Release:10.2.1

Components

  • ONECLICK:SPCOCK
  • DISCOVERY & MODELING:SPCDIS
Introduction:

There are many ways to find a model's attributes (such as through the OneClick interface, or via the vnmsh command line), however, these usually list out all the attributes of the one chosen model. The REST API can offer a more granular approach to finding the values of various model attributes.

Question:

How can the Spectrum REST API be used to specify individual or multiple attributes and get their values from targeted models?

Environment:
Spectrum 10.x
Answer:

A RESTful POST request can be used to achieve this by creating an XML body with the desired requests targeting the individual Model_Handle (attribute 0x129fa) of each model you wish to get attributes from.. For example, to get attributes such as Network_Address (0x12d7f), Model_Name (0x1006e) or Modeltype_Name (0x10000), you would issue a POST request with the following body (where a separate "MODEL_HANDLE" value is specified for each model whose values are required:

 

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

 

<rs:model-request throttlesize="1000" 

xmlns:rs="http://www.ca.com/spectrum/restful/schema/request

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance

xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd"> 

 

<rs:target-models>

<rs:model mh=“MODEL_HANDLE” />

<rs:model mh=“MODEL_HANDLE” />

Etc…

</rs:target-models>

 

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

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

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

 

</rs:model-request>

Additional Information:

Please help us improve!

Will this information enable you to resolve your issue?

Please tell us what we can do better.

{{feedbackText.length ? feedbackText.length : '0'}}/255

{{status}}

Not what you were looking for?

Search Again >

Product Information

Support by Product >

Communities

Join a Community >

Chat with CA

Just give us some brief information and we'll connect you to the right CA ExpertCA sales representative.

Our hours of availability are 8AM - 5PM CST.

All Fields Required

connecting

We're matching your request.

Unfortunately, we can't connect you to an agent. If you are not automatically redirected please click here.

  • {{message.agentProfile.name}} will be helping you today.

    View Profile


  • Transfered to {{message.agentProfile.name}}

    {{message.agentProfile.name}} joined the conversation

    {{message.agentProfile.name}} left the conversation

  • Your chat with {{$storage.chatSession.messages[$index - 1].agentProfile.name}} has ended.
    Thank you for your interest in CA.


    Rate Your Chat Experience.

    {{chat.statusMsg}}

agent is typing