All Products
Search
Document Center

ModifyApp

Last Updated: Aug 04, 2021

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}

  1. {
  2. "Name": "test-copy",
  3. "Description": "Copy input file to output file",
  4. "CommandLine": "cp -rf ${inputFile} ${outputFile}",
  5. "Daemonize": false,
  6. "EnvVars": {
  7. "env-k3": "env-v3",
  8. "env-k5": "env-v5"
  9. },
  10. "VM": {
  11. "ECSImageId": "img-centos"
  12. },
  13. "Docker": {
  14. "Image": "ubuntu:14.04",
  15. "RegistryOSSPath": "oss://bucket/registry"
  16. }
  17. }

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:

  1. PUT /apps/myapp HTTP/1.1
  2. {
  3. "Name": "myapp",
  4. "Description": "new app description",
  5. "Type": "Docker",
  6. "InputParameters": {
  7. "inputFile": {
  8. "Type": "String",
  9. "LocalPath": "/tmp/infile"
  10. }
  11. },
  12. "OutputParameters": {
  13. "outputFile": {
  14. "Type": "String",
  15. "LocalPath": "/tmp/outfile"
  16. }
  17. },
  18. "Docker": {
  19. "Image": "new_image",
  20. "RegistryOSSPath": "oss://bucket/registry"
  21. },
  22. "CommandLine": "cp ${inputFile} ${outputFile} "
  23. }

Response:

  1. HTTP/1.1 200 OK