Loading...
Loading...
Deploy HTML pages, static directories, or custom edge functions to Alibaba Cloud ESA edge nodes. Manage Edge KV for distributed key-value storage. Use when deploying web pages, static sites, frontend builds, serverless edge functions, or edge data storage to ESA Functions & Pages.
npx skill4agent add aliyun/alibabacloud-aiops-skills alibabacloud-esa-pages-deploy| Pattern | Use Case | Code Type | Size Limit |
|---|---|---|---|
| HTML Page | Quick prototypes, single pages | Auto-wrapped JS | < 5MB (ER limit) |
| Static Directory | Frontend builds (React/Vue/etc.) | Assets | < 25MB per file |
| Custom Function | API endpoints, dynamic logic | Custom JS | < 5MB |
Important: Enable ESA Functions & Pages first at ESA Console before using this skill, or useAPI to enable programmatically.OpenErService
npm install @alicloud/esa20240910@2.43.0 @alicloud/openapi-client@0.4.15 @alicloud/credentials@2.4.4OpenErService// Check if service is enabled
const status = await client.getErService(
new $Esa20240910.GetErServiceRequest({}),
);
if (status.body?.status !== "online") {
// Enable the service
await client.openErService(new $Esa20240910.OpenErServiceRequest({}));
}import Esa20240910, * as $Esa20240910 from "@alicloud/esa20240910";
import * as $OpenApi from "@alicloud/openapi-client";
import Credential from "@alicloud/credentials";
function createClient() {
const credential = new Credential();
const config = new $OpenApi.Config({
credential,
endpoint: "esa.cn-hangzhou.aliyuncs.com",
userAgent: "AlibabaCloud-Agent-Skills",
});
return new Esa20240910(config);
}1. CreateRoutine(name) → Create function (skip if exists)
2. Upload code/assets to OSS → Via staging upload or assets API
3. Commit & Publish → Deploy to staging → production
4. GetRoutine(name) → Get access URL (defaultRelatedRecord)CreateRoutine → GetRoutineStagingCodeUploadInfo → Upload wrapped JS
→ CommitRoutineStagingCode → PublishRoutineCodeVersion(staging/production)CreateRoutine → CreateRoutineWithAssetsCodeVersion → Upload zip
→ Poll GetRoutineCodeVersionInfo → CreateRoutineCodeDeployment(staging/production)export default {
async fetch(request) {
return new Response("Hello", {
headers: { "content-type": "text/html;charset=UTF-8" },
});
},
};| Type | Structure |
|---|---|
| JS_ONLY | |
| ASSETS_ONLY | |
| JS_AND_ASSETS | |
OpenErServiceGetErServiceCreateRoutineGetRoutineListUserRoutinesGetRoutineStagingCodeUploadInfoCommitRoutineStagingCodePublishRoutineCodeVersionCreateRoutineWithAssetsCodeVersionGetRoutineCodeVersionInfoCreateRoutineCodeDeploymentCreateRoutineRouteListRoutineRoutesCreateKvNamespaceGetKvNamespaceGetKvAccountPutKvGetKvListKvsBatchPutKvPutKvWithHighCapacityBatchPutKvWithHighCapacitynpm install @alicloud/esa20240910@2.43.0 @alicloud/openapi-client@0.4.15 @alicloud/credentials@2.4.4 @alicloud/tea-util@1.4.9 jszip@3.10.1| Script | Usage | Description |
|---|---|---|
| | Deploy HTML page |
| | Deploy static directory |
| | Deploy custom function |
| | Manage routines |
# Deploy HTML page
node scripts/deploy-html.mjs my-page index.html
# Deploy React/Vue build
node scripts/deploy-folder.mjs my-app ./dist
# Deploy custom function
node scripts/deploy-function.mjs my-api handler.js
# List all routines
node scripts/manage.mjs list
# Get routine details
node scripts/manage.mjs get my-pagedefaultRelatedRecordGetRoutineNote: ESA endpoint is fixed (), no region needed.esa.cn-hangzhou.aliyuncs.com
references/pages-api.mdreferences/kv-api.md