跳至主内容

GET /cspm/resources

此API返回已接入云账户中可用资源的相关信息。

请求

格式

GET/cspm/resources/{id}

参数

参数

类型

可选

描述

id

字符串

您想要显示信息的资源ID。

如果请求中未指定此参数,响应将包含您所有云账户中可用资源的信息。

示例

请求您云账户中所有可用资源的信息:

GET/cspm/resources

请求资源信息 34a3a231-73d1-4945-8376-a41f7b****** :

GET/cspm/resources/34a3a231-73d1-4945-8376-a41f7b******

响应

格式

{
  "data": [
    {
      "id": "字符串",
      "type": "resource",
      "attributes": {
        "resource_name": "字符串",
        "resource_region": "字符串",
        "resource_type": "字符串"
      },
      "links": {
        "self": "字符串"
      }
    }
  ],
  "links": {
    "self": "字符串",
    "next": "字符串"
  },
  "meta": {
    "total": 0,
    "elapsed": 0
  }
}

属性

此端点返回包含多个属性的对象:

属性

类型

描述

data

数组

包含特定资源信息的属性列表。

id

字符串

扫描组的ID。

type

字符串

扫描组的类型。可能取值: rule .

attributes

数组

提供扫描组设置信息。

resource_name

字符串

资源名称。

resource_region

字符串

资源所在区域。

resource_type

字符串

资源类型。

links

数组

提供与本扫描组相关的链接。

self

字符串

指向本扫描组设置信息的直接链接。

以下属性仅在请求公司所有扫描组信息时返回(请求中未指定 id )。

links

数组

提供页面导航链接。

self

字符串

指向本资源信息的直接链接。

next

String

指向下一资源信息的直接链接。

meta

Array

提供请求返回信息的总体概况。

total

Integer

请求返回的结果总数。

elapsed

Integer

已查看结果数量(包含当前显示项)。

示例

请求获取已接入云账户所有资源的信息:

{
    "data": [
        {
            "id": "0e1f4b58-a373-44d4-8d01-1a7ad3******",
            "type": "resource",
            "attributes": {
                "resource_name": "0e1f4b58-a373-44d4-8d01-1a7ad3******",
                "resource_region": "ap-southeast-1",
                "resource_type": "ACM证书"
            },
            "links": {
                "self": "https://api.staging.cs.gravityzone.bitdefender.com/v1/cspm/resources/0e1f4b58-a373-44d4-8d01-1a7ad3******"
            }
        },
        {
            "id": "34a3a231-73d1-4945-8376-a41f7b******",
            "type": "resource",
            "attributes": {
                "resource_name": "34a3a231-73d1-4945-8376-a41f7b******",
                "resource_region": "ap-southeast-1",
                "resource_type": "ACM证书"
            },
            "links": {
                "self": "https://api.staging.cs.gravityzone.bitdefender.com/v1/cspm/resources/34a3a231-73d1-4945-8376-a41f7b******"
            }
        },
        {
            "...": "..."
        }
    ],
    "links": {
        "self": "https://api.staging.cs.gravityzone.bitdefender.com/v1/cspm/resources?page_limit=500",
        "next": "https://api.staging.cs.gravityzone.bitdefender.com/v1/cspm/resources?page_limit=500&page_cursor=eyJ0b3RhbCI6IDE3NTcsICJlbGFwc2VkIjogNTAwLCAibm9fbGF0ZXJfdGhhbiI6ICIyMDI0LTAxLTE0VDE3OjAzOjM0Ljc1NDY1OCIsICJuZXh0X2JlZ2luX3VpZCI6ICJzdWJuZXQtZjMwZmNkOTUifQ%3D%3D"
    },
    "meta": {
        "total": 1757,
        "elapsed": 500
    }
}

请求获取资源 34a3a231-73d1-4945-8376-a41f7b****** :

{
  "data": {
    "id": "string",
    "type": "resource",
    "attributes": {
      "resource_name": "34a3a231-73d1-4945-8376-a41f7b******",
      "resource_region": "ap-southeast-1",
      "resource_type": "ACM证书"
    },
    "links": {
      "self":"https://api.staging.cs.gravityzone.bitdefender.com/v1/cspm/resources/34a3a231-73d1-4945-8376-a41f7b******"
    }
  }
}