> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/platform-service/zrm/resource/describeresourcetypes.md). Agents can also search and read this documentation through its [MCP server](https://docs.console.zenlayer.com/api-reference/~gitbook/mcp).

# DescribeResourceTypes

## 1. API Description

This API (DescribeResourceTypes) is used to query the currently supported resource types, with optional filtering by service and resource type.

{% hint style="info" %}
**Note**

* If neither `services` nor `resourceTypes` is provided, all resource types are returned.
* Multiple values within the same filter are combined with OR; the two filters are combined with AND.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type            | Description                                                                                                                                                                          |
| -------------- | -------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| services       | No       | Array of String | <p>Filters by the service the resource type belongs to. Exact match. Multiple services are combined with OR.</p><p>If not provided, resource types of all services are returned.</p> |
| resourceTypes  | No       | Array of String | <p>Filters by resource type. Exact match. Multiple resource types are combined with OR.</p><p>If not provided, all resource types are returned.</p>                                  |

## 3. Output Parameters

| Parameter Name | Type                                                                                                                                | Description                                                                                                           |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| requestId      | String                                                                                                                              | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |
| totalCount     | Integer                                                                                                                             | Number of resource types meeting the filtering conditions.                                                            |
| dataSet        | Array of [ResourceTypeInfo](https://docs.console.zenlayer.com/api-reference/platform-service/zrm/datastructure.md#resourcetypeinfo) | List of resource types.                                                                                               |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Query all resource types**

```json
POST /api/v2/zrm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeResourceTypes
<Common Request Params>

Request：
{}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "totalCount": 2,
    "dataSet": [
      {
        "resourceType": "BMC_INSTANCE",
        "name": "Bare Metal Instance",
        "service": "Bare Metal"
      },
      {
        "resourceType": "BMC_SUBNET",
        "name": "Subnet",
        "service": "Bare Metal"
      }
    ]
  }
}
```

**2. Filter by service and resource type**

```json
POST /api/v2/zrm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeResourceTypes
<Common Request Params>

Request：
{
  "services": [
    "Bare Metal"
  ],
  "resourceTypes": [
    "BMC_SUBNET"
  ]
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "totalCount": 1,
    "dataSet": [
      {
        "resourceType": "BMC_SUBNET",
        "name": "Subnet",
        "service": "Bare Metal"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code | Description |
| ---------------- | ---------- | ----------- |
