Update Device operation

The Update Device operation updates a device record.

The following table describes the elements of the <items> XML element and the adapter request. If not specified, the valid value for an element should be assumed to be a string.

If no value is specified for a particular element or the element is skipped, the associated field will not be updated.

Elements for the <items> XML element and adapter request for the Update Device operation

Element

Definition

Required

<operation-name>

Specifies the name of the operation: update-device

Yes

<model>

Contains the other elements in the request

Yes

<keys>

Contains elements that uniquely identify a record

If you do not specify the child elements of the <keys> element, the application tries to find <configuration-item> in the <instance> element.

You can provide the values for <configuration-item> in the <keys> element, in the <instance> element, or in both elements.

Yes

<instance>

Specifies a unique record

The children of the <instance> element describe the fields of the record.

The only two higher-level elements are <keys> and <instance>. All other elements are child elements of the <instance> element.

Yes

<configuration-item>

Specifies the name of the device

The <configuration-item> element must be used as the key.

Valid value: Any unique string

Yes

<configuration-item-type>

Specifies the type of the configuration item

Valid value: Any string

No

<status>

Specifies the status of the configuration item

Valid values:

  • Installed
  • Available
  • Warehouse
  • Transfer
  • RMA
  • Replaced
  • Reserved
  • Retired

No

<vendor>

Specifies the name of the vendor for the device

Valid value: Any string, or an existing record from the application

No

<parent-device>

Specifies the parent device for the device

No

<model>

Specifies the model of the device

No

<serial-number>

Specifies the serial number of the device

No

<location>

Specifies the location of the device

Valid value: Any string

No

<contact-name>

Specifies the name of the contact for the device

Valid value: Any string

No

<part-number>

Specifies the part number of the device

No

<configuration-item-sub-type>

Specifies the subtype for a configuration item

No

<location-code>

Specifies the location code of the device

No

<building>

Specifies the building for the device

Valid value: Any string

No

<floor>

Specifies the floor of the device

Valid values: Any string

No

<system-down>

Specifies whether the system is down

Valid values: true, false

No

<asset-tag>

Specifies the asset for the record

Valid value: Any string

No

<critical>

Specifies whether the device is a critical device

Valid value: true, false (default)

No

<company>

Specifies the name of the company that is associated with the device

No

<department>

Specifies the department for the device

No

<assignment-group>

Specifies the assignment group for the device

No

The following figure displays the sample adapter request for the Update Device operation.

Sample adapter request for the Update Device operation


 <hp-service-manager-request>
    <entity>configurationitem</entity>
    <entity-type>device</entity-type>
    <request>
      <operation-name>update-device</operation-name>
      <parameters>
        <update-device-request>
          <model>
            <keys>
              <configuration-item>
                <value>NewDevice0001</value>
                <type>String</type>
              </configuration-item>
            </keys>
            <instance>
              <configuration-item>
                <value>NewDevice0001</value>
                <type>String</type>
              </configuration-item>
              <configuration-item-type>
                <value>device</value>
                <type>String</type>
              </configuration-item-type>
              <status>
                <value>status</value>
                <type>String</type>
              </status>
              <vendor>
                <value>Vendor name - UPDATED</value>
                <type>String</type>
              </vendor>
              <parent-device>
                <value>parent device</value>
                <type>String</type>
              </parent-device>
              <model>
                <value>model</value>
                <type>String</type>
              </model>
              <serial-number>
                <value>serial number</value>
                <type>String</type>
              </serial-number>
              <location>
                <value>location</value>
                <type>String</type>
              </location>
              <contact-name>
                <value>contact name</value>
                <type>String</type>
              </contact-name>
              <part-number>
              <part-number>
                <value>part number</value>
                <type>String</type>
              </part-number>
              <configuration-item-sub-type>
                <value>cist</value>
                <type>String</type>
              </configuration-item-sub-type>
              <location-code>
                <value>location code</value>
                <type>String</type>
              </location-code>
              <building>
                <value>bulding</value>
                <type>String</type>
              </building>
              <floor>
                <value>floor</value>
                <type>String</type>
              </floor>
              <room>
                <value>room</value>
                <type>String</type>
              </room>
              <system-down>
                <value>true</value>
                <type>Boolean</type>
              </system-down>
              <asset-tag>
                <value>asset tag</value>
                <type>String</type>
              </asset-tag>
              <critical>
                <value>true</value>
                <type>Boolean</type>
              </critical>
              <company>
                <value>company</value>
                <type>String</type>
              </company>
              <department>
                <value>department</value>
                <type>String</type>
              </department>
              <assignment-group>
                <value>assignment</value>
                <type>String</type>
              </assignment-group>
            </instance>
          </model>
        </update-device-request>
      </parameters>
    </request>
  </hp-service-manager-request>


The following figure displays an adapter response for the Update Device operation.

Sample adapter response for the Update Device operation


<hp-service-manager-response>
  <metadata>
    <count>1</count>
  </metadata>
  <responses>
    <response>
      <metadata>
        <count>1</count>
      </metadata>
      <item>
        <metadata>
          <status>success</status>
        </metadata>
        <parameters>
          <model>
            <keys>
              <configuration-item>
                <value>NewDevice0001</value>
                <type>String</type>
              </configuration-item>
            </keys>
            <instance>
              <configuration-item>
                <value>NewDevice0001</value>
                <type>String</type>
              </configuration-item>
              <vendor>
                <value>Vendor name - UPDATED</value>
                <type>String</type>
              </vendor>
              <parent-device>
                <value>parent device</value>
                <type>String</type>
              </parent-device>
              <model>
                <value>model</value>
                <type>String</type>
              </model>
              <serial-number>
                <value>serial number</value>
                <type>String</type>
              </serial-number>
              <location>
                <value>location</value>
                <type>String</type>
              </location>
              <configuration-item-type>
                <value>device</value>
                <type>String</type>
              </configuration-item-type>
              <updated-by>
                <value>falcon</value>
               <type>String</type>
              </updated-by>
              <contact-name>
                <value>contact name</value>
                <type>String</type>
              </contact-name>
              <part-number>
                <value>part number</value>
                <type>String</type>
              </part-number>
              <status>
                <value>status</value>
                <type>String</type>
              </status>
              <configuration-item-sub-type>
                <value>cist</value>
                <type>String</type>
              </configuration-item-sub-type>
              <location-code>
                <value>location code</value>
                <type>String</type>
              </location-code>
              <building>
                <value>bulding</value>
                <type>String</type>
              </building>
              <floor>
                <value>floor</value>
                <type>String</type>
              </floor>
              <room>
                <value>room</value>
                <type>String</type>
              </room>
              <system-down>
                <value>true</value>
                <type>Boolean</type>
              </system-down>
              <asset-tag>
                <value>asset tag</value>
                <type>String</type>
              </asset-tag>
              <critical>
                <value>true</value>
                <type>Boolean</type>
              </critical>
              <company>
                <value>company</value>
                <type>String</type>
              </company>
              <department>
                <value>department</value>
                <type>String</type>
              </department>
              <assignment-group>
                <value>assignment</value>
                <type>String</type>
              </assignment-group>
              <uniquequery>logical.name="NewDevice0001"</uniquequery>
              <recordid>NewDevice0001 - device - status</recordid>
            </instance>
          </model>
          <messages>
            <element>
              <value>Category of device cannot be found in the devtype file.  Record may not be viewable.</value>
            </element>
            <element>
              <value>Configuration Item record updated.</value>
            </element>
          </messages>
          <status>SUCCESS</status>
          <message>Success</message>
          <schema-revision-date>2010.01.20 00:00:00</schema-revision-date>
          <schema-revision-level>0</schema-revision-level>
          <return-code>0</return-code>
        </parameters>
      </item>
    </response>
  </responses>
</hp-service-manager-response>
Was this page helpful? Yes No Submitting... Thank you

Comments