Memanggil API DescribeJob untuk mengambil konfigurasi templat pekerjaan.
Coba sekarang
Test
RAM authorization
|
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:
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).
The parameters are described as follows:
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:
|
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"]}} |
| 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 |
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 |
-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:
|
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"]}} |
| 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:
In the example of the Command parameter, |
["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":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:
|
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:
|
[{"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":"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:
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:
In this example, |
echo |
| WarStartOptions |
string |
The options for the startup of a WAR package. The default startup command is |
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 |
| 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.
|
{"type":"time","config":"0 1 */1 * ?","timezone":"GMT+8:00"} |
| ConcurrencyPolicy |
string |
The concurrency policy for the job. Valid values:
|
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 |
| 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 |
Flask==2.0 |
| BestEffortType |
string |
The Best-Effort policy. |
|
| ErrorCode |
string |
The error code.
|
|
| Code |
string |
The HTTP status code or POP error code. Valid values:
|
200 |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
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.