最近更新时间:2024.04.19 11:53:52
首次发布时间:2023.06.30 15:23:33
获取工作区列表。
参数名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ListWorkspaces | 公共参数,本接口值:ListWorkspaces。 |
Version | String | 是 | 2021-03-03 | 公共参数,本接口值:2021-03-03。 |
PageNumber | Integer | 否 | 1 | 当前页数,最小值或默认值均为 1。 |
PageSize | Integer | 否 | 10 | 单页数量:
|
Filters | Object WorkspaceFilter | 否 | - | 工作区过滤条件。 |
参数名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Ids | Array of String | 否 | ["e28ae750-bbb8-4ff4-abf4-1e0e0f88808c"] | 按工作区 ID 过滤,精确查询。 |
Name | String | 否 | test | 按工作区名称过滤,模糊查询。 |
InstanceTypeIds | Array 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"] } }
参数名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Total | Integer | 100 | 工作区总数。 |
Items | Array of Workspace | - | 工作区列表。 |
参数名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Id | String | e28ae750-bbb8-4ff4-abf4-1e0e0f88808c | 工作区 ID。 |
CreateTime | String | 2022-01-01T00:00:00Z | 工作区创建时间,RFC3339 格式。 |
Name | String | test | 工作区名称。 |
Description | String | 这是一段描述 | 工作区描述。 |
Status | String | Active | 工作区状态,取值:
|
InstanceTypeId | String | vmp.standard.15d | 工作区规格。 |
OverdueReclaimTime | String | 2022-01-01T00:00:00Z | 工作区预期欠费回收时间,RFC3339 格式。 说明 当账户欠费时,该字段才会有具体的值。 |
Username | String | admin | 工作区 BasicAuth 用户名。 |
PrometheusWriteIntranetEndpoint | String | http://write.prometheus-cn-beijing.ivolces.com/workspaces/1c3fxxx | 工作区 RemoteWrite URL 地址。 |
PrometheusQueryIntranetEndpoint | String | http://query.prometheus-cn-beijing.ivolces.com/workspaces/1c3fxxx | 工作区 Query URL 地址。 |
DeleteProtectionEnabled | Boolean | true | 是否开启工作区删除保护,取值:
|
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 状态码 | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidParameter.{{parameter}} | The specified {{parameter}} is invalid. | 参数不合法,请检查参数正确性后重试。 |
403 | ProductUnsubscribed | You 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 服务。 |