Memperbarui templat pekerjaan dengan memanggil operasi UpdateJob.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sae:UpdateJob |
update |
*全部资源
|
None | None |
Sintaks permintaan
POST /pop/v1/sam/job/updateJob HTTP/1.1
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| AppId |
string |
Yes |
ID templat pekerjaan yang akan diperbarui. |
7171a6ca-d1cd-4928-8642-7d5cfe69**** |
| Jdk |
string |
No |
Versi Java Development Kit (JDK) yang menjadi dependensi Paket Penerapan. Nilai valid:
Parameter ini tidak didukung ketika Package Type diatur ke Image. |
Open JDK 8 |
| WebContainer |
string |
No |
Versi Tomcat yang menjadi dependensi Paket Penerapan. Nilai valid:
Parameter ini tidak didukung ketika Package Type diatur ke Image. |
apache-tomcat-7.0.91 |
| PackageVersion |
string |
No |
Versi Paket Penerapan. Parameter ini wajib diisi jika Package Type diatur ke FatJar, War, atau PythonZip. |
1.0.1 |
| PackageUrl |
string |
No |
URL Paket Penerapan. Parameter ini wajib diisi jika Package Type diatur ke FatJar, War, atau PythonZip. |
http://myoss.oss-cn-hangzhou.aliyuncs.com/my-buc/2019-06-30/****.jar |
| ImageUrl |
string |
No |
URL image. Parameter ini wajib diisi jika Package Type diatur ke Image. |
registry.cn-hangzhou.aliyuncs.com/sae_test/ali_sae_test:0.0.1 |
| Command |
string |
No |
Perintah startup image. Perintah harus berupa objek yang dapat dieksekusi dan ada di dalam kontainer. Contoh:
Pada contoh ini, |
echo |
| CommandArgs |
string |
No |
Argumen Command startup image. Nilai harus berupa array JSON yang dikonversi menjadi string. Format:
Pada contoh sebelumnya, |
["a","b"] |
| Envs |
string |
No |
Variabel lingkungan Kontainer. Anda dapat menyesuaikan variabel lingkungan atau mereferensikan variabel dari ConfigMap. Untuk mereferensikan ConfigMap, Anda harus terlebih dahulu membuat Instans ConfigMap. Untuk informasi selengkapnya, lihat CreateConfigMap. Nilai berupa string JSON. Bidang berikut didukung:
|
[{"name":"envtmp","value":"0"}] |
| CustomHostAlias |
string |
No |
Pemetaan kustom antara hostname dan alamat IP di dalam Kontainer. Nilai berupa string JSON. Bidang berikut didukung:
|
[{"hostName":"samplehost","ip":"127.0.0.1"}] |
| JarStartOptions |
string |
No |
Opsi paket JAR untuk memulai aplikasi. Perintah startup default aplikasi adalah: |
custom-option |
| JarStartArgs |
string |
No |
Argumen paket JAR untuk memulai aplikasi. Perintah startup default aplikasi adalah: |
-Xms4G -Xmx4G |
| EdasContainerVersion |
string |
No |
Versi lingkungan runtime aplikasi di High-speed Service Framework (HSF), seperti Kontainer Ali-Tomcat. |
3.5.3 |
| SlsConfigs |
string |
No |
Konfigurasi untuk mengumpulkan log ke Log Service.
Bidang berikut didukung:
Jika konfigurasi SLS tidak diubah selama Penerapan, Anda tidak perlu mengonfigurasi parameter ini. Untuk berhenti menggunakan fitur pengumpulan log, atur nilai parameter ini ke string kosong ( Catatan
Proyek yang dibuat secara otomatis dengan templat pekerjaan akan dihapus ketika templat pekerjaan dihapus. Oleh karena itu, saat Anda memilih proyek yang ada, jangan pilih proyek yang dibuat secara otomatis oleh SAE. |
[{"logDir":"","logType":"stdout"},{"logDir":"/tmp/a.log"}] |
| Timezone |
string |
No |
Zona pengatur waktu. Nilai default: Asia/Shanghai. |
Asia/Shanghai |
| NasId |
string |
No |
ID sistem file Apsara File Storage NAS. Jika konfigurasi tidak diubah selama penerapan, Anda tidak perlu mengonfigurasi parameter ini. Untuk menghapus konfigurasi NAS, atur nilai parameter ini ke string kosong ( |
10d3b4**** |
| MountHost |
string |
No |
Titik memasang sistem file NAS di virtual private cloud (VPC) tempat templat pekerjaan berada. Jika konfigurasi tidak diubah selama Penerapan, Anda tidak perlu mengonfigurasi parameter ini. Untuk menghapus konfigurasi NAS, atur nilai parameter ini ke string kosong ( |
10d3b4bc9****.com |
| MountDesc |
string |
No |
Deskripsi memasang NAS. Jika konfigurasi tidak diubah selama Penerapan, Anda tidak perlu mengonfigurasi parameter ini. Untuk menghapus konfigurasi NAS, atur nilai parameter ini ke string kosong ( |
[{mountPath: "/tmp", nasPath: "/"}] |
| PostStart |
string |
No |
Skrip yang dieksekusi setelah kontainer dimulai. Contoh: |
{"exec":{"command":["sh","-c","echo hello"]}} |
| PreStop |
string |
No |
Skrip yang dieksekusi sebelum kontainer dihentikan. Contoh: |
{"exec":{"command":["sh","-c","echo hello"]}} |
| WarStartOptions |
string |
No |
Perintah startup untuk aplikasi yang diterapkan dalam paket WAR. Prosedurnya sama dengan mengonfigurasi perintah startup untuk image. Untuk informasi selengkapnya, lihat Set a startup command. |
CATALINA_OPTS=\"$CATALINA_OPTS $Options\" catalina.sh run |
| ConfigMapMountDesc |
string |
No |
Deskripsi Instans ConfigMap yang dipasang ke Kontainer. Anda dapat menggunakan Instans ConfigMap yang dibuat di halaman Konfigurasi Namespace untuk menyuntikkan konfigurasi ke dalam Kontainer. Nilai berupa string JSON. Bidang berikut didukung:
Catatan
Anda dapat meneruskan parameter
|
[{"configMapId":16,"key":"test","mountPath":"/tmp"}] |
| TerminationGracePeriodSeconds |
integer |
No |
Periode pengatur waktu tunggu shutdown yang mulus. Nilai default: 30. Unit: seconds. Nilai valid: 1 hingga 300. |
10 |
| PhpConfigLocation |
string |
No |
Jalur tempat file konfigurasi startup aplikasi PHP dipasangkan. Pastikan server PHP menggunakan file konfigurasi ini untuk memulai aplikasi. |
/usr/local/etc/php/php.ini |
| PhpConfig |
string |
No |
Konten file konfigurasi PHP. |
k1=v1 |
| TomcatConfig |
string |
No |
Konfigurasi file Tomcat. Jika Anda mengatur parameter ini ke "" atau "{}", konfigurasi akan dihapus. Nilai berupa string JSON. Bidang berikut didukung:
|
{"port":8080,"contextPath":"/","maxThreads":400,"uriEncoding":"ISO-8859-1","useBodyEncodingForUri":true} |
| OssMountDescs |
string |
No |
Deskripsi memasang OSS. Nilai berupa string JSON. Bidang berikut didukung:
|
[{"bucketName": "oss-bucket", "bucketPath": "data/user.data", "mountPath": "/usr/data/user.data", "readOnly": true}] |
| OssAkId |
string |
No |
AccessKey ID yang digunakan untuk membaca dan menulis data ke OSS. |
xxxxxx |
| OssAkSecret |
string |
No |
Rahasia AccessKey yang digunakan untuk membaca dan menulis data ke OSS. |
xxxxxx |
| Php |
string |
No |
Versi PHP. |
cri-xxxxxx |
| AcrInstanceId |
string |
No |
ID Instans Container Registry Edisi Perusahaan. Parameter ini wajib diisi jika ImageUrl diatur ke image di Instans Container Registry Edisi Perusahaan. |
cri-xxxxxx |
| AcrAssumeRoleArn |
string |
No |
Nama Sumber Daya Alibaba Cloud (ARN) Peran RAM yang diperlukan untuk menarik image lintas akun. Untuk informasi selengkapnya, lihat Grant permissions across Alibaba Cloud accounts by using a RAM role. |
acs:ram::123456789012****:role/adminrole |
| ImagePullSecrets |
string |
No |
ID rahasia. |
10 |
| EnableImageAccl |
boolean |
No |
Apakah akan mengaktifkan akselerasi image. |
|
| TriggerConfig |
string |
No |
Konfigurasi Pemicu. Konfigurasi parameter ini berdasarkan jenis Pekerjaan.
|
{"type":"time","config":"0 1 */1 * ?","timezone":"GMT+8:00"} |
| ConcurrencyPolicy |
string |
No |
Kebijakan untuk menjalankan Pekerjaan Berjalan konkuren. Nilai valid:
|
Allow |
| Timeout |
integer |
No |
Periode pengatur waktu tunggu untuk Pekerjaan. Unit: seconds. |
3600 |
| BackoffLimit |
integer |
No |
Jumlah percobaan ulang untuk pekerjaan. |
3 |
| Slice |
boolean |
No |
Apakah akan mengaktifkan sharding pekerjaan. |
true |
| SliceEnvs |
string |
No |
Parameter untuk sharding pekerjaan. |
[0,1,2] |
| Replicas |
string |
No |
Jumlah instans konkuren untuk pekerjaan. |
3 |
| RefAppId |
string |
No |
ID aplikasi yang direferensikan. |
7171a6ca-d1cd-4928-8642-7d5cfe69**** |
| ProgrammingLanguage |
string |
No |
Bahasa pemrograman. Nilai valid: java, php, python, dan shell. |
java |
| Python |
string |
No |
Lingkungan Python. PYTHON 3.9.15 didukung. |
PYTHON 3.9.15 |
| PythonModules |
string |
No |
Dependensi modul kustom. Secara default, dependensi yang didefinisikan dalam file requirements.txt di direktori root paket akan diinstal. Jika Anda tidak mengonfigurasi parameter ini atau paket tidak memiliki file requirements.txt, Anda dapat menentukan dependensi yang ingin diinstal. |
Flask==2.0 |
| NasConfigs |
string |
No |
Konfigurasi untuk memasang sistem file NAS. |
|
| BestEffortType |
string |
No |
Kebijakan BestEffort. |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Information about the updated job template. |
||
| RequestId |
string |
The request ID. |
01CF26C7-00A3-4AA6-BA76-7E95F2A3*** |
| Message |
string |
The response message.
|
success |
| TraceId |
string |
The trace ID that you can use to query the details of a request. |
ac1a0b2215622246421415014e**** |
| Data |
object |
The data that is returned. |
|
| ChangeOrderId |
string |
The change order ID. You can use this ID to query the execution status of the job. |
01db03d3-3ee9-48b3-b3d0-dfce2d88**** |
| AppId |
string |
The job template ID. |
7171a6ca-d1cd-4928-8642-7d5cfe69**** |
| ErrorCode |
string |
|
|
| Code |
string |
The HTTP status code.
|
200 |
| Success |
boolean |
Indicates whether the job template was updated. Valid values:
|
true |
Contoh
Respons sukses
JSONformat
{
"RequestId": "01CF26C7-00A3-4AA6-BA76-7E95F2A3***",
"Message": "success",
"TraceId": "ac1a0b2215622246421415014e****",
"Data": {
"ChangeOrderId": "01db03d3-3ee9-48b3-b3d0-dfce2d88****",
"AppId": "7171a6ca-d1cd-4928-8642-7d5cfe69****"
},
"ErrorCode": "",
"Code": "200",
"Success": true
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Application.MissingJdk | Your application must at least contain a JDK component. | |
| 400 | InvalidApplication.NotFound | The current application does not exist. | |
| 400 | InvalidComponent.NotFound | The current component (such as JDK, Tomcat, or EDASWebContainer) does not exist. | |
| 400 | InvalidHostnameIp.Invalid | The hostname and/or IP is invalid: Hostname [%s], IP [%s]. | |
| 400 | InvalidInstanceSpecification.Unsupported | The instance specification is not supported: CPU [%s], memory [%s]. | |
| 400 | InvalidPackageType.NotFound | The package type must be War, FatJar, or Image. | |
| 400 | InvalidParameter.FileName | The application deployment package name is invalid. This name can contain only alphanumeric characters, hyphens (-), and underscores (_). In addition, you can upload JAR files only if the selected deployment version supports JAR file. Otherwise, upload WAR files only. | |
| 400 | InvalidParameter.NotEmpty | You must specify the parameter %s. | |
| 400 | InvalidParameter.Obviously | The specified parameter is invalid {%s}. | |
| 400 | InvalidParameter.WithMessage | The parameter is invalid {%s}: %s | |
| 400 | JarApplication.MissingJdk | A FatJar application must contain JDK. | |
| 400 | NoComputeResourceQuota.Exceed | Your compute resource is insufficient. Please contact us to raise the quota. | |
| 400 | PandoraApplication.MissingJdk | The Pandora application is missing a JDK component. | |
| 400 | PandoraApplication.OnlyJdk | A Pandora application only requires JDK component. | |
| 400 | WarApplication.MissingJdkWebcontainer | A War application must contain JDK and Tomcat. | |
| 400 | LogService.ConfigQuotaExceed | The maximum number of Log Service configs is exceeded. | |
| 400 | LogService.InternalError | An exception occurred while calling Log Service. Please submit a ticket to solve the problem. | |
| 400 | LogService.LogDirInvalid | The log collection path is invalid. | |
| 400 | LogService.NotAvailable | Log Service is unavailable. Please activate Log Service first. | |
| 400 | LogService.ProjectNumQuotaExceed | The maximum number of Log Service projects is exceeded. | |
| 400 | user.indebt | The user has an outstanding payment. | |
| 400 | NoComputeResourceQuota.App.Exceed | You can create %s instances for each application. Please submit a ticket to raise the quota. | |
| 400 | NoComputeResourceQuota.User.Exceed | Your account is limited to create %s instances. Please submit a ticket to raise the quota. | |
| 400 | System.Upgrading | The system is being upgraded. Please try again later. | |
| 400 | VolumnPath.Conflict | Conflict between log collection directory and persistent storage directory. | |
| 400 | Application.ChangerOrderRunning | An application change process is in progress. Please try again later. | |
| 400 | Application.InvalidStatus | The application status is abnormal. Please try again later. | |
| 400 | MountConflict.ConfigMap | Conflict detected for ConfigMap path %s. | |
| 400 | NotFound.ConfigMap | The ConfigMap object (ID: %s) does not exist. | |
| 400 | NotFound.ConfigMapKey | The key %s of ConfigMap object (ID: %s) does not exist. | |
| 400 | Package.Version.Too.Long | The maximum length of package version is exceeded. | |
| 400 | App.Package.Version.Exists | The package version of application already exists. | |
| 400 | Slb.Occupied | The SLB instance is occupied. | |
| 400 | Slb.Tag.Not.Qualified | The current SLB instance cannot be reused because it may have been occupied by %s. | |
| 400 | MinReadyInstances.Not.Smaller.Replicas | The minimum number of available instances must be less than the number of application instances. | |
| 400 | BatchWaitTime.Not.Smaller.Zero | BatchWaitTime must not be smaller than zero. | |
| 400 | Sls.Config.Mixed.Multi.Project | The specified Config contains multiple projects. | |
| 400 | Sls.Config.User.Defined.Missing.Logstore.Info | The specified Config is invalid. Both Project and Logstore must be specified. | |
| 400 | Sls.Config.User.Defined.Missing.Project.Info | The specified Config is invalid. Both Project and Logstore must be specified. | |
| 400 | Sls.Logstore.Name.Invalid | The specified name of Logstore is invalid. The Logstore name must not contain the prefix "sae-". | |
| 400 | Sls.Logstore.User.Defined.Not.Exist | The user defined Logstore does not exist. | |
| 400 | Sls.Project.Name.Invalid | The specified project name is invalid. The project name must not contain the prefix "sae-". | |
| 400 | Sls.Project.User.Defined.Not.Exist | The user defined project does not exist. | |
| 400 | Sae.Errorcode.Ahas.Create.Error.Message | Failed to create AHAS. | |
| 400 | InvalidImageUrl.AcrInstanceId.Domain.NotMatch | The specified domain of ImageUrl does not match AcrInstanceId domains. | |
| 400 | PhpApplication.MissingPhpRuntime | A PHP application must contain PHP Runtime. | |
| 404 | InvalidNamespaceId.NotFound | The specified NamespaceId does not exist. | |
| 404 | InvalidAcrInstanceId.NotFound | The specified AcrInstanceId does not exist. | |
| 404 | Associate.Eip.Not.Enough | No sufficient EIPs are available. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.