# Dynatrace api v2, how to access host's schemaId (builtin:anomaly-detection.infrastructure-disk) using setting/object REST  API

**URL:** <https://community.dynatrace.com/t/dynatrace-api-v2-how-to-access-hosts-schemaid-builtin-anomaly-detection-infrastructure-disk-using-setting-object-rest-api/50256>\
**Category:** Dynatrace API\
**Tags:** dynatrace-api\
**Created:** [February 13, 2025, 4:05pm UTC](https://community.dynatrace.com/t/dynatrace-api-v2-how-to-access-hosts-schemaid-builtin-anomaly-detection-infrastructure-disk-using-setting-object-rest-api/50256 "2025-02-13T16:05:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hyperdev](https://avatars.discourse-cdn.com/v4/letter/h/e9c0ed/32.png) [@hyperdev](https://community.dynatrace.com/u/hyperdev)\
**Post date:** [February 13, 2025, 4:05pm UTC](https://community.dynatrace.com/t/dynatrace-api-v2-how-to-access-hosts-schemaid-builtin-anomaly-detection-infrastructure-disk-using-setting-object-rest-api/50256/1 "2025-02-13T16:05:24Z")

</div>

The information is accessible thru the UI and not thru the API

https://\<tenant\>/…/ **ui** /settings/HOST-xxxxxxxxxxxxxxxx/builtin:anomaly-detection.infrastructure-disks?gtf=-2h&gf=all

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [February 13, 2025, 6:32pm UTC](https://community.dynatrace.com/t/dynatrace-api-v2-how-to-access-hosts-schemaid-builtin-anomaly-detection-infrastructure-disk-using-setting-object-rest-api/50256/2 "2025-02-13T18:32:01Z")

</div>

Hi,

Easier way would be, going to schema in the UI:

 ![AntonPineiro_0-1739471292296.png](https://global.discourse-cdn.com/dynatrace/original/2X/d/d622578848db85ce82c309e02a4978f5bb152a6a.png)

Select “…” → API:

 ![AntonPineiro_1-1739471368253.png](https://global.discourse-cdn.com/dynatrace/original/2X/3/3c67a35f940a6730dfbb0e352aa7c9fc79f121ad.png)

As you can see there, it is not HOST-id, you need object ID. If you go to full API specification:

 ![AntonPineiro_2-1739471459409.png](https://global.discourse-cdn.com/dynatrace/original/3X/2/8/28125c7a5a61846938d786a3c1b8c8b73bb39ff5.png)

I would call all objects you are interested using filters (filtering by schema for example), get objects IDs, and make a second call to get details of ID (disk).

Best regards

---

<div class="post-metadata">

**Author:** ![hyperdev](https://avatars.discourse-cdn.com/v4/letter/h/e9c0ed/32.png) [@hyperdev](https://community.dynatrace.com/u/hyperdev)\
**Post date:** [February 17, 2025, 9:58am UTC](https://community.dynatrace.com/t/dynatrace-api-v2-how-to-access-hosts-schemaid-builtin-anomaly-detection-infrastructure-disk-using-setting-object-rest-api/50256/3 "2025-02-17T09:58:12Z")

</div>

Hello,

Here are the results of my REST explorations

Evironment:

- tenants:
  - 18

- total Hosts:
  - 45k

- SchemaId to check:
  - builtin:anomaly-detection.infrastructure-disks.per-disk-override
    - required to check that it’s not been disabled accidentally

**Cynematics:**

- get hosts (18 multipage request)
- for each host:
  - get /api/v2/entities/HOST-XXXXXXXXXXXXXXXX
  - from each host get: (tens of disks per hosts)
    - “toRelationships”: {  
“isDiskOf”: [  
{  
“id”: “DISK-XXXXXXXXXXXXXXXX”,  
“type”: “DISK”  
},&nbsp;  
…  
]  
}
    - for each disk:
      - get&nbsp;/api/v2/settings/objects?schemaIds=builtin%3Aanomaly-detection.infrastructure-disks.per-disk-override&scopes=DISK-XXXXXXXXXXXXXXXX&fields=objectId%2Cvalue

**Conclusion:**

- Estimated number of REST request on the schemaId: 45000 times ( average of 10 disks per hosts configured) is 450k
- About 20 hours to get the informations at 10 millisec per request.
  - Tools used:
    - python 3.11
    - asyncio

This should be available at the HOST level just like the UI is offering, as it’s not practical to use the UI to check 45k hosts
