Get Relation

This call returns the details of a relation.

URL

/dataModel/relation/{id}

Method

GET

Headers

Required:

Authorization: Bearer <token>

Note <token> is the token that is returned by the Authentication call.

Example:

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0Njc5ODQ5MTcsImN1c3RvbWVyIjoxLCJ1c2VybmFtZSI6InN5c2FkbWluIn0.Ph8WHtzvpvfuH1j0CtwHqyBhX1uLlfhr0eQQ7m0_gT0

Request type

None

Response type

JSON

URL Parameters

Path Parameters

Required:

{id}: [ucmdb_id]

Data Types:

[ucmdb_id]

The string that represents the UCMDB ID of a relation.

Payload

None

Call example

GET <base_ulr>/dataModel/relation/464106e644e5d86daea003a2cbbc648f

Success response

Status: 200

Response:

{
  ucmdbId: [ucmdb_id],
  type: [ucmdb_cit],
  properties: {
    <ucmdb_cit_prop>: [ucmdb_cit_prop_value],
    …
  },
  end1Id: [ucmdb_id],
  end2Id: [ucmdb_id]
}

Note The (three dots) denotes that there can be 0 or more values.

Data Types:

[ucmdb_id]

The string that represents the UCMDB ID of a relation.

[ucmdb_cit]

The string that represents the name of a valid relation type from the UCMDB.

[ucmdb_cit_prop_value]

The property value, which can be integer, string, Boolean, long, double, ISO8601 date, or a list of values depending on the CIT property data type.

Custom fields:

<ucmdb_cit_prop>

The valid property name of the relation type. You can get the name and the list of all properties of a relation from the CI Type Manager.

Example:

Status: 200

Response:

{
  ucmdbId: 464106e644e5d86daea003a2cbbc648f,
  type: composition,
  properties: {
    root_candidatefordeletetime: 2016-07-31T08:41:54.189Z,
    data_operationisnew: false,
    root_class: node,
    display_label: test2,
    data_operationstate: 0:Normal,
    data_allow_auto_discovery: true,
  },
  end1Id: 4c558e88e6910f6ebf642c9e07be8426,
  end2Id: 4a2a4387a61951a1ba1b2b5338930985
}

Error response

Status: 404 or 400

Content:

{
  error: [string]
} 

Example:

Code: 404

Content:

{
   error: The following error has occurred:  Relation with specified ID was not found. Please consult logs for more details
}

Note

The user that the token belongs to must have the required permissions for viewing the data inside UCMDB through the SDK.