You need to enable JavaScript to run this app.
导航

ListWorkspaces

最近更新时间2024.04.19 11:53:52

首次发布时间2023.06.30 15:23:33

获取工作区列表。

请求说明

  • 请求方式:POST
  • 请求地址:https://open.volcengineapi.com/?Action=ListWorkspaces&Version=2021-03-03

请求参数

参数名称类型是否必选示例值描述
ActionStringListWorkspaces公共参数,本接口值:ListWorkspaces。
VersionString2021-03-03公共参数,本接口值:2021-03-03。
PageNumberInteger1当前页数,最小值或默认值均为 1。

PageSize

Integer

10

单页数量:

  • 取值范围为 0~100。
  • 默认值为 10。
FiltersObject WorkspaceFilter-工作区过滤条件。

WorkspaceFilter

参数名称类型是否必选示例值描述
IdsArray of String["e28ae750-bbb8-4ff4-abf4-1e0e0f88808c"]按工作区 ID 过滤,精确查询。
NameStringtest按工作区名称过滤,模糊查询。
InstanceTypeIdsArray of String["vmp.standard.15d"]按工作区类型 ID 过滤,精准查询。

请求示例

POST /?Action=ListWorkspaces&Version=2021-03-03
Content-Type:application/json
{
    "PageNumber": 1,
    "PageSize": 10,
    "Filters": {
        "Ids": ["e28ae750-bbb8-4ff4-abf4-1e0e0f88808c"],
        "Name": "test",
        "InstanceTypeIds": ["vmp.standard.15d"]
    }
}

返回参数

参数名称类型示例值描述
TotalInteger100工作区总数。
ItemsArray of Workspace-工作区列表。

Workspace

参数名称类型示例值描述
IdStringe28ae750-bbb8-4ff4-abf4-1e0e0f88808c工作区 ID。
CreateTimeString2022-01-01T00:00:00Z工作区创建时间,RFC3339 格式。
NameStringtest工作区名称。
DescriptionString这是一段描述工作区描述。

Status

String

Active

工作区状态,取值:

  • Creating:创建中
  • Active:正常
  • Updating:更新中
  • Deleting:删除中
  • OverdueShutted:欠费关停
  • Resuming:恢复中
  • Error:错误
InstanceTypeIdStringvmp.standard.15d工作区规格。

OverdueReclaimTime

String

2022-01-01T00:00:00Z

工作区预期欠费回收时间,RFC3339 格式。

说明

当账户欠费时,该字段才会有具体的值。

UsernameStringadmin工作区 BasicAuth 用户名。
PrometheusWriteIntranetEndpointStringhttp://write.prometheus-cn-beijing.ivolces.com/workspaces/1c3fxxx工作区 RemoteWrite URL 地址。
PrometheusQueryIntranetEndpointStringhttp://query.prometheus-cn-beijing.ivolces.com/workspaces/1c3fxxx工作区 Query URL 地址。

DeleteProtectionEnabled

Boolean

true

是否开启工作区删除保护,取值:

  • true:开启工作区删除保护。
  • false:不开启工作区删除保护。

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "202211302208xxxx",
        "Action": "ListWorkspaces",
        "Version": "2021-03-03",
        "Service": "vmp",
        "Region": "cn-beijing"
    },
    "Result": {
        "Total": 100,
        "Items": [
            {
                "Id": " e28ae750-bbb8-4ff4-abf4-1e0e0f88808c",
                "CreateTime": " 2022-01-01T00:00:00Z",
                "Name": " test",
                "Description": " 这是一段描述",
                "Status": " Active",
                "InstanceTypeId": " vmp.standard.15d",
                "OverdueReclaimTime": " 2022-01-01T00:00:00Z",
                "Username": " admin",
                "PrometheusWriteIntranetEndpoint": " http://write.prometheus-cn-beijing.ivolces.com/workspaces/1c3fxxx",
                "PrometheusQueryIntranetEndpoint": " http://query.prometheus-cn-beijing.ivolces.com/workspaces/1c3fxxx",
                "DeleteProtectionEnabled":  true
            }
        ]
    }
}

错误码

本接口错误码如下表所示,公共错误码请参见 公共错误码

HTTP 状态码错误码错误信息描述
400InvalidParameter.{{parameter}}The specified {{parameter}} is invalid.参数不合法,请检查参数正确性后重试。
403ProductUnsubscribedYou are not subscribed to the Volcengine Managed Service for Prometheus (VMP). Please go to the VMP console web page to subscribe to the service当前账号未订阅 VMP 服务。