ExecJob

Updated at:

Executes a job.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

sae:ExecJob

create

*All Resource

*

None None

Request syntax

GET /pop/v1/sam/job/execJob HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

AppId

string

Yes

The ID of the job template.

ee1a7a07-abcb-4652-a1d3-2d57f415****

EventId

string

No

The event ID. This parameter is user-defined and used for idempotence. Only one job is created for the same event ID.

custom

Command

string

No

The image startup command. The command must be an executable object that exists in the container. Example:

command:
      - echo
      - abc
      - >
      - file0

Based on the preceding example, Command="echo" and CommandArgs=["abc", ">", "file0"].

echo

CommandArgs

string

No

The arguments for the image startup command. These are the arguments required by the Command startup command. Format:

["a","b"]

In the preceding example, CommandArgs=["abc", ">", "file0"]. The ["abc", ">", "file0"] part must be converted to a string in JSON array format. If this parameter is not required, leave it empty.

["a","b"]

Envs

string

No

The environment variables for the container. You can customize environment variables or reference configuration items. To reference a configuration item, you must first create a ConfigMap instance. For more information, see CreateConfigMap. Valid values:

  • Custom configuration
    • name: the name of the environment variable.

    • value: the value of the environment variable.

  • Referenced configuration items
    • name: the name of the environment variable. You can reference a single key or all keys. To reference all keys, enter sae-sys-configmap-all-, for example, sae-sys-configmap-all-test1.

    • valueFrom: the reference of the environment variable. Set the value to configMapRef.

    • configMapId: the ID of the configuration item.

    • key: the key. If you reference all key-value pairs, do not set this field.

[{"name":"envtmp","value":"0"}]

JarStartOptions

string

No

The startup options for the JAR package job. Default job startup command: $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArg

-Xms4G -Xmx4G

JarStartArgs

string

No

The startup arguments for the JAR package job. Default job startup command: $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs

custom-args

WarStartOptions

string

No

The startup command for the WAR package deployment job. The configuration procedure is the same as that for the image deployment startup command. For more information, see Configure a startup command.

CATALINA_OPTS=\"$CATALINA_OPTS $Options\" catalina.sh run

Time

string

No

The time when the job is triggered. Format: yyyy-MM-dd'T'HH:mm:ss'Z'.

2023-09-14T14:25:02Z

Replicas

string

No

The number of concurrent instances for the job.

3

Response elements

Element

Type

Description

Example

object

The response data.

Code

string

The HTTP status code or POP error code. Valid values:

  • 2xx: Success.

  • 3xx: Redirection.

  • 4xx: Client error.

  • 5xx: Server error.

200

Data

object

The returned data.

Code

string

The HTTP status code or POP error code. Valid values:

  • 2xx: Success.

  • 3xx: Redirection.

  • 4xx: Client error.

  • 5xx: Server error.

200

Data

string

The job ID.

manual-3db7a8fa-5d40-4edc-92e4-49d50eab****

Msg

string

The additional information. Valid values:

  • If the request is successful, success is returned.

  • If the request fails, a specific error code is returned.

success

Success

string

Indicates whether the job was executed successfully. Valid values:

  • true: The execution was successful.

  • false: The execution failed.

true

ErrorCode

string

The error code. Valid values:

  • If the request is successful, the ErrorCode parameter is not returned.

  • If the request fails, the ErrorCode parameter is returned. For more information, see the Error codes section in this topic.

InvalidApplication.NotFound

Message

string

The additional information. Valid values:

  • If the request is successful, success is returned.

  • If the request fails, a specific error code is returned.

success

RequestId

string

The request ID.

67DD9A98-9CCC-5BE8-8C9E-B45E72F4****

Success

boolean

Indicates whether the job was executed successfully. Valid values:

  • true: The execution was successful.

  • false: The execution failed.

true

TraceId

string

The trace ID, which is used to precisely query call information.

0b87b7e716575071334387401e****

Examples

Success response

JSON format

{
  "Code": "200",
  "Data": {
    "Code": "200",
    "Data": "manual-3db7a8fa-5d40-4edc-92e4-49d50eab****",
    "Msg": "success",
    "Success": "true"
  },
  "ErrorCode": "InvalidApplication.NotFound",
  "Message": "success",
  "RequestId": "67DD9A98-9CCC-5BE8-8C9E-B45E72F4****",
  "Success": true,
  "TraceId": "0b87b7e716575071334387401e****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidApplication.NotFound The current application does not exist. The current application cannot be found.
400 JobForbidPolicy You cannot execute new jobs because ongoing jobs exist. A task is being executed. The new task cannot be executed based on the concurrency policy.
400 JobSuspend The job is suspended. The task has been stopped. Enable the task before executing it.
400 user.indebt The user has an outstanding payment. The current user has an overdue payment.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.