diff --git a/src/modules/scf/constants.ts b/src/modules/scf/constants.ts deleted file mode 100644 index bc6249f..0000000 --- a/src/modules/scf/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const WebServerImageDefaultPort = 9000; diff --git a/src/modules/scf/interface.ts b/src/modules/scf/interface.ts index f5da63a..d7f3d6b 100644 --- a/src/modules/scf/interface.ts +++ b/src/modules/scf/interface.ts @@ -12,8 +12,6 @@ export interface FunctionCode { RegistryId?: string; Command?: string; Args?: string; - ContainerImageAccelerate?: boolean; - ImagePort?: number; }; } @@ -205,7 +203,6 @@ export interface ScfCreateFunctionInputs { cfs?: { cfsId: string; - mountInsId?: string; MountInsId?: string; localMountDir: string; remoteMountDir: string; @@ -231,10 +228,6 @@ export interface ScfCreateFunctionInputs { command?: string; // 启动命令参数 args?: string; - // 是否开启镜像加速 - containerImageAccelerate?: boolean; - // 监听端口: -1 表示job镜像,0~65535 表示Web Server镜像 - imagePort?: number; }; // 异步调用重试配置 @@ -398,25 +391,25 @@ export interface GetRequestStatusOptions { /** * 函数名称 */ - functionName: string; + functionName: string /** * 需要查询状态的请求id */ - functionRequestId: string; + functionRequestId: string /** * 函数的所在的命名空间 */ - namespace?: string; + namespace?: string /** * 查询的开始时间,例如:2017-05-16 20:00:00,不填默认为当前时间 - 15min */ - startTime?: string; + startTime?: string /** * 查询的结束时间,例如:2017-05-16 20:59:59,不填默认为当前时间。EndTime 需要晚于 StartTime。 */ - endTime?: string; + endTime?: string } diff --git a/src/modules/scf/utils.ts b/src/modules/scf/utils.ts index 684f95d..0c905d1 100644 --- a/src/modules/scf/utils.ts +++ b/src/modules/scf/utils.ts @@ -1,4 +1,3 @@ -import { WebServerImageDefaultPort } from './constants'; import { ScfCreateFunctionInputs, BaseFunctionConfig, ProtocolParams } from './interface'; const CONFIGS = require('./config').default; @@ -53,20 +52,6 @@ export const formatInputs = (inputs: ScfCreateFunctionInputs) => { if (imageConfig.args) { functionInputs.Code!.ImageConfig!.Args = imageConfig.args; } - // 镜像加速 - if (imageConfig.containerImageAccelerate !== undefined) { - functionInputs.Code!.ImageConfig!.ContainerImageAccelerate = - imageConfig.containerImageAccelerate; - } - // 监听端口: -1 表示 job镜像,0 ~ 65526 表示webServer镜像 - if (imageConfig.imagePort) { - functionInputs.Code!.ImageConfig!.ImagePort = - Number.isInteger(imageConfig?.imagePort) && - imageConfig?.imagePort >= -1 && - imageConfig?.imagePort <= 65535 - ? imageConfig.imagePort - : WebServerImageDefaultPort; - } } else { // 基于 COS 代码部署 functionInputs.Code = { @@ -164,7 +149,7 @@ export const formatInputs = (inputs: ScfCreateFunctionInputs) => { inputs.cfs.forEach((item) => { functionInputs.CfsConfig?.CfsInsList.push({ CfsId: item.cfsId, - MountInsId: item.mountInsId || item.MountInsId || item.cfsId, + MountInsId: item.MountInsId || item.cfsId, LocalMountDir: item.localMountDir, RemoteMountDir: item.remoteMountDir, UserGroupId: String(item.userGroupId || 10000),