跳至主内容

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

String

资源的名称。

resource_region

String

资源所在的区域。

resource_type

String

资源的类型。

links

Array

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

self

String

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

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

links

Array

提供可在页面间导航的链接。

self

String

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

next

String

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

meta

Array

提供关于请求返回信息的总体概述。

total

整数

请求返回的结果总数。

elapsed

整数

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

示例

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

{
    "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******"
    }
  }
}