Update Location operation

The Update Location operation updates the details of a location.

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 Location operation

Element

Definition

Required

<operation-name>

Specifies the name of the operation: update-location

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 <location> in the <instance> element.

You can provide the value for <location> in the <keys> element, or 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

<location>

Specifies the details for the location

The <location> element must be used as the key.

Valid value: Any unique string

Notes:

  • The <location> element can be a child element of the <keys> and <instance> elements.
  • The <location> element is a required child element for the <keys> element to find the location to be updated.
  • The <location> element is an optional child element for the <instance> element to specify the new desired value of the <location> element.

No

<location-name>

Specifies the name of the location

Valid value: Any string

No

<address>

Specifies the address of the location; is an array-type of element

No

<city>

Specifies the city in which the company is located

Valid value: Any string

No

<state>

Specifies the state in which the company is located

Valid value: Any string

No

<zip>

Specifies the zip code of the area where the company is located

Valid value: Any string

No

<primary-contact>

Specifies the primary contact details for the location

Valid value: Any string, or an existing contact record

No

<phone>

Specifies the phone number for the location

Valid value: Any string

No

<location-open-time>

Specifies the opening time for the location

Valid value: Any input in the HH:MM:SS format

No

<location-closing-time>

Specifies the closing time for the location

Valid value: Any input in the HH:MM:SS format

No

<primary-contact-department>

Specifies the primary contact department for the location

Valid value: Any string

No

<location-code>

Specifies the code for the location

Valid value: Any string

No

<comment>

Specifies the comment for the location; is an array-type element

No

<country>

Specifies the country in which the company is located

Valid value: Any string

No

<email>

Specifies the email ID for the location

Valid value: Any string

No

<company>

Specifies the name of the company

Valid value: Any string

No

<site-category>

Specifies the site category for the location

Valid values:

  • A: Critical Site
  • B: Major Site
  • C: Satellite Site
  • D: Home Site

No

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

Sample adapter request for the Update Location operation


 <hp-service-manager-request>
    <entity>configurationitem</entity>
    <entity-type>location</entity-type>
    <request>
      <operation-name>update-location</operation-name>
      <parameters>
        <update-location-request>
          <model>
            <keys>
              <location>
                <value>MyLocation25</value>
                <type>String</type>
              </location>
            </keys>
            <instance>
              <location>
                <value>MyLocation25</value>
                <type>String</type>
              </location>
              <location-name>
                <value>Location Name-updated</value>
                <type>String</type>
              </location-name>
              <address>
                <type>Array</type>
                <address>
                  <element>
                    <value>Address</value>
                    <type>String</type>
                  </element>
                </address>
              </address>
              <city>
                <value>City</value>
                <type>String</type>
              </city>
              <state>
                <value>State</value>
                <type>String</type>
              </state>
              <zip>
                <value>zip</value>
                <type>String</type>
              </zip>
              <primary-contact>
                <value>primary contact</value>
                <type>String</type>
              </primary-contact>
              <phone>
                <value>Phone</value>
                <type>String</type>
              </phone>
              <location-open-time>
                <value>11:00:00</value>
                <type>Time</type>
              </location-open-time>
              <location-closing-time>
                <value>12:00:00</value>
                <type>Time</type>
              </location-closing-time>
              <primary-contact-department>
                <value>primary contact department</value>
                <type>String</type>
              </primary-contact-department>
              <location-code>
                <value>Location Code</value>
                <type>String</type>
              </location-code>
              <comments>
                <type>Array</type>
                <comments>
                  <element>
                    <value>Comment line 1</value>
                    <type>String</type>
                  </element>
                  <element>
                    <value>Comment line 2</value>
                    <type>String</type>
                  </element>
                </comments>
              </comments>
              <country>
                <value>Country</value>
                <type>String</type>
              </country>
              <email>
                <value>Email</value>
                <type>String</type>
              </email>
              <company>
                <value>Company</value>
                <type>String</type>
              </company>
              <site-category>
                <value>A</value>
                <type>String</type>
              </site-category>
            </instance>
          </model>
        </update-location-request>
      </parameters>
    </request>
  </hp-service-manager-request>


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

Sample adapter response for the Update Location 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>
              <location>
                <value>MyLocation25</value>
                <type>String</type>
              </location>
            </keys>
            <instance>
              <location-name>
                <value>Location Name-updated</value>
                <type>String</type>
              </location-name>
              <location>
                <value>MyLocation25</value>
                <type>String</type>
              </location>
              <address>
                <type>Array</type>
                <address>
                  <element>
                    <value>Address</value>
                    <type>String</type>
                  </element>
                </address>
              </address>
              <city>
                <value>City</value>
                <type>String</type>
              </city>
              <state>
                <value>State</value>
                <type>String</type>
              </state>
              <zip>
                <value>zip</value>
                <type>String</type>
              </zip>
              <primary-contact>
                <value>primary contact</value>
                <type>String</type>
              </primary-contact>
              <phone>
                <value>Phone</value>
                <type>String</type>
              </phone>
              <location-open-time>
                <value>11:00:00.000Z</value>
                <type>Time</type>
              </location-open-time>
              <location-closing-time>
                <value>12:00:00.000Z</value>
                <type>Time</type>
              </location-closing-time>
              <primary-contact-department>
                <value>primary contact department</value>
                <type>String</type>
              </primary-contact-department>
              <location-code>
                <value>Location Code</value>
                <type>String</type>
              </location-code>
              <comments>
                <type>Array</type>
                <comments>
                  <element>
                    <value>Comment line 1</value>
                    <type>String</type>
                  </element>
                  <element>
                    <value>Comment line 2</value>
                    <type>String</type>
                  </element>
                </comments>
              </comments>
              <country>
                <value>Country</value>
                <type>String</type>
              </country>
              <email>
                <value>Email</value>
                <type>String</type>
              </email>
              <company>
                <value>Company</value>
                <type>String</type>
              </company>
              <location-structure>
                <value>MyLocation25</value>
                <type>String</type>
              </location-structure>
              <location-full-name>
                <value>Company/MyLocation25</value>
                <type>String</type>
              </location-full-name>
              <site-category>
                <value>A</value>
                <type>String</type>
              </site-category>
              <uniquequery>location="MyLocation25"</uniquequery>
              <recordid>MyLocation25</recordid>
            </instance>
          </model>
          <messages>
            <element>
              <value>Location record updated.</value>
            </element>
          </messages>
          <status>SUCCESS</status>
          <message>Success</message>
          <schema-revision-date>2007.04.04 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