• Home
  • Dynatrace API
  • Environment
  • Monitored entities
  • GET an entity

Monitored entities API - GET an entity

Gets the full list of properties of the specified entity. The actual list depends on the entity type.

The request produces an application/json payload.

GETManagedDynatrace for Governmenthttps://{your-domain}/e/{your-environment-id}/api/v2/entities/{entityId}
SaaShttps://{your-environment-id}.live.dynatrace.com/api/v2/entities/{entityId}
Environment ActiveGatehttps://{your-activegate-domain}/e/{your-environment-id}/api/v2/entities/{entityId}

Authentication

To execute this request, you need an access token with entities.read scope.

To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
entityIdstring

The ID of the required entity.

pathrequired
fromstring

The start of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of three days is used (now-3d).

queryoptional
tostring

The end of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

queryoptional
fieldsstring

Defines the list of entity properties included in the response. The ID and the name of an entity are always included to the response.

To add properties, list them with leading plus +. You can specify several properties, separated by a comma (for example fields=+lastSeenTms,+properties.BITNESS).

Use the GET entity type request to fetch the list of properties available for your entity type. Fields from the properties object must be specified in the properties.FIELD format (for example, properties.BITNESS).

queryoptional

Response

Response codes

CodeTypeDescription
200Entity

Success

Response body objects

The Entity object

The properties of a monitored entity.

ElementTypeDescription
fromRelationshipsobject

A list of relationships where the entity occupies the FROM position.

toRelationshipsobject

A list of relationships where the entity occupies the TO position.

firstSeenTmsinteger

The timestamp at which the entity was first seen, in UTC milliseconds.

lastSeenTmsinteger

The timestamp at which the entity was last seen, in UTC milliseconds.

tagsMETag[]

A set of tags assigned to the entity.

managementZonesManagementZone[]

A set of management zones to which the entity belongs.

entityIdstring

The ID of the entity.

iconEntityIcon

The icon of a monitored entity.

propertiesobject

A list of additional properties of the entity.

typestring

The type of the entity.

displayNamestring

The name of the entity, displayed in the UI.

The EntityId object

A short representation of a monitored entity.

ElementTypeDescription
idstring

The ID of the entity.

typestring

The type of the entity.

The METag object

The tag of a monitored entity.

ElementTypeDescription
stringRepresentationstring

The string representation of the tag.

valuestring

The value of the tag.

keystring

The key of the tag.

contextstring

The origin of the tag, such as AWS or Cloud Foundry.

Custom tags use the CONTEXTLESS value.

The ManagementZone object

A short representation of a management zone.

ElementTypeDescription
namestring

The name of the management zone.

idstring

The ID of the management zone.

The EntityIcon object

The icon of a monitored entity.

ElementTypeDescription
primaryIconTypestring

The primary icon of the entity.

Specified by the barista ID of the icon.

customIconPathstring

The user-defined icon of the entity.

Specify the barista ID of the icon or a URL of your own icon.

secondaryIconTypestring

The secondary icon of the entity.

Specified by the barista ID of the icon.

Response body JSON model

json
{ "entityId": "HOST-06F288EE2A930951", "type": "HOST", "displayName": "my host", "icon": { "primaryIconType": "linux", "secondaryIconType": "microsoft-azure-signet", "customIconPath": "host" }, "firstSeenTms": 1574697667547, "lastSeenTms": 1588242361417, "properties": { "bitness": 64, "monitoringMode": "FULL_STACK", "osType": "LINUX", "osArchitecture": "X86", "networkZoneId": "aws.us.east01", "cpuCores": 8 }, "tags": [ { "context": "CONTEXTLESS", "key": "architecture", "value": "x86", "stringRepresentation": "architecture:x86" }, { "context": "ENVIRONMENT", "key": "Infrastructure", "value": "Linux", "stringRepresentation": "[ENVIRONMENT]Infrastructure:Linux" } ], "managementZones": [ { "id": "6239538939987181652", "name": "main app" } ], "fromRelationships": { "isInstanceOf": [ { "id": "HOST_GROUP-0E489369D663A4BF", "type": "HOST_GROUP" } ] }, "toRelationships": { "isDiskOf": [ { "id": "DISK-0393340DCA3853B0", "type": "DISK" } ] } }

Example

In this example, the request lists the properties of the dotNetBackend_easyTravel_x64 service, which has the ID of SERVICE-1125C375A187D27A.

The API token is passed in the Authorization header.

Curl

bash
curl -L -X GET 'https://mySampleEnv.live.dynatrace.com/api/v2/entities/SERVICE-1125C375A187D27A' \ -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'

Request URL

plaintext
https://mySampleEnv.live.dynatrace.com/api/v2/entities/SERVICE-1125C375A187D27A

Response body

json
{ "entityId": "SERVICE-1125C375A187D27A", "displayName": "dotNetBackend_easyTravel_x64", "firstSeenTms": 1424310498896, "lastSeenTms": 1590609632865, "properties": { "serviceType": "WEB_REQUEST_SERVICE", "internalName": "dotNetBackend_easyTravel_x64", "webServerName": "dotNetBackend_easyTravel_x64", "softwareTechnologies": [ { "edition": "FullCLR", "version": "2.0.50727" }, { "type": "DOTNET", "edition": ".NET Framework", "version": "3.5.1.0" }, { "type": "ADO_NET", "edition": "System.Data", "version": "2.0.50727.8751" }, { "type": "ASP_DOTNET", "version": "3.5.1.0" }, { "type": "IIS_APP_POOL", "version": "10.0.14393.0" }, { "type": "DOTNET_REMOTING", "version": "2.0.50727.8771" } ], "serviceTechnologyTypes": [ "IIS app pool", "ASP.NET", "DotNet" ], "mainServiceSoftwareTech": { "type": "ASP_DOTNET" }, "contextRoot": "/", "agentTechnologyType": "DOTNET" }, "tags": [ { "context": "CONTEXTLESS", "key": "customService", "stringRepresentation": "customService" }, { "context": "CONTEXTLESS", "key": "easytravel", "value": "backend", "stringRepresentation": "easytravel:backend" } ], "mangementZones": [ { "id": "2827032493241090264", "name": "allServices" }, { "id": "9130632296508575249", "name": "Easytravel" } ], "fromRelationships": { "calls": [ { "id": "SERVICE-775060208AAA1058", "type": "SERVICE" }, { "id": "SERVICE-6737CDED8F9BF969", "type": "SERVICE" } ], "runsOn": [ { "id": "PROCESS_GROUP-0A9A52EA262BC039", "type": "PROCESS_GROUP" } ], "runsOnHost": [ { "id": "HOST-B64B6B9CB11E2244", "type": "HOST" }, { "id": "HOST-CF61BC45E6282234", "type": "HOST" } ], "runsOnProcessGroupInstance": [ { "id": "PROCESS_GROUP_INSTANCE-DE765F657721AF59", "type": "PROCESS_GROUP_INSTANCE" } ] }, "toRelationships": { "calls": [ { "id": "SERVICE-D20E300A0A6814EF", "type": "SERVICE" }, { "id": "SERVICE-7675DAA7464128F8", "type": "SERVICE" } ] } }

Response code

200

Related topics
  • Custom tags API

    Manage custom tags of the monitored entities via the Dynatrace API.