import { RegionType } from './../interface'; import { ApigwRemoveInputs } from './../apigw/interface'; export interface FunctionCode { CosBucketName?: string; CosObjectName?: string; ImageConfig?: { ImageType: string; ImageUri: string; RegistryId?: string; Command?: string; Args?: string; ContainerImageAccelerate?: boolean; ImagePort?: number; }; } export interface WSParams { idleTimeOut?: number; IdleTimeOut?: number; } export interface ProtocolParams { wsParams?: WSParams; WSParams?: WSParams; } export interface BaseFunctionConfig { FunctionName: string; Code?: FunctionCode; Handler?: string; Runtime?: string; Namespace?: string; Timeout?: number; InitTimeout?: number; MemorySize?: number; DiskSize?: number; Type?: 'HTTP' | 'Event'; DeployMode?: 'code' | 'image'; PublicNetConfig?: { PublicNetStatus: 'ENABLE' | 'DISABLE'; EipConfig: { EipStatus: 'ENABLE' | 'DISABLE'; }; }; L5Enable?: 'TRUE' | 'FALSE'; DnsCache?: 'TRUE' | 'FALSE'; Role?: string; Description?: string; ClsLogsetId?: string; ClsTopicId?: string; Environment?: { Variables: { Key: string; Value: string; }[]; }; VpcConfig?: { VpcId?: string; SubnetId?: string; }; Layers?: { LayerName: string; LayerVersion: number; }[]; DeadLetterConfig?: { Type?: string; Name?: string; FilterType?: string; }; CfsConfig?: { CfsInsList: { CfsId: string; MountInsId: string; LocalMountDir: string; RemoteMountDir: string; UserGroupId: string; UserId: string; }[]; }; AsyncRunEnable?: 'TRUE' | 'FALSE'; TraceEnable?: 'TRUE' | 'FALSE'; InstallDependency?: 'TRUE' | 'FALSE'; ProtocolType?: string; ProtocolParams?: ProtocolParams; NodeType?: string; NodeSpec?: string; InstanceConcurrencyConfig?: { DynamicEnabled: 'TRUE' | 'FALSE'; MaxConcurrency?: number; }; OverClockConfig?: { TimeOut: number; }; } export interface TriggerType { NeedCreate?: boolean; Type: string; TriggerDesc?: string; TriggerName?: string; Qualifier?: string; compared?: boolean; tags?: object; parameters?: any; } export declare type OriginTriggerType = { [name: string]: { serviceName?: string; name?: string; parameters?: any; }; }; export interface Tag { Key: string; Value: string; } export interface FunctionInfo { FunctionName: string; Namespace: string; Timeout: number; MemorySize: number; Handler: string; Runtime: string; Status: string; LastVersion: string; StatusReasons: { ErrorMessage: string; }[]; Traffic?: number; ConfigTrafficVersion?: string; Tags: Tag[]; ClsLogsetId: string; ClsTopicId: string; Qualifier: string; RequestId: string; } export interface ScfPublishVersionInputs { functionName?: string; description?: string; namespace?: string; region?: RegionType; } export interface PublishVersionAndConfigTraffic { traffic: number; functionName: string; functionVersion: string; aliasName: string; namespace?: string; description?: string; } export interface ScfGetAliasInputs { functionName: string; region: RegionType; aliasName?: string; namespace?: string; functionVersion?: string; } export interface ScfUpdateAliasInputs extends ScfGetAliasInputs { description?: string; additionalVersions?: { version: string; weight: number; }[]; } export declare type ScfDeleteAliasInputs = ScfGetAliasInputs; export interface ScfListAliasInputs extends ScfGetAliasInputs {} export interface ScfCreateAlias { functionName: string; functionVersion?: string; aliasName: string; namespace?: string; lastVersion?: string; traffic?: number; description?: string; additionalVersions?: { version: string; weight: number; }[]; } export interface ScfCreateFunctionInputs { Namespace?: string; name: string; type?: string; deployMode?: string; code?: { bucket: string; object: string; }; handler?: string; runtime?: string; namespace?: string; timeout?: number; initTimeout?: number; memorySize?: number; diskSize?: number; publicAccess?: boolean; eip?: boolean; l5Enable?: boolean; nodeType?: string; nodeSpec?: string; role?: string; description?: string; cls?: { logsetId?: string; topicId?: string; }; environment?: { variables?: { [key: string]: string; }; }; vpcConfig?: { vpcId: string; subnetId: string; }; layers?: { name: string; version: number; }[]; deadLetter?: { type?: string; name?: string; filterType?: string; }; cfs?: { cfsId: string; mountInsId?: string; MountInsId?: string; localMountDir: string; remoteMountDir: string; userGroupId?: string; userId?: string; }[]; qualifier?: string; asyncRunEnable?: undefined | boolean; traceEnable?: undefined | boolean; installDependency?: undefined | boolean; imageConfig?: { imageType: string; imageUri: string; registryId?: string; command?: string; args?: string; containerImageAccelerate?: boolean; imagePort?: number; }; msgTTL?: number; retryNum?: number; protocolType?: string; protocolParams?: ProtocolParams; instanceConcurrencyConfig?: { enable: boolean; dynamicEnabled: boolean; maxConcurrency: number; }; dnsCache?: boolean | 'FALSE' | 'TRUE'; overClockConfig: { timeOut: number; }; } export interface ScfUpdateAliasTrafficInputs { traffic: number; functionName: string; lastVersion: string; functionVersion?: string; aliasName?: string; namespace?: string; description?: string; region: RegionType; } export interface ScfDeployTriggersInputs { namespace?: string; name?: string; events?: OriginTriggerType[]; } export interface ScfDeployInputs extends ScfCreateFunctionInputs { namespace?: string; name: string; enableRoleAuth?: boolean; region?: string; lastVersion?: string; publish?: boolean; publishDescription?: string; needSetTraffic?: boolean; traffic?: number; aliasName?: string; aliasDescription?: string; aliasFunctionVersion?: string; additionalVersionWeights?: { version: string; weight: number; }[]; tags?: Record; events?: OriginTriggerType[]; ignoreTriggers?: boolean; protocolType?: string; protocolParams?: ProtocolParams; provisionedConcurrency?: { provisionedType: 'Default' | 'ConcurrencyUtilizationTracking'; qualifier: string; provisionedNum: number; minCapacity?: number; maxCapacity?: number; trackingTarget?: number; triggerActions?: Array<{ triggerName: string; triggerCronConfig: string; triggerProvisionedConcurrencyNum: number; }>; }; provisionedNum?: number; reservedConcurrencyMem?: number; qualifier?: string; } export interface ScfDeployOutputs { FunctionName: string; Type: string; Timeout: number; MemorySize: number; Handler?: string; Runtime: string; Namespace: string; LastVersion?: string; Traffic?: number; Tags?: Tag[]; Triggers?: any[]; ConfigTrafficVersion?: string; } export interface ScfRemoveInputs { functionName?: string; FunctionName?: string; namespace?: string; Namespace?: string; Triggers?: ApigwRemoveInputs[] | Record[]; triggers?: ApigwRemoveInputs[] | Record[]; isAutoRelease?: boolean; } export interface ScfInvokeInputs { functionName: string; namespace?: string; qualifier?: string; logType?: string; clientContext?: any; invocationType?: string; } export interface FaasBaseConfig { functionName: string; namespace?: string; qualifier?: string; } export interface StatusSqlMapEnum { success: string; fail: string; retry: string; interrupt: string; timeout: string; exceed: string; codeError: string; } export interface GetSearchSqlOptions { functionName: string; namespace?: string; qualifier?: string; startTime?: number | string; endTime?: number | string; reqId?: string; status?: keyof StatusSqlMapEnum; } export declare type GetLogOptions = Omit & { interval?: string; }; export interface UpdateFunctionCodeOptions { Action: any; Handler: string; FunctionName: string; Namespace: string; InstallDependency?: string; CosBucketName?: string; CosObjectName?: string; Code?: FunctionCode; } export interface GetRequestStatusOptions { functionName: string; functionRequestId: string; namespace?: string; startTime?: string; endTime?: string; } export interface GetRequestStatusOptions { /** * 函数名称 */ functionName: string; /** * 需要查询状态的请求id */ functionRequestId: string; /** * 函数的所在的命名空间 */ namespace?: string; /** * 查询的开始时间,例如:2017-05-16 20:00:00,不填默认为当前时间 - 15min */ startTime?: string; /** * 查询的结束时间,例如:2017-05-16 20:59:59,不填默认为当前时间。EndTime 需要晚于 StartTime。 */ endTime?: string; }