ExecJob

更新时间:
复制 MD 格式

Call ExecJob to run 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

*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 job template ID.

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

EventId

string

No

A customizable event ID that ensures idempotency. The system creates only one job for requests that have the same event ID.

custom

Command

string

No

The startup command, which must be an executable that exists in the container. Example:

command:
      - echo
      - abc
      - >
      - file0

Based on this example, Command is echo and CommandArgs is ["abc", ">", "file0"].

echo

CommandArgs

string

No

The arguments for the Command parameter. The value must be a string that represents a JSON array. Format:

["a","b"]

In the preceding example for the Command parameter, CommandArgs is ["abc", ">", "file0"]. The JSON array ["abc", ">", "file0"] must be converted to a string. This parameter is optional.

["a","b"]

Envs

string

No

The container environment variables. You can specify custom environment variables or reference an existing ConfigMap. For more information about creating a ConfigMap, see CreateConfigMap.

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

    • value: The value of the environment variable.

  • Reference a ConfigMap
    • name: The name of the environment variable. You can reference a single key or all keys. To reference all keys, use the sae-sys-configmap-all-<ConfigMap name> format. Example: sae-sys-configmap-all-test1.

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

    • configMapId: The ID of the ConfigMap.

    • key: The key that you want to reference. If you want to reference all key-value pairs, do not specify this parameter.

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

JarStartOptions

string

No

Options for starting a job deployed from a JAR package. The default startup command is: $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArg

-Xms4G -Xmx4G

JarStartArgs

string

No

Arguments for starting a job deployed from a JAR package. The default startup command is: $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs

custom-args

WarStartOptions

string

No

The startup command for a job deployed from a WAR package. Configuration is the same as for an image-based deployment. For more information, see Configure a startup command.

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

Time

string

No

The time to trigger the job, specified in the yyyy-MM-dd'T'HH:mm:ss'Z' format.

2023-09-14T14:25:02Z

Replicas

string

No

The number of concurrent instances.

3

Response elements

Element

Type

Description

Example

object

The returned data.

RequestId

string

The request ID.

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

Message

string

The returned message.

  • If the request is successful, success is returned.

  • If the request fails, an error code is returned.

success

TraceId

string

The trace ID for retrieving detailed information about the call.

0b87b7e716575071334387401e****

Data

object

The returned data.

Data

string

The job ID.

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

Msg

string

The returned message.

  • If the request is successful, success is returned.

  • If the request fails, an error code is returned.

success

Success

string

Whether the job was successfully executed.

  • true: The execution was successful.

  • false: The execution failed.

true

Code

string

The HTTP status code or a POP error code.

  • 2xx: Success.

  • 3xx: Redirection.

  • 4xx: Request error.

  • 5xx: Server error.

200

ErrorCode

string

The error code.

  • This parameter is omitted for successful requests.

  • This parameter is included for failed requests. For more information, see the Error codes section of this topic.

Code

string

The HTTP status code or a POP error code.

  • 2xx: Success.

  • 3xx: Redirection.

  • 4xx: Request error.

  • 5xx: Server error.

200

Success

boolean

Indicates whether the request was successful.

  • true: The request was successful.

  • false: The request failed.

true

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidApplication.NotFound The current application does not exist.
400 JobForbidPolicy You cannot execute new jobs because ongoing jobs exist.
400 JobSuspend The job is suspended.
400 user.indebt The user has an outstanding payment.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.