Skip to content

Commit c4acb51

Browse files
committed
feat(scf): cli createfunction support sfType
1 parent e91c2ec commit c4acb51

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tencent-component-toolkit",
3-
"version": "2.24.2",
3+
"version": "2.24.3",
44
"description": "Tencent component toolkit",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",

src/modules/scf/interface.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ export interface BaseFunctionConfig {
6767
ProtocolParams?: ProtocolParams;
6868
NodeType?: string;
6969
NodeSpec?: string;
70+
SFType?: string;
71+
GpuReservedQuota?: number;
72+
//请求并发
73+
InstanceConcurrencyConfig?: {
74+
DynamicEnabled?: boolean
75+
MaxConcurrency?: number
76+
}
7077
}
7178

7279
export interface TriggerType {
@@ -236,6 +243,16 @@ export interface ScfCreateFunctionInputs {
236243

237244
protocolType?: string;
238245
protocolParams?: ProtocolParams;
246+
247+
//sd应用类型
248+
sFType?: string
249+
//gpu并发数,默认是0
250+
gpuReservedQuota?: number
251+
//请求并发配置
252+
instanceConcurrencyConfig?:{
253+
dynamicEnabled?: boolean
254+
maxConcurrency?: number
255+
}
239256
}
240257

241258
export interface ScfUpdateAliasTrafficInputs {

src/modules/scf/utils.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,23 @@ export const formatInputs = (inputs: ScfCreateFunctionInputs) => {
8383
functionInputs.ProtocolParams = protocolParams;
8484
}
8585
}
86+
87+
}
88+
89+
//sd应用类型
90+
if(inputs?.sFType){
91+
functionInputs.SFType = inputs?.sFType;
92+
}
93+
//sd gpu并发数
94+
if(inputs?.gpuReservedQuota){
95+
functionInputs.GpuReservedQuota = inputs?.gpuReservedQuota;
96+
}
97+
//请求并发
98+
if(inputs?.instanceConcurrencyConfig){
99+
functionInputs.InstanceConcurrencyConfig = {
100+
DynamicEnabled: inputs?.instanceConcurrencyConfig?.dynamicEnabled,
101+
MaxConcurrency: inputs?.instanceConcurrencyConfig?.maxConcurrency
102+
}
86103
}
87104

88105
if (inputs.role) {

0 commit comments

Comments
 (0)