Description
Modifies an App. A new version is added upon each modification.
If you specify the App name when submitting a job, the latest version is used. Currently, use of an earlier version is not supported.
Request
PUT /apps/{AppName}
{
"Name": "test-copy",
"Description": "Copy input file to output file",
"CommandLine": "cp -rf ${inputFile} ${outputFile}",
"Daemonize": false,
"EnvVars": {
"env-k3": "env-v3",
"env-k5": "env-v5"
},
"VM": {
"ECSImageId": "img-centos"
},
"Docker": {
"Image": "ubuntu:14.04",
"RegistryOSSPath": "oss://bucket/registry"
}
}
Request parameters
Parameter
Parameter | Type | Required or not | Description |
---|---|---|---|
AppName | String | Yes | Name of the App |
Name | String | Yes | Name of the App. It must be the same as AppName in the request line. |
Description | String | No | Detailed description of the App. The length cannot exceed 1000 characters.Default value: null |
Docker | object(Docker) | No | Configuration related to the Docker image |
VM | object(VM) | No | Configuration related to the ECS instance |
CommandLine | String | Yes | Command line for running the App.The length cannot exceed 1000 characters. |
EnvVars | map |
No | Environmental variable. Map must be a value between 0 and 10.The valid character set of Key is [a-zA-Z0-9_-], and the length of Key cannot exceed 100 characters.The length of Value cannot exceed 1000 characters.Default value:{} |
Daemonize | boolean | No | Specifies whether to restart when the App is executed. The default value is false. |
Docker
Parameter | Type | Required or not | Description |
---|---|---|---|
Image | String | Yes | Docker image.The length cannot exceed 1000 characters. |
RegistryOSSPath | String | No | Root directory of the Docker registry storage on the OSS instance.The length cannot exceed 1000 characters.Default value: null |
VM
Parameter | Type | Required or not | Description |
---|---|---|---|
ECSImageId | String | Yes | ID of the ECS image.The valid character set is [a-zA-Z0-9_-]. The length cannot exceed 100 characters. |
Response
Response status code
200
Response body
None.
Examples
Request:
PUT /apps/myapp HTTP/1.1
{
"Name": "myapp",
"Description": "new app description",
"Type": "Docker",
"InputParameters": {
"inputFile": {
"Type": "String",
"LocalPath": "/tmp/infile"
}
},
"OutputParameters": {
"outputFile": {
"Type": "String",
"LocalPath": "/tmp/outfile"
}
},
"Docker": {
"Image": "new_image",
"RegistryOSSPath": "oss://bucket/registry"
},
"CommandLine": "cp ${inputFile} ${outputFile} "
}
Response:
HTTP/1.1 200 OK