---
title: "增加环境变量"
method: POST
path: "/v2/tenants/{tenant_name}/services/{service_alias}/env"
tags: ["v2"]
---

# 增加环境变量

`POST /v2/tenants/{tenant_name}/services/{service_alias}/env`

## Request

- The document declares no server URL.
- Auth: none declared

add env var

## Path parameters

- `tenant_name` string, required
- `service_alias` string, required

## Request body

- object
  - `container_port` integer: 端口 in: body
  - `env_name` string, required: 变量名称 in: body
  - `env_value` string: 变量值, 增加时需要传值, 删除时可以不传 in: body
  - `is_change` boolean: 是否可以修改 in: body
  - `name` string: name in: body
  - `scope` string: 应用范围: inner or outer or both in: body

## Response `default`

统一返回格式

- CommandResponse (unresolved $ref)

---

[API](https://skmtc.dev/goodrain/apis/goodrain-cmd-api.md) - [All operations](https://skmtc.dev/goodrain/apis/goodrain-cmd-api/llms.txt) - [OpenAPI document](https://skmtc.dev/goodrain/apis/goodrain-cmd-api/revisions/8c773e222448?raw)
