> ## Documentation Index
> Fetch the complete documentation index at: https://ppio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 查询实例列表



## OpenAPI

````yaml gpus/v2-spec/list-instance.json GET /gpus/v2/instances
openapi: 3.0.0
info:
  title: PPIO GPU API v2
  version: 2.0.0
servers:
  - url: https://api.ppio.com
security: []
paths:
  /gpus/v2/instances:
    get:
      summary: 查询实例列表
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
          description: Bearer 身份验证格式，例如：Bearer `{{API 密钥}}`。
        - name: limit
          in: query
          required: false
          schema:
            type: integer
          description: 本次最多返回的实例数量。不传或为 0 时使用服务端默认值。整数,取值 >= 0。
          example: 20
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: 下一页游标。第一页不传或传空字符串,后续请求使用上一次响应中的 `next_cursor`。字符串,长度限制:0-1024 字符。
        - name: name
          in: query
          required: false
          schema:
            type: string
          description: 实例名称或 ID 模糊匹配。字符串,长度限制:0-255 字符。
          example: example
        - name: status
          in: query
          required: false
          schema:
            type: string
          description: 实例状态过滤。字符串,长度限制:0-63 字符。
          example: running
        - name: regions
          in: query
          required: false
          schema:
            type: string
          description: 实例所在区域过滤,多个用英文逗号分隔。字符串,长度限制:0-1024 字符。
          example: region-id
        - name: billing_mode
          in: query
          required: false
          schema:
            type: string
          description: 计费模式过滤。可选值:`postpaid`、`prepaid`、`spot`。留空字符串时不过滤。
          example: prepaid
      responses:
        '200':
          description: 查询成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: 实例列表
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: 实例 ID
                          example: ca338f12f3
                        name:
                          type: string
                          description: 实例名称
                          example: example-instance
                        type:
                          type: string
                          description: 实例类型。可选值:`gpu`、`cpu`
                          example: gpu
                        product_id:
                          type: string
                          description: 产品 ID
                          example: product-id
                        image:
                          type: string
                          description: 镜像地址
                          example: registry.example.com/namespace/image:tag
                        registry_auth_id:
                          type: string
                          description: 镜像仓库认证 ID
                          example: registry-auth-id
                        entrypoint:
                          type: string
                          description: 容器 entrypoint
                          example: ''
                        command:
                          type: string
                          description: 容器启动命令
                          example: ''
                        billing:
                          type: object
                          description: 计费配置
                          properties:
                            mode:
                              type: string
                              description: 计费模式。可选值:`postpaid`、`prepaid`、`spot`
                              example: prepaid
                            prepaid:
                              type: object
                              description: 包年包月配置,`mode=prepaid` 时存在
                              properties:
                                months:
                                  type: integer
                                  description: 购买月数
                                  example: 1
                                end_time:
                                  type: integer
                                  description: 包年包月结束时间。Unix 时间戳
                                auto_renew:
                                  type: object
                                  description: 自动续费配置
                                  properties:
                                    enabled:
                                      type: boolean
                                      description: 是否开启自动续费
                                      example: true
                                    months:
                                      type: integer
                                      description: 自动续费月数
                                      example: 1
                                    status:
                                      type: string
                                      description: 自动续费状态
                                      example: active
                        envs:
                          type: array
                          description: 环境变量列表
                          items:
                            type: object
                            properties:
                              key:
                                type: string
                                description: 环境变量名
                                example: ENV_NAME
                              value:
                                type: string
                                description: 环境变量值
                                example: ENV_VALUE
                        ports:
                          type: array
                          description: 暴露端口列表
                          items:
                            type: object
                            properties:
                              port:
                                type: integer
                                description: 端口号
                                example: 8080
                              protocol:
                                type: string
                                description: 端口协议
                                example: tcp
                              endpoint:
                                type: string
                                description: 外部访问地址(运行时分配)
                                example: http://1.2.3.4:8080
                        resource_specs:
                          type: object
                          description: 资源规格(含系统分配信息)
                          properties:
                            rootfs_size_gb:
                              type: integer
                              description: 系统盘大小。单位为 GB
                              example: 20
                            gpu_num:
                              type: integer
                              description: GPU 数量
                              example: 1
                            cpu_num:
                              type: integer
                              description: CPU 核数(系统分配)
                              example: 8
                            memory_gb:
                              type: integer
                              description: 内存大小。单位为 GB(系统分配)
                              example: 32
                            gpu_ids:
                              type: array
                              items:
                                type: integer
                              description: 分配到的 GPU 卡序号
                              example:
                                - 0
                        network:
                          type: object
                          description: VPC 网络配置
                          properties:
                            id:
                              type: string
                              description: Network VPC ID
                              example: ''
                            ip:
                              type: string
                              description: VPC 给实例分配的 IP
                              example: 10.2.1.1
                        volumes:
                          type: array
                          description: 数据盘/网络存储挂载列表
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                                description: 存储类型。可选值:`local`、`network`
                                example: network
                              id:
                                type: string
                                description: 存储 ID,通常用于 `network` 类型
                                example: network-storage-id
                              mount_point:
                                type: string
                                description: 挂载路径
                                example: /data
                        region:
                          type: string
                          description: 实例所在区域
                          example: region-id
                        auto_migrate:
                          type: object
                          description: 自动迁移配置
                          properties:
                            enabled:
                              type: boolean
                              description: 是否开启自动迁移
                              example: false
                            include_system_disk:
                              type: boolean
                              description: 自动迁移时是否包含系统盘
                              example: false
                        status:
                          type: object
                          description: 实例状态信息
                          properties:
                            status:
                              type: string
                              description: 实例状态
                              example: running
                            error:
                              type: string
                              description: 错误码
                              example: ''
                            message:
                              type: string
                              description: 状态描述
                              example: ''
                        created_at:
                          type: integer
                          description: 实例创建时间。Unix 时间戳
                          example: 1714464000
                        last_started_at:
                          type: integer
                          description: 最近一次启动时间。Unix 时间戳
                          example: 1714467600
                        last_stopped_at:
                          type: integer
                          description: 最近一次停止时间。Unix 时间戳
                          example: 0
                        member_id:
                          type: string
                          description: 创建者 member ID
                          example: member-id
                        owner_id:
                          type: string
                          description: 所属用户 ID(团队所有者 UUID)
                          example: 550e8400-e29b-41d4-a716-446655440000
                        region_version:
                          type: string
                          description: 实例版本
                          example: v1
                  next_cursor:
                    type: string
                    description: 下一页游标。无下一页时为空字符串
                    example: next-cursor-token
                  has_more:
                    type: boolean
                    description: 是否还有下一页
                    example: true

````