> ## 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/upgrade-instance.json PUT /gpus/v2/instances/{instance_id}/upgrade
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}/upgrade:
    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:
                - image
              properties:
                image:
                  type: string
                  description: 镜像地址。字符串,长度限制:1-500 字符。
                  example: registry.example.com/namespace/new-image:tag
                registry_auth_id:
                  type: string
                  description: 已保存的镜像认证 ID。字符串,长度限制:0-255 字符。
                  example: registry-auth-id
                entrypoint:
                  type: string
                  description: 容器 entrypoint。
                  example: ''
                command:
                  type: string
                  description: 容器启动命令。
                  example: ''
                envs:
                  type: array
                  description: 环境变量列表。
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        description: 环境变量名。字符串,长度限制:0-511 字符。
                        example: ENV_NAME
                      value:
                        type: string
                        description: 环境变量值。字符串,长度限制:0-4095 字符。
                        example: ENV_VALUE
                  example:
                    - key: ENV_NAME
                      value: ENV_VALUE
                save_data:
                  type: boolean
                  description: 升级/重置实例时是否保留已有数据。
                  example: true
      responses:
        '200':
          description: 升级成功
          content:
            application/json:
              schema:
                type: object

````