> ## 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/update-ports.json PUT /gpus/v2/instances/{instance_id}/ports
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/{instance_id}/ports:
    put:
      summary: 更新实例端口
      parameters:
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
          description: 枚举值：application/json。
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
          description: Bearer 身份验证格式，例如：Bearer `{{API 密钥}}`。
        - name: instance_id
          in: path
          required: true
          schema:
            type: string
          description: 实例 ID。字符串,长度限制:1-255 字符。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ports
              properties:
                ports:
                  type: array
                  description: 暴露端口列表,用于全量更新实例暴露端口。
                  items:
                    type: object
                    required:
                      - port
                      - protocol
                    properties:
                      port:
                        type: integer
                        description: 端口号。整数,取值范围:[1, 65535]。
                        example: 8080
                      protocol:
                        type: string
                        description: 端口协议。可选值:`tcp`、`http`。
                        example: tcp
                  example:
                    - port: 8080
                      protocol: tcp
                    - port: 8888
                      protocol: http
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object

````