model

Contents
casp1041
Contents
 
Use the model resource to create or delete a model and to read or modify model attributes. An example that illustrates model creation is included in this section. For more information, see Example: Create a Model Based on Model Type.
 The model resource operates on a single model at a time. For groups of models, use the models resource.
  •  
    Base URL
    http://<hostname><:portnumber>/spectrum/restful/model
POST model
The POST model lets you creates a new model and update list attribute on the Specified model.
Create a New Model
The following POST model creates a new model and returns the model handle.
  •  
    URL
    http://<hostname><:portnumber>/spectrum/restful/model[?landscapeid=<landscape_handle>][&mtypeid=<mtype_handle>][&agentport=<snmp_port>][&commstring=<comm_str>][&retry=<retry_cnt>][&timeout=<timeout_val>][&ipaddress=<ip_address>][&parentmh=<model_handle>][&relationid=<rel_handle>][&attr=<attr_id>&val=<num>]
  •  
    HTTP Method
    POST
  •  
    Body
    None
  •  
    Body Content
    Not Used
  •  
    Header
    application/xml, application/json
  •  
    Output
    XML or JSON listing the model handle of the created model or the error if the model cannot be created
 
URL Parameters
 
  •  
    &landscapeid=<
    landscape_handle
    >
    (Optional) Specifies the landscape where the model will be created.
  •  
    &mtypeid=<
    mtype_handle
    >
    (Optional) Specifies the model type handle of the model to be created. Required if the ipaddress parameter is not specified (see below).
  •  
    &agentport=<
    snmp_port
    >
    (Optional) Specifies the SNMP management port on the device.
    Default:
     161
  •  
    &commstring=<
    comm_str
    >
    (Optional) Specifies the community string.
    Default:
     public
  •  
    &retry=<
    retry_cnt
    >
    (Optional) Specifies the retry count.
    Default:
     3
  •  
    &timeout=<
    timeout_val
    >
    (Optional) Specifies the timeout value.
    Default:
     3000
  •  
    &ipaddress=<
    ip_address
    >
    (Optional) Specifies the IP address.
  •  
    &parentmh=<
    model_handle
    >
    (Optional) Specifies the parent (left Association) model.
  •  
    &relationid=<
    rel_handle
    >
    (Optional) Specifies the association from the parent to this model.
    Default:
     Collects
  •  
    &attr=<
    attr_id
    >&val=<
    num
    >
    (Optional) Specifies attribute ID and value.
Update List Attribute on the Specified Model
The following POST model updates the list attribute on the specified model.
  •  
    URL
    http://<hostname><:portnumber>/spectrum/restful/model/attr/update
  •  
    HTTP Method
    POST
  •  
    Body
    XML
  •  
    Body Content
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <update-model-attrlist-request xmlns="http://www.ca.com/spectrum/restful/schema/request"> <model mh="<model_handle>"/> <attribute-list id="<attribute_id>"> <instance oid="<instance_id_0>" value="<value>"/> <instance oid="<instance_id_1>" value="<value>"/> </attribute-list> </update-model-attrlist-request>
  • Body Parameters
    <model mh="<model_handle>"/>
    Specifies the model to update.
    <attribute-list id="<attribute_id>">
    Specifies the attribute ID to update.
    <instance oid="<instance_id_0>" value="<value>"/>
    Specifies the instance id and values to update.
    Repeat the instance id tag to update multiple instances in the list attribute.
  • Header
    application/xml, application/json
  • Output
    XML listing the model handle of the updated model or an error if the model cannot be updated.
GET model
GET model reads attributes from the specified model.
  •  
    URL
    http://<hostname><:portnumber>/spectrum/restful/model/<model_handle>[?attr=<attr_ID>]
  •  
    HTTP Method
    GET
  •  
    Body
    None
  •  
    Body Content
    Not Used
  •  
    Header
    application/xml, application/json
  •  
    Output
    XML or JSON listing of the requested attributes
 
URL Parameters
 
  •  
     
    model_handle
     
    Specifies the model.
  •  
    &attr=<
    attr_ID
    >
    (Optional) Specifies the requested attributes. Multiple attribute parameters can be specified.
PUT model
PUT model updates attributes on the specified model. 
  •  
    URL
    http://<hostname><:portnumber>/spectrum/restful/model/<model_handle>?attr=<attr_ID>&val=<num>
  •  
    HTTP Method
    PUT
  •  
    Body
    None
  •  
    Body Content
    Not Used
  •  
    Header
    application/xml, application/json
  •  
    Output
    XML or JSON listing of the requested attributes
 
URL Parameters
 
  •  
     
    model_handle
     
    Specifies the model to update.
  •  
    &attr=<
    attr_ID
    >&val=<
    num
    >
    Specifies the attributes and values to update. Multiple attribute-value pairs can be specified.
DELETE model
DELETE model deletes the specified model.
  •  
    URL
    http://<hostname><:portnumber>/spectrum/restful/model/<model_handle>
  •  
    HTTP Method
    DELETE
  •  
    Body
    None
  •  
    Body Content
    Not Used
  •  
    Header
    application/xml, application/json
  •  
    Output
    XML or JSON listing indicating success or failure
 
URL Parameters
 
  •  
     
    model_handle
     
    Specifies the model to delete.