ListQuotas - 获取资源配额列表

更新时间:
复制 MD 格式

您可以通过ListQuotas获取资源配额列表。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

pai:ListQuotas

list

*全部资源

*

无 无

请求语法

GET /api/v1/quotas/ HTTP/1.1

请求参数

名称

类型

必填

描述

示例值

QuotaName

string

否

按照 QuotaName 过滤,支持模糊匹配。

quotajradxh43rgb

ResourceType

string

否

Quota 资源类型(Lingjun/ECS/ACS),默认值 ECS。

ECS

LayoutMode

string

否

展示方式,可以为树形或列表

Tree

ParentQuotaId

string

否

按 ParentQuotaId 过滤:

  • 不传,列出租户下所有 Quota,包含根 Quota 和子 Quota。

  • 传空,列出所有的根 Quota。

  • 传非空,列出指定 ParentQuotaId 的所有子 Quota。

quotajradxh43rgb

QuotaIds

string

否

逗号分隔,按 QuotaIds 过滤,只支持精确匹配,最多同时支持 100 个。

quota1ci8g793pgm,quotajradxh43rgb

WorkspaceIds

string

否

逗号分隔,按 WorkspaceIds 过滤,只支持精确匹配,最多同时支持 10 个。

21345,38727

Statuses

string

否

逗号分隔按照 Quota Statuses 过滤,只支持精确匹配。

Creating

PageNumber

integer

否

查询第几页数据,最小值为 1。

1

PageSize

integer

否

设置查询的分页大小,最小值为 1。

20

SortBy

string

否

返回结果的排序字段名,枚举值:

  • QuotaName

  • Status

  • CPU

  • Memory

  • GPU

  • GmtCreatedTime

  • GmtModifiedTime

status

Order

string

否

排列顺序:desc 或者 asc。

desc

Labels

string

否

按照 Label 的 key 和 value 进行过滤,多个标签使用半角逗号(,)分隔。

official=true,gpu=false

Verbose

boolean

否

是否显示详情。取值如下:

  • true:显示详情。

  • false:不显示详情。

true

WorkspaceName

string

否

所关联的工作空间名称。

myshellprod

HasResource

string

否

是否包含资源。

Versions

string

否

按照版本信息搜索。

1.0

ClusterType

string

否

集群类型

RayCluster

GPUType

string

否

GPU 类型。

V100

返回参数

名称

类型

描述

示例值

object

Schema of Response

Quotas

array

资源配额列表。

Quota

单个资源配额详情。

RequestId

string

请求 ID。

F082BD0D-21E1-5F9B-81A0-AB07485B03CD

TotalCount

integer

总记录数

23

示例

正常返回示例

JSON格式

{
  "Quotas": [
    {
      "QuotaId": "quota12345",
      "QuotaName": "dlc-quota",
      "ResourceType": "ECS",
      "ParentQuotaId": "\"\"",
      "ResourceGroupIds": [
        "rg69rj0leslw****"
      ],
      "AllocateStrategy": "ByNodeSpec",
      "Min": {
        "NodeSpecs": [
          {
            "Type": "ecs.g6.4xlarge",
            "Count": 10,
            "BindingPolicy": {
              "NodeSpecCount": 5,
              "IncludeNodes": [
                "lrnabc"
              ],
              "ExcludeNodes": [
                "lrndef"
              ]
            },
            "HyperType": ""
          }
        ]
      },
      "Description": "this is a test quota",
      "Labels": [
        {
          "Key": "testAccTag",
          "Value": "nihao"
        }
      ],
      "CreatorId": "1884692****",
      "LatestOperationId": "operation****",
      "Status": "Ready",
      "ReasonCode": "“”",
      "ReasonMessage": "“”",
      "GmtCreatedTime": "2023-06-22T00:00:00Z",
      "GmtModifiedTime": "2023-06-22T00:00:00Z",
      "QuotaDetails": {
        "DesiredMinQuota": {
          "CPU": "100",
          "GPU": "16",
          "GPUMemory": "80G",
          "GPUMemoryBytes": 85899345920,
          "GPUType": "GPU",
          "Memory": "100Gi"
        },
        "ActualMinQuota": {
          "CPU": "100",
          "GPU": "16",
          "GPUMemory": "80G",
          "GPUMemoryBytes": 85899345920,
          "GPUType": "GPU",
          "Memory": "100Gi"
        },
        "RequestedQuota": {
          "CPU": "100",
          "GPU": "16",
          "GPUMemory": "80G",
          "GPUMemoryBytes": 85899345920,
          "GPUType": "GPU",
          "Memory": "100Gi"
        },
        "NodeStatistics": {
          "ActualMinNodeNum": 0,
          "ActualMinHyperNodeNum": 0,
          "AllocatedNodeNum": 0,
          "AllocatedHyperNodeNum": 0,
          "EmptyNodeNum": 0,
          "AllocatedHyperNodeDetails": [
            {
              "HyperNodeName": "",
              "AllocatedNodeNum": 0,
              "TotalNodeNum": 0,
              "EmptyNodeNum": 0
            }
          ]
        }
      },
      "QuotaConfig": {
        "SupportRDMA": false,
        "ClusterId": "ceeb3724255364***",
        "UserVpc": {
          "VpcId": "vpc-abcdef****",
          "SwitchId": "vs-abcdef****",
          "SecurityGroupId": "sg-abcdef****",
          "ExtendedCIDRs": [
            "\"192.168.0.1/24\""
          ],
          "RoleArn": "acs:ram::25xxxx:role/AliyunPAIDLCDefaultRole",
          "DefaultRoute": "eth0",
          "DefaultForwardInfo": {
            "NatGatewayId": "nat-7j4mka9wguxj",
            "EipAllocationId": "eip-h29r78ieufbih"
          }
        },
        "SupportGPUDrivers": [
          "470.199.02"
        ],
        "DefaultGPUDriver": "470.199.02",
        "ACS": {
          "ACSQuotaId": "rq-3kbt2gtimmyw7fgfgothocvh",
          "AssociatedProducts": [
            "PAI-DLC"
          ]
        },
        "ResourceSpecs": [
          {
            "WorkspaceId": "122421",
            "Product": "DLC",
            "Specs": [
              {
                "SpecName": "spec_test",
                "IsGuaranteedValid": true,
                "IsOverSoldValid": true,
                "CodeType": "\"\"",
                "Code": "\"\"",
                "Reason": "\"\""
              }
            ]
          }
        ],
        "EnablePreemptSubquotaWorkloads": false,
        "EnableSubQuotaPreemption": true,
        "SubQuotaPreemptionConfig": {
          "PreemptedPriorityUpperBound": 9,
          "PreemptedProducts": [
            "dlc"
          ]
        },
        "EnableGPUShare": true,
        "OversoldUsageConfig": {
          "DisabledBy": "",
          "Disabled": true
        },
        "SelfQuotaPreemptionConfig": {
          "PreemptedPriorities": [
            0
          ],
          "PreemptedProducts": [
            "dlc"
          ],
          "PreemptorPriorities": [
            0
          ]
        },
        "EniCacheConfig": {
          "Enabled": true,
          "CachePoolSize": 0
        },
        "SandboxCacheConfig": {
          "Enabled": true
        },
        "UseCase": "",
        "EnableSelfQuotaPreemption": true,
        "ControlPlaneClusterId": "",
        "IsEncryptedResource": true,
        "WorkloadTypes": [
          ""
        ]
      },
      "Workspaces": [
        {
          "WorkspaceId": "ws123***",
          "WorkspaceName": "myshellprod"
        }
      ],
      "SubQuotas": [
        {
          "QuotaId": "quota12345",
          "QuotaName": "dlc-quota"
        }
      ],
      "QueueStrategy": "PaiStrategyIntelligent",
      "Version": "",
      "QuotaCluster": {
        "ClusterType": "RayCluster",
        "Image": "registry.cn-shanghai.aliyuncs.com/pai-training/kmeans:v1.0.0",
        "DataSources": [
          {
            "DataSourceId": "",
            "MountPath": "",
            "Uri": "oss://test-bucket.oss-cn-hangzhou-internal.aliyuncs.com/path/to/model/output/"
          }
        ],
        "Endpoints": {
          "key": ""
        },
        "Status": ""
      },
      "GPUType": "L20",
      "HyperZones": [
        "A3"
      ]
    }
  ],
  "RequestId": "F082BD0D-21E1-5F9B-81A0-AB07485B03CD",
  "TotalCount": 23
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。