创建环境
POST
/api/v1/projects/{projectId}/environments请求参数
Path 参数
projectId
string
必需
示例值:
{{projectId}}
Body 参数application/json
name
string
必需
baseUrls
string
必需
序列化后的 JSON
variables
string
必需
序列化后的 JSON
visibility
string
可选
protected 表示共有
示例
{
"name": "测试环境2",
"baseUrls": "{ \"default\": \"http://127.0.0.1:8888\"}",
"visibility": "protected",
"variables": "[{\"name\":\"envVar\",\"value\":\"1\",\"description\":\"envVar desc\",\"isFixedValue\":true}]"
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
data
#/definitions/83720777必需
success
boolean
必需
示例
{
"data": {
"baseUrl": "http://127.0.0.1:8888",
"baseUrls": {
"default": "http://127.0.0.1:8888"
},
"parameters": {
"cookie": [],
"query": [],
"header": [],
"body": []
},
"variables": [
{
"name": "envVar",
"value": "1",
"description": "envVar desc",
"isFixedValue": true
}
],
"registrationCenters": [],
"tags": [],
"type": "normal",
"id": 18411999,
"projectType": "HTTP",
"name": "测试环境",
"visibility": "protected",
"creatorId": 377134,
"editorId": 377134,
"projectId": 2074249,
"ordering": 30,
"updatedAt": "2024-02-27T03:03:24.329Z",
"createdAt": "2024-02-27T03:03:24.329Z"
},
"success": true
}
最后修改时间: 9 个月前