All Products
Search
Document Center

Serverless App Engine:DescribeJob

Last Updated:Jun 11, 2026

Memanggil API DescribeJob untuk mengambil konfigurasi templat pekerjaan.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

sae:DescribeJob

get

*全部资源

*

None None

Sintaks permintaan

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

Parameter permintaan

Parameter

Type

Required

Description

Example

AppId

string

Yes

ID templat pekerjaan.

7171a6ca-d1cd-4928-8642-7d5cfe69****

JobId

string

No

ID pekerjaan.

event-b798157b-40a2-4388-b578-71fb897103**-**

Elemen respons

Element

Type

Description

Example

object

The data returned.

RequestId

string

The request ID.

01CF26C7-00A3-4AA6-BA76-7E95F2A3****

Message

string

Additional information about the call result.

success

TraceId

string

The trace ID used to query the details of a request.

ac1a0b2215622246421415014e****

Data

object

The job template information.

VpcId

string

The VPC ID.

vpc-2ze0i263cnn311nvj****

ConfigMapMountDesc

array<object>

The information about the mounted ConfigMap.

object

The ConfigMap information.

Key

string

Key-value pair in the ConfigMap.

k1

ConfigMapName

string

Name of the ConfigMap.

test

MountPath

string

Mount path in the container.

/tmp

ConfigMapId

integer

ID of the ConfigMap.

1

SecurityGroupId

string

The security group ID.

sg-wz969ngg2e49q5i4****

Jdk

string

The JDK version that the deployment package requires. The following versions are supported:

  • Open JDK 8

  • Open JDK 7

  • Dragonwell 11

  • Dragonwell 8

  • openjdk-8u191-jdk-alpine3.9

  • openjdk-7u201-jdk-alpine3.9

This parameter is not applicable if Package Type is set to Image.

Open JDK 8

ImageUrl

string

The image URL. This parameter is required if Package Type is set to Image.

docker.io/library/nginx:1.14.2

SlsConfigs

string

The configuration for collecting logs to Log Service (SLS).

  • Use an SLS resource that SAE automatically creates: [{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}].

  • Use a custom SLS resource: [{"projectName":"test-sls","logType":"stdout","logDir":"","logstoreName":"sae","logtailName":""},{"projectName":"test","logDir":"/tmp/a.log","logstoreName":"sae","logtailName":""}].

The parameters are described as follows:

  • projectName: The name of the SLS project.

  • logDir: The log path.

  • logType: The log type. stdout specifies the container's standard output logs. You can specify only one log of the stdout type. If this parameter is omitted, file logs are collected.

  • logstoreName: The name of the Logstore in SLS.

  • logtailName: The name of the Logtail configuration in SLS. If you do not specify this parameter, a new Logtail configuration is created.

You can omit this parameter if the Log Service configuration is unchanged during redeployment. To disable log collection, set this parameter to an empty string ("").

[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}]

Tags

array<object>

The tags of the job template.

object

The tag information.

Key

string

Tag key.

k1

Value

string

Tag value.

v1

PackageUrl

string

The URL of the package. This parameter is required if Package Type is set to FatJar or War.

https://edas-bj.oss-cn-beijing.aliyuncs.com/apps/K8s_APP_ID/d4c97c37-aba3-403e-ae1e-6f7d8742****/hello-sae.war

PackageType

string

The type of the job package. Valid values:

  • For Java deployments, FatJar, War, and Image are supported.

  • For PHP deployments, the following package types are supported:

    • PhpZip

    • IMAGE_PHP_5_4

    • IMAGE_PHP_5_4_ALPINE

    • IMAGE_PHP_5_5

    • IMAGE_PHP_5_5_ALPINE

    • IMAGE_PHP_5_6

    • IMAGE_PHP_5_6_ALPINE

    • IMAGE_PHP_7_0

    • IMAGE_PHP_7_0_ALPINE

    • IMAGE_PHP_7_1

    • IMAGE_PHP_7_1_ALPINE

    • IMAGE_PHP_7_2

    • IMAGE_PHP_7_2_ALPINE

    • IMAGE_PHP_7_3

    • IMAGE_PHP_7_3_ALPINE

  • For Python deployments, PythonZip and Image are supported.

War

PreStop

string

The script to execute before the container stops. This script runs before the system deletes the container. Example: {"exec":{"command":["cat","/etc/group"]}}

{"exec":{"command":["cat","/etc/group"]}}

PackageVersion

string

The version of the package. This parameter is required if Package Type is set to FatJar or War.

1.0

JarStartArgs

string

The arguments for the startup of a JAR package. The default startup command is $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs.

start

AppName

string

The name of the job template.

demo-app

AppId

string

The ID of the job template.

7171a6ca-d1cd-4928-8642-7d5cfe69****

JarStartOptions

string

The options for the startup of a JAR package. The default startup command is $JAVA_HOME/bin/java $JarStartOptions -jar $CATALINA_OPTS "$package_path" $JarStartArgs.

-Dtest=true

Replicas

integer

The number of job instances.

2

Memory

integer

The memory required by each instance, in MB. This value cannot be 0. CPU and memory resources are allocated in fixed ratios. The following combinations are supported:

  • 1024: corresponds to 500 millicores and 1,000 millicores.

  • 2048: corresponds to 500, 1,000, and 2,000 millicores.

  • 4096: corresponds to 1,000, 2,000, and 4,000 millicores.

  • 8192: corresponds to 2,000, 4,000, and 8,000 millicores.

  • 12288: corresponds to 12,000 millicores.

  • 16384: corresponds to 4,000, 8,000, and 16,000 millicores.

  • 24576: corresponds to 12,000 millicores.

  • 32768: corresponds to 16,000 millicores.

  • 65536: corresponds to 8,000, 16,000, and 32,000 millicores.

  • 131072: corresponds to 32,000 millicores.

2048

PhpConfig

string

The content of the PHP configuration file.

k1=v1

PhpConfigLocation

string

The mount path of the PHP job startup configuration. Make sure that the PHP server uses this configuration to start.

/usr/local/etc/php/php.ini

PostStart

string

The script to execute after the container starts. This script runs immediately after the system creates the container. Example: {"exec":{"command":["cat","/etc/group"]}}

{"exec":{"command":["cat","/etc/group"]}}

TerminationGracePeriodSeconds

integer

The timeout for a graceful stop, in seconds. Default: 30. Valid values: 1 to 300.

10

CommandArgs

string

The arguments of the image startup command. The arguments are passed to the Command parameter. Format:

["a","b"]

In the example of the Command parameter, CommandArgs=["abc", ">", "file0"]. In this case, ["abc", ">", "file0"] must be converted to a string in the format of a JSON array. If this parameter is not specified, you do not need to configure it.

["a","b"]

NamespaceId

string

The namespace ID.

cn-beijing:test

MountHost

string

The mount target of the Apsara File Storage NAS file system in the job template's VPC. You can omit this parameter if the NAS configuration is unchanged during redeployment. To clear the NAS configuration, set this parameter to an empty string ("").

example.com

TomcatConfig

string

The Tomcat file configuration. To delete the configuration, set this parameter to "" or "{}".

  • port: The port number. Valid values: 1024 to 65535. Ports below 1024 are reserved. If you do not specify a port, the default value is 8080.

  • contextPath: The access path. Default value: /.

  • maxThreads: The maximum number of connections in the connection pool. Default value: 400.

  • uriEncoding: The URI encoding scheme for Tomcat. Valid values: UTF-8, ISO-8859-1, GBK, and GB2312. If you do not specify this parameter, the default value ISO-8859-1 is used.

  • useBodyEncodingForUri: Specifies whether to use the character encoding from the request body for the URI. Default value: true.

{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true}

RegionId

string

The region ID.

cn-beijing

VSwitchId

string

The vSwitch ID.

vsw-2ze559r1z1bpwqxwp****

Cpu

integer

The number of CPU cores that are required by each instance. Unit: millicores. This parameter cannot be set to 0. Only the following fixed specifications are supported:

  • 500

  • 1000

  • 2000

  • 4000

  • 8000

  • 16000

  • 32000

1000

Envs

string

The container environment variables. You can define custom variables or reference a ConfigMap. To reference a ConfigMap, you must first create a ConfigMap. For more information, see CreateConfigMap. The following formats are supported:

  • Define custom variables

    • 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, enter sae-sys-configmap-all-<ConfigMap name>, for 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 of the key-value pair. If you reference all keys in the ConfigMap, you do not need to specify this parameter.

[{"name":"TEST_ENV_KEY","value":"TEST_ENV_VAR"}]

MountDesc

array<object>

The mount description.

object

The mount description.

MountPath

string

Mount path in the container.

/tmp

NasPath

string

Relative path in NAS.

/

CustomHostAlias

string

The custom host mapping in the container. The parameters are described as follows:

  • hostName: The domain name or hostname.

  • ip: The IP address.

[{"hostName":"test.host.name","ip":"0.0.0.0"}]

WebContainer

string

The version of the Tomcat container on which the package depends. The following versions are supported:

  • apache-tomcat-7.0.91

  • apache-tomcat-8.5.42

This parameter is not supported when Package Type is set to Image.

apache-tomcat-7.0.91

Command

string

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

command:
      - echo
      - abc
      - >
      - file0

In this example, Command="echo", CommandArgs=["abc", ">", "file0"].

echo

WarStartOptions

string

The options for the startup of a WAR package. The default startup command is java $JAVA_OPTS $CATALINA_OPTS -Options org.apache.catalina.startup.Bootstrap "$@" start.

custom-option

NasId

string

The ID of the Apsara File Storage NAS file system.

AKSN89**

OssAkId

string

The AccessKey ID for accessing Object Storage Service (OSS) buckets.

xxxxxx

OssAkSecret

string

The AccessKey secret for accessing OSS buckets.

xxxxxx

OssMountDescs

array<object>

The description of the mounted OSS bucket.

object

The description of the mounted OSS bucket.

bucketName

string

Name of the bucket.

oss-bucket

bucketPath

string

Directory or object in OSS. If the directory does not exist, an error occurs.

data/user.data

mountPath

string

Path in the SAE container. If the path exists, it is overwritten. If it does not exist, it is created.

/usr/data/user.data

readOnly

boolean

Whether the container path has read-only access to the mounted resource. Valid values:

  • true: Read-only permission.

  • false: Read and write permission.

true

EdasContainerVersion

string

The version of the runtime environment in the HSF framework, such as an Ali-Tomcat container.

3.5.3

Timezone

string

The time zone. Default value: Asia/Shanghai.

Asia/Shanghai

AppDescription

string

The description of the job template.

Sample application

AcrInstanceId

string

The ID of the Container Registry (ACR) Enterprise Edition instance.

cri-xxxxxx

AcrAssumeRoleArn

string

The ARN of the RAM role that is required to pull images across accounts. For more information, see Pull images across Alibaba Cloud accounts and Grant permissions across Alibaba Cloud accounts by using a RAM role.

acs:ram::123456789012****:role/adminrole

ImagePullSecrets

string

The ID of the Secret.

10

TriggerConfig

string

The job trigger configuration. The configuration varies based on the job type.

  • Scheduled task: Set type to time, config to a Cron expression, and timezone to a specific time zone. Example: {"type":"time","config":"0 1 */1 * ?","timezone":"GMT+8:00"}

  • One-time task: Set type to http, and for config, specify the HTTP trigger rules. For more information, see SourceHttpEventParameters. Example: {"type":"http","config":{"type":"HTTPS","method":["GET"],"ip":[],"referer":[],"securityConfig":"none"}}

{"type":"time","config":"0 1 */1 * ?","timezone":"GMT+8:00"}

ConcurrencyPolicy

string

The concurrency policy for the job. Valid values:

  • Forbid: Forbids concurrent runs. A new job is not created if the previous one has not completed.

  • Allow: Allows concurrent runs.

  • Replace: If the previous job has not completed, the new job replaces it.

Allow

Suspend

boolean

Specifies whether to suspend the job template.

false

Timeout

integer

The timeout period for the job. Unit: seconds.

3600

BackoffLimit

integer

The maximum number of retries for a failed job.

3

Slice

boolean

Specifies whether to enable job sharding.

true

SliceEnvs

string

The parameters for job sharding.

SliceEnvs

RefAppId

string

The ID of the referenced job template.

7171a6ca-d1cd-4928-8642-7d5cfe69****

RefedAppIds

array

The IDs of job templates that reference this template.

string

The job template ID.

8621a6ca-d1cd-4928-8642-7d5cfe69****

PublicWebHookUrls

array

The list of public request URLs for the one-time task.

string

The public URL.

http://***/webhook/putEvents?token=***

VpcWebHookUrls

array

The list of private request URLs for the one-time task.

string

The private URL.

http://***/webhook/putEvents?token=***

ProgrammingLanguage

string

The programming language that is used for the job template. Valid values:

  • java: Java

  • php: PHP

  • python: Python

  • other: Other languages, such as C++, Go, .NET, and Node.js.

java

NasConfigs

string

The configuration for mounting an Apsara File Storage NAS file system.

[{"mountPath":"/test1","readOnly":false,"nasId":"nasId1","mountDomain":"nasId1.cn-shenzhen.nas.aliyuncs.com","nasPath":"/test1"},{"nasId":"nasId2","mountDomain":"nasId2.cn-shenzhen.nas.aliyuncs.com","readOnly":false,"nasPath":"/test2","mountPath":"/test2"}]

Python

string

The Python environment. PYTHON 3.9.15 is supported.

PYTHON 3.9.15

PythonModules

string

The Python module dependencies to install. By default, SAE installs dependencies from a requirements.txt file in the package's root directory. Use this parameter to specify dependencies if a requirements.txt file is not present or to add extra modules.

Flask==2.0

BestEffortType

string

The Best-Effort policy.

ErrorCode

string

The error code.

  • The ErrorCode parameter is returned only if the request fails.

  • For a list of possible ErrorCode values, see the Error codes section in this topic.

Code

string

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

  • 2xx: The request was successful.

  • 3xx: The request was redirected.

  • 4xx: A request error occurred.

  • 5xx: A server error occurred.

200

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

Contoh

Respons sukses

JSONformat

{
  "RequestId": "01CF26C7-00A3-4AA6-BA76-7E95F2A3****",
  "Message": "success",
  "TraceId": "ac1a0b2215622246421415014e****",
  "Data": {
    "VpcId": "vpc-2ze0i263cnn311nvj****",
    "ConfigMapMountDesc": [
      {
        "Key": "k1",
        "ConfigMapName": "test",
        "MountPath": "/tmp",
        "ConfigMapId": 1
      }
    ],
    "SecurityGroupId": "sg-wz969ngg2e49q5i4****",
    "Jdk": "Open JDK 8",
    "ImageUrl": "docker.io/library/nginx:1.14.2",
    "SlsConfigs": "[{\"logDir\":\"\",\"logType\":\"stdout\"},{\"logDir\":\"/tmp/a.log\"}]",
    "Tags": [
      {
        "Key": "k1",
        "Value": "v1"
      }
    ],
    "PackageUrl": "https://edas-bj.oss-cn-beijing.aliyuncs.com/apps/K8s_APP_ID/d4c97c37-aba3-403e-ae1e-6f7d8742****/hello-sae.war",
    "PackageType": "War",
    "PreStop": "{\"exec\":{\"command\":[\"cat\",\"/etc/group\"]}}",
    "PackageVersion": "1.0",
    "JarStartArgs": "start",
    "AppName": "demo-app",
    "AppId": "7171a6ca-d1cd-4928-8642-7d5cfe69****",
    "JarStartOptions": "-Dtest=true",
    "Replicas": 2,
    "Memory": 2048,
    "PhpConfig": "k1=v1",
    "PhpConfigLocation": "/usr/local/etc/php/php.ini",
    "PostStart": "{\"exec\":{\"command\":[\"cat\",\"/etc/group\"]}}",
    "TerminationGracePeriodSeconds": 10,
    "CommandArgs": "[\"a\",\"b\"]",
    "NamespaceId": "cn-beijing:test",
    "MountHost": "example.com",
    "TomcatConfig": "{\"port\":8080,\"contextPath\":\"/\",\"maxThreads\":400,\"uriEncoding\":\"ISO-8859-1\",\"useBodyEncodingForUri\":true}",
    "RegionId": "cn-beijing",
    "VSwitchId": "vsw-2ze559r1z1bpwqxwp****",
    "Cpu": 1000,
    "Envs": "[{\"name\":\"TEST_ENV_KEY\",\"value\":\"TEST_ENV_VAR\"}]",
    "MountDesc": [
      {
        "MountPath": "/tmp",
        "NasPath": "/"
      }
    ],
    "CustomHostAlias": "[{\"hostName\":\"test.host.name\",\"ip\":\"0.0.0.0\"}]",
    "WebContainer": "apache-tomcat-7.0.91",
    "Command": "echo",
    "WarStartOptions": "custom-option",
    "NasId": "AKSN89**",
    "OssAkId": "xxxxxx",
    "OssAkSecret": "xxxxxx",
    "OssMountDescs": [
      {
        "bucketName": "oss-bucket",
        "bucketPath": "data/user.data",
        "mountPath": "/usr/data/user.data",
        "readOnly": true
      }
    ],
    "EdasContainerVersion": "3.5.3",
    "Timezone": "Asia/Shanghai",
    "AppDescription": "Sample application",
    "AcrInstanceId": "cri-xxxxxx",
    "AcrAssumeRoleArn": "acs:ram::123456789012****:role/adminrole",
    "ImagePullSecrets": "10",
    "TriggerConfig": "{\"type\":\"time\",\"config\":\"0 1 */1 * ?\",\"timezone\":\"GMT+8:00\"}",
    "ConcurrencyPolicy": "Allow",
    "Suspend": false,
    "Timeout": 3600,
    "BackoffLimit": 3,
    "Slice": true,
    "SliceEnvs": "SliceEnvs",
    "RefAppId": "7171a6ca-d1cd-4928-8642-7d5cfe69****",
    "RefedAppIds": [
      "8621a6ca-d1cd-4928-8642-7d5cfe69****"
    ],
    "PublicWebHookUrls": [
      "http://***/webhook/putEvents?token=***"
    ],
    "VpcWebHookUrls": [
      "http://***/webhook/putEvents?token=***"
    ],
    "ProgrammingLanguage": "java",
    "NasConfigs": "[{\"mountPath\":\"/test1\",\"readOnly\":false,\"nasId\":\"nasId1\",\"mountDomain\":\"nasId1.cn-shenzhen.nas.aliyuncs.com\",\"nasPath\":\"/test1\"},{\"nasId\":\"nasId2\",\"mountDomain\":\"nasId2.cn-shenzhen.nas.aliyuncs.com\",\"readOnly\":false,\"nasPath\":\"/test2\",\"mountPath\":\"/test2\"}]",
    "Python": "PYTHON 3.9.15",
    "PythonModules": "Flask==2.0",
    "BestEffortType": ""
  },
  "ErrorCode": "",
  "Code": "200",
  "Success": true
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

404 InvalidAppId.NotFound The specified AppId does not exist.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.