{"base_path":null,"components":null,"consumes":"[\"application/json\",\"application/json;charset=utf-8\"]","definitions":{"BaseResp":{"description":"API响应基类。","properties":{"error_code":{"description":"错误码,失败时返回。","example":"WKS.00139901","readOnly":true,"type":"string"},"error_msg":{"description":"错误描述。","example":"The request message is invalid.","readOnly":true,"type":"string"}}},"CreateScriptReq":{"description":"创建脚本信息。","properties":{"content":{"description":"脚本内容。","maxLength":100000,"minLength":1,"type":"string"},"description":{"description":"描述。","example":"xxx","maxLength":256,"minLength":0,"type":"string"},"name":{"description":"脚本名称。","example":"Script01","type":"string"},"type":{"description":"脚本类型:POWERSHELL/BAT/SHELL。","enum":["POWERSHELL","BAT","SHELL"],"type":"string"},"version":{"description":"脚本版本。","maxLength":128,"minLength":0,"type":"string"}},"required":["content","name","type"]},"CreateScriptResp":{"description":"创建脚本响应。","properties":{"script_id":{"description":"脚本ID。","example":"xxx122","type":"string"}}}},"description":null,"group_id":"7383c32d5d5e4d0481c071faeb994404","host":"workspace.cn-north-4.myhuaweicloud.com","id":"6583cab0af7348e4ac198ecc8f945515","info_version":"v2","method":"post","name":"CreateScript","parameters":{},"paths":{"/v2/{project_id}/scripts":{"post":{"description":"新增脚本。","operationId":"CreateScript","parameters":[{"description":"用户Token。\n通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。","in":"header","maxLength":102400,"minLength":1,"name":"X-Auth-Token","required":false,"type":"string","x-example":"MIIDkgYJKoZIhvcNAQcCoIIDgzCCXXXXXX..."},{"description":"项目ID。","in":"path","maxLength":128,"minLength":1,"name":"project_id","required":true,"type":"string","x-example":"2b31ed520xxxxxxebedb6e57xxxxxxxx"},{"description":"创建脚本信息。","in":"body","name":"CreateScriptRequestBody","required":true,"schema":{"$ref":"#/definitions/CreateScriptReq"}}],"responses":{"200":{"description":"成功响应。","examples":{"application/json":{"script_id":"xxx122"}},"schema":{"$ref":"#/definitions/CreateScriptResp"}},"400":{"description":"由于包含语法错误,当前请求无法被服务器理解。","schema":{"$ref":"#/definitions/BaseResp"}},"401":{"description":"鉴权失败。","schema":{"$ref":"#/definitions/BaseResp"}},"403":{"description":"没有操作权限。","schema":{"$ref":"#/definitions/BaseResp"}},"404":{"description":"找不到资源。","schema":{"$ref":"#/definitions/BaseResp"}},"405":{"description":"请求中指定的方法不被允许。","schema":{"$ref":"#/definitions/BaseResp"}},"500":{"description":"服务内部错误,具体返回错误码请参见错误码说明。","schema":{"$ref":"#/definitions/BaseResp"}},"503":{"description":"服务不可用。","schema":{"$ref":"#/definitions/BaseResp"}}},"schemes":["https"],"security":[{"apig-auth-iam-used-authn5":[]}],"summary":"新增脚本","tags":["Script"],"x-api-type":"open-api","x-apiexplorer-hide":"N","x-apig-group":"public,internal_token","x-apigateway-backend":{"httpVpcEndpoints":{"description":"","method":"POST","name":"wks-appcenter-lb","path":"/v2/{project_id}/scripts","scheme":"https","timeout":30000},"parameters":[{"description":"","in":"header","name":"X-Auth-Token","origin":"request","value":"X-Auth-Token"},{"description":"","in":"path","name":"project_id","origin":"request","value":"project_id"}],"type":"HTTP-VPC"},"x-apigateway-cors":false,"x-apigateway-match-mode":"NORMAL","x-apigateway-ratelimit":"workspace_default_operate","x-apigateway-request-type":"public","x-is-registered":"Y","x-request-examples-1":{"content":"string","description":"xxx","name":"Script01","type":"string","version":"string"},"x-request-examples-text-1":{"content":"string","description":"xxx","name":"Script01","type":"string","version":"string"},"x-support-apig-group":"workspace","x-support-sdk":"Y"}}},"product_short":"Workspace","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":{"apig-auth-app":{"in":"header","name":"Authorization","type":"apiKey","x-apigateway-auth-type":"AppSigv1"},"apig-auth-iam":{"in":"header","name":"unused","type":"apiKey","x-apigateway-auth-type":"IAM"},"apig-auth-iam-used-authn5":{"in":"header","name":"unused","type":"apiKey","x-apigateway-auth-opt":{"inner-auth-type":"iam_auth_n5"},"x-apigateway-auth-type":"IAM"}},"summary":"新增脚本","tags":"脚本","uri":null,"version":"2.0"}