All Products
Search
Document Center

ModifyApp

Last Updated: Nov 02, 2018

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": string,
  3. "Description": string,
  4. "InputParameters": {
  5. string: {
  6. "Description": string,
  7. "Type": string,
  8. "Default": string,
  9. "LocalPath": string
  10. },
  11. ...
  12. },
  13. "OutputParameters": {
  14. string: {
  15. "Description": string,
  16. "Type": string,
  17. "Default": string,
  18. "LocalPath": string
  19. },
  20. ...
  21. },
  22. // begin union
  23. // only one of the following can be specified:
  24. "Docker": {
  25. "Image": string,
  26. "RegistryOSSPath": string
  27. },
  28. "VM": {
  29. "ECSImageId": string
  30. },
  31. // end union
  32. "CommandLine": string,
  33. "EnvVars": {
  34. string: string,
  35. ...
  36. },
  37. "Daemonize": boolean,
  38. "Config": {
  39. "ResourceType": {
  40. "Description": string,
  41. "Default": string,
  42. "Overwritable": boolean
  43. },
  44. "InstanceType": {
  45. "Description": string,
  46. "Default": string,
  47. "Overwritable": boolean
  48. },
  49. "InstanceCount": {
  50. "Description": string,
  51. "Default": number,
  52. "Overwritable": boolean
  53. },
  54. "MinDiskSize": {
  55. "Description": string,
  56. "Default": number,
  57. "Overwritable": boolean
  58. },
  59. "DiskType": {
  60. "Description": string,
  61. "Default": string,
  62. "Overwritable": boolean
  63. },
  64. "MaxRetryCount": {
  65. "Description": string,
  66. "Default": number,
  67. "Overwritable": boolean
  68. },
  69. "Timeout": {
  70. "Description": string,
  71. "Default": number,
  72. "Overwritable": boolean
  73. }
  74. }
  75. }

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
InputParameters map No Input parameter list of the App. It must be the same as that when the App is created.
OutputParameters map No Output parameter list of the App. It must be the same as that when the App is created.
Docker object No Configuration related to the Docker image
VM object 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.
Config object No Runtime parameters when the job is submitted.It must be the same as that when the App is created.

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