@cloudbase/manager-node 4.7.4-beta.0 → 4.7.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cloudrun/index.js +2 -93
- package/lib/cloudrun/type.js +1 -12
- package/lib/constant.js +6 -1
- package/lib/function/index.js +47 -45
- package/package.json +1 -1
- package/types/cloudrun/index.d.ts +1 -17
- package/types/cloudrun/type.d.ts +0 -78
- package/types/constant.d.ts +4 -0
package/lib/cloudrun/index.js
CHANGED
|
@@ -16,7 +16,6 @@ const archiver_1 = __importDefault(require("archiver"));
|
|
|
16
16
|
const fs_extra_1 = require("fs-extra");
|
|
17
17
|
const path_1 = __importDefault(require("path"));
|
|
18
18
|
const utils_1 = require("../utils");
|
|
19
|
-
const type_1 = require("./type");
|
|
20
19
|
/**
|
|
21
20
|
* 云托管服务管理类
|
|
22
21
|
* 提供云托管服务的初始化、下载、列表查询和删除等功能
|
|
@@ -106,87 +105,6 @@ class CloudRunService {
|
|
|
106
105
|
ServerType: params === null || params === void 0 ? void 0 : params.serverType
|
|
107
106
|
}));
|
|
108
107
|
}
|
|
109
|
-
async setTraffic(serverName, stablePercent, canaryPercent) {
|
|
110
|
-
// 校验比例之和是否为100%
|
|
111
|
-
if (stablePercent + canaryPercent !== 100) {
|
|
112
|
-
throw new Error('稳定版本流量比例和灰度版本流量比例之和必须等于 100');
|
|
113
|
-
}
|
|
114
|
-
const envConfig = this.environment.lazyEnvironmentConfig;
|
|
115
|
-
const { Task } = await this.tcbrService.request('DescribeServerManageTask', {
|
|
116
|
-
EnvId: envConfig.EnvId,
|
|
117
|
-
ServerName: serverName, // 服务名
|
|
118
|
-
TaskId: 0 // 任务Id
|
|
119
|
-
});
|
|
120
|
-
// 判断是否存在灰度版本
|
|
121
|
-
const isGary = (Task === null || Task === void 0 ? void 0 : Task.ReleaseType) === type_1.ReleaseTypeEnum.GRAY && (Task === null || Task === void 0 ? void 0 : Task.Status) === 'running';
|
|
122
|
-
if (!isGary) {
|
|
123
|
-
throw new Error('不存在灰度版本或版本部署未完成');
|
|
124
|
-
}
|
|
125
|
-
// 获取当前版本和灰度版本
|
|
126
|
-
const { ReleaseOrderInfo } = await this.tcbrService.request('DescribeReleaseOrder', {
|
|
127
|
-
EnvId: envConfig.EnvId, // 环境 Id
|
|
128
|
-
ServerName: serverName // 服务名
|
|
129
|
-
});
|
|
130
|
-
const { CurrentVersion, ReleaseVersion } = ReleaseOrderInfo;
|
|
131
|
-
// 设置版本比例
|
|
132
|
-
return await this.tcbrService.request('ReleaseGray', {
|
|
133
|
-
EnvId: envConfig.EnvId, // 环境 Id
|
|
134
|
-
ServerName: serverName, // 服务名
|
|
135
|
-
GrayType: "gray",
|
|
136
|
-
TrafficType: "FLOW",
|
|
137
|
-
GrayFlowRatio: canaryPercent,
|
|
138
|
-
VersionFlowItems: [{
|
|
139
|
-
VersionName: CurrentVersion.VersionName,
|
|
140
|
-
FlowRatio: stablePercent,
|
|
141
|
-
IsDefaultPriority: true,
|
|
142
|
-
Priority: 1,
|
|
143
|
-
}, {
|
|
144
|
-
VersionName: ReleaseVersion.VersionName,
|
|
145
|
-
FlowRatio: canaryPercent,
|
|
146
|
-
IsDefaultPriority: false,
|
|
147
|
-
Priority: 2,
|
|
148
|
-
}]
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* 完成灰度
|
|
153
|
-
*/
|
|
154
|
-
async promote(serverName) {
|
|
155
|
-
const envConfig = this.environment.lazyEnvironmentConfig;
|
|
156
|
-
// 获取当前版本和灰度版本
|
|
157
|
-
const { ReleaseOrderInfo } = await this.tcbrService.request('DescribeReleaseOrder', {
|
|
158
|
-
EnvId: envConfig.EnvId, // 环境 Id
|
|
159
|
-
ServerName: serverName // 服务名
|
|
160
|
-
});
|
|
161
|
-
const { CurrentVersion, ReleaseVersion } = ReleaseOrderInfo;
|
|
162
|
-
const res = await this.tcbrService.request('ReleaseGray', {
|
|
163
|
-
EnvId: envConfig.EnvId, // 环境 Id
|
|
164
|
-
ServerName: serverName, // 服务名
|
|
165
|
-
GrayType: "gray",
|
|
166
|
-
TrafficType: "FLOW",
|
|
167
|
-
GrayFlowRatio: 100,
|
|
168
|
-
VersionFlowItems: [{ VersionName: ReleaseVersion.VersionName, FlowRatio: 100, Priority: 0, IsDefaultPriority: true }],
|
|
169
|
-
CloseGrayRelease: true,
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* 取消灰度
|
|
174
|
-
*/
|
|
175
|
-
async rollback(serverName) {
|
|
176
|
-
const envConfig = this.environment.lazyEnvironmentConfig;
|
|
177
|
-
const { Task } = await this.tcbrService.request('DescribeServerManageTask', {
|
|
178
|
-
EnvId: envConfig.EnvId,
|
|
179
|
-
ServerName: serverName, // 服务名
|
|
180
|
-
TaskId: 0 // 任务Id
|
|
181
|
-
});
|
|
182
|
-
const res = await this.tcbrService.request('OperateServerManage', {
|
|
183
|
-
EnvId: envConfig.EnvId, // 环境 Id
|
|
184
|
-
ServerName: serverName,
|
|
185
|
-
TaskId: Task.Id,
|
|
186
|
-
OperateType: 'go_back',
|
|
187
|
-
});
|
|
188
|
-
return res;
|
|
189
|
-
}
|
|
190
108
|
/**
|
|
191
109
|
*查询云托管服务详情
|
|
192
110
|
* @param {Object} params 查询参数
|
|
@@ -238,7 +156,7 @@ class CloudRunService {
|
|
|
238
156
|
* @returns {Promise<IResponseInfo>} 返回部署操作的响应信息
|
|
239
157
|
*/
|
|
240
158
|
async deploy(params) {
|
|
241
|
-
const { serverName, targetPath = process.cwd(), serverConfig
|
|
159
|
+
const { serverName, targetPath = process.cwd(), serverConfig } = params;
|
|
242
160
|
/**
|
|
243
161
|
* 参数校验和默认值设置
|
|
244
162
|
*/
|
|
@@ -286,7 +204,7 @@ class CloudRunService {
|
|
|
286
204
|
RepoLanguage: 'Node.js'
|
|
287
205
|
};
|
|
288
206
|
}
|
|
289
|
-
deployInfo.ReleaseType =
|
|
207
|
+
deployInfo.ReleaseType = 'FULL';
|
|
290
208
|
return this._upsertFunction(false, {
|
|
291
209
|
name: serverName,
|
|
292
210
|
deployInfo,
|
|
@@ -373,15 +291,6 @@ __decorate([
|
|
|
373
291
|
__decorate([
|
|
374
292
|
(0, utils_1.preLazy)()
|
|
375
293
|
], CloudRunService.prototype, "list", null);
|
|
376
|
-
__decorate([
|
|
377
|
-
(0, utils_1.preLazy)()
|
|
378
|
-
], CloudRunService.prototype, "setTraffic", null);
|
|
379
|
-
__decorate([
|
|
380
|
-
(0, utils_1.preLazy)()
|
|
381
|
-
], CloudRunService.prototype, "promote", null);
|
|
382
|
-
__decorate([
|
|
383
|
-
(0, utils_1.preLazy)()
|
|
384
|
-
], CloudRunService.prototype, "rollback", null);
|
|
385
294
|
__decorate([
|
|
386
295
|
(0, utils_1.preLazy)()
|
|
387
296
|
], CloudRunService.prototype, "detail", null);
|
package/lib/cloudrun/type.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CloudrunServerType = void 0;
|
|
4
4
|
var CloudrunServerType;
|
|
5
5
|
(function (CloudrunServerType) {
|
|
6
6
|
/**
|
|
@@ -12,14 +12,3 @@ var CloudrunServerType;
|
|
|
12
12
|
*/
|
|
13
13
|
CloudrunServerType["Container"] = "container";
|
|
14
14
|
})(CloudrunServerType || (exports.CloudrunServerType = CloudrunServerType = {}));
|
|
15
|
-
var ReleaseTypeEnum;
|
|
16
|
-
(function (ReleaseTypeEnum) {
|
|
17
|
-
/**
|
|
18
|
-
* 灰度发布
|
|
19
|
-
*/
|
|
20
|
-
ReleaseTypeEnum["GRAY"] = "GRAY";
|
|
21
|
-
/**
|
|
22
|
-
* 全量发布
|
|
23
|
-
*/
|
|
24
|
-
ReleaseTypeEnum["FULL"] = "FULL";
|
|
25
|
-
})(ReleaseTypeEnum || (exports.ReleaseTypeEnum = ReleaseTypeEnum = {}));
|
package/lib/constant.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// static credentail = 'credential'
|
|
5
5
|
// }
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.COS_SDK_KEEPALIVE = exports.COS_SDK_PROTOCOL = exports.INTERNAL_ENDPOINT_REGION = exports.USE_INTERNAL_ENDPOINT = exports.SCF_STATUS = exports.ROLE_NAME = exports.PUBLIC_RSA_KEY = exports.ERROR = exports.SERVICE_TYPE = exports.ENDPOINT = exports.RUN_ENV = exports.SDK_VERSION = exports.ENV_NAME = void 0;
|
|
7
|
+
exports.SCF_TEMP_COS = exports.COS_SDK_KEEPALIVE = exports.COS_SDK_PROTOCOL = exports.INTERNAL_ENDPOINT_REGION = exports.USE_INTERNAL_ENDPOINT = exports.SCF_STATUS = exports.ROLE_NAME = exports.PUBLIC_RSA_KEY = exports.ERROR = exports.SERVICE_TYPE = exports.ENDPOINT = exports.RUN_ENV = exports.SDK_VERSION = exports.ENV_NAME = void 0;
|
|
8
8
|
exports.ENV_NAME = {
|
|
9
9
|
ENV_SECRETID: 'TENCENTCLOUD_SECRETID',
|
|
10
10
|
ENV_SECRETKEY: 'TENCENTCLOUD_SECRETKEY',
|
|
@@ -59,3 +59,8 @@ exports.USE_INTERNAL_ENDPOINT = "USE_INTERNAL_ENDPOINT" in process.env;
|
|
|
59
59
|
exports.INTERNAL_ENDPOINT_REGION = process.env.INTERNAL_ENDPOINT_REGION;
|
|
60
60
|
exports.COS_SDK_PROTOCOL = process.env.COS_SDK_PROTOCOL;
|
|
61
61
|
exports.COS_SDK_KEEPALIVE = process.env.COS_SDK_KEEPALIVE;
|
|
62
|
+
// SCF 临时 COS 配置(用于函数代码上传)
|
|
63
|
+
exports.SCF_TEMP_COS = {
|
|
64
|
+
APPID: '1253665819',
|
|
65
|
+
REGION: 'ap-shanghai'
|
|
66
|
+
};
|
package/lib/function/index.js
CHANGED
|
@@ -103,12 +103,13 @@ class FunctionService {
|
|
|
103
103
|
* @memberof FunctionService
|
|
104
104
|
*/
|
|
105
105
|
async updateFunctionIncrementalCode(funcParam) {
|
|
106
|
-
const { env } = this.getFunctionConfig();
|
|
106
|
+
const { env, namespace } = this.getFunctionConfig();
|
|
107
107
|
const { functionRootPath, func, deleteFiles, addFiles } = funcParam;
|
|
108
108
|
const { name, runtime } = func;
|
|
109
109
|
const params = {
|
|
110
110
|
FunctionName: name,
|
|
111
|
-
EnvId: env
|
|
111
|
+
EnvId: env,
|
|
112
|
+
Namespace: namespace
|
|
112
113
|
};
|
|
113
114
|
let packer;
|
|
114
115
|
let base64;
|
|
@@ -249,9 +250,9 @@ class FunctionService {
|
|
|
249
250
|
*/
|
|
250
251
|
async listFunctions(limit = 20, offset = 0) {
|
|
251
252
|
// 获取Function 环境配置
|
|
252
|
-
const {
|
|
253
|
-
const res = await this.
|
|
254
|
-
|
|
253
|
+
const { env } = this.getFunctionConfig();
|
|
254
|
+
const res = await this.tcbService.request('ListFunctions', {
|
|
255
|
+
EnvId: env,
|
|
255
256
|
Limit: limit,
|
|
256
257
|
Offset: offset
|
|
257
258
|
});
|
|
@@ -282,8 +283,8 @@ class FunctionService {
|
|
|
282
283
|
const { envId } = options;
|
|
283
284
|
while (true) {
|
|
284
285
|
try {
|
|
285
|
-
const res = await this.
|
|
286
|
-
|
|
286
|
+
const res = await this.tcbService.request('ListFunctions', {
|
|
287
|
+
EnvId: envId,
|
|
287
288
|
Limit: pageSize,
|
|
288
289
|
Offset: currentOffset
|
|
289
290
|
});
|
|
@@ -614,7 +615,8 @@ class FunctionService {
|
|
|
614
615
|
}
|
|
615
616
|
catch (e) {
|
|
616
617
|
throw new error_1.CloudBaseError(`[${func.name}] 更新函数配置失败:${e.message}`, {
|
|
617
|
-
code: e.code
|
|
618
|
+
code: e.code,
|
|
619
|
+
requestId: e.requestId
|
|
618
620
|
});
|
|
619
621
|
}
|
|
620
622
|
}
|
|
@@ -663,8 +665,9 @@ class FunctionService {
|
|
|
663
665
|
return res;
|
|
664
666
|
}
|
|
665
667
|
catch (e) {
|
|
666
|
-
throw new error_1.CloudBaseError(`[${funcName}]
|
|
667
|
-
code: e.code
|
|
668
|
+
throw new error_1.CloudBaseError(`[${funcName}] 函数代码更新失败:${e.message}`, {
|
|
669
|
+
code: e.code,
|
|
670
|
+
requestId: e.requestId
|
|
668
671
|
});
|
|
669
672
|
}
|
|
670
673
|
}
|
|
@@ -689,7 +692,9 @@ class FunctionService {
|
|
|
689
692
|
return Object.assign({ RequestId }, Result);
|
|
690
693
|
}
|
|
691
694
|
catch (e) {
|
|
692
|
-
throw new error_1.CloudBaseError(`[${name}]
|
|
695
|
+
throw new error_1.CloudBaseError(`[${name}] 调用失败:${e.message}`, {
|
|
696
|
+
requestId: e.requestId
|
|
697
|
+
});
|
|
693
698
|
}
|
|
694
699
|
}
|
|
695
700
|
/**
|
|
@@ -767,7 +772,8 @@ class FunctionService {
|
|
|
767
772
|
catch (e) {
|
|
768
773
|
throw new error_1.CloudBaseError(`[${name}] 创建触发器失败:${e.message}`, {
|
|
769
774
|
action: e.action,
|
|
770
|
-
code: e.code
|
|
775
|
+
code: e.code,
|
|
776
|
+
requestId: e.requestId
|
|
771
777
|
});
|
|
772
778
|
}
|
|
773
779
|
}
|
|
@@ -859,7 +865,9 @@ class FunctionService {
|
|
|
859
865
|
return { Url, RequestId, CodeSha256 };
|
|
860
866
|
}
|
|
861
867
|
catch (e) {
|
|
862
|
-
throw new error_1.CloudBaseError(`[${functionName}]
|
|
868
|
+
throw new error_1.CloudBaseError(`[${functionName}] 获取函数代码下载链接失败:${e.message}`, {
|
|
869
|
+
requestId: e.requestId
|
|
870
|
+
});
|
|
863
871
|
}
|
|
864
872
|
}
|
|
865
873
|
// 函数绑定文件层
|
|
@@ -1032,9 +1040,9 @@ class FunctionService {
|
|
|
1032
1040
|
return;
|
|
1033
1041
|
// 创建失败
|
|
1034
1042
|
if (Status === constant_1.SCF_STATUS.CREATE_FAILED) {
|
|
1035
|
-
|
|
1036
|
-
const
|
|
1037
|
-
throw new error_1.CloudBaseError(
|
|
1043
|
+
const errorDetails = (StatusReasons === null || StatusReasons === void 0 ? void 0 : StatusReasons.map(item => `[${item.ErrorCode}] ${item.ErrorMessage}`).join('\n')) || '';
|
|
1044
|
+
const errorMsg = `云函数创建失败${StatusDesc ? `\n状态描述: ${StatusDesc}` : ''}${errorDetails ? `\n失败信息: ${errorDetails}` : ''}`;
|
|
1045
|
+
throw new error_1.CloudBaseError(errorMsg, { requestId: RequestId });
|
|
1038
1046
|
}
|
|
1039
1047
|
// 函数状态正常
|
|
1040
1048
|
clearInterval(ticker);
|
|
@@ -1194,11 +1202,10 @@ class FunctionService {
|
|
|
1194
1202
|
const zipFilePath = await packer.compressFiles();
|
|
1195
1203
|
// 3. 初始化 cos 并上传
|
|
1196
1204
|
const tempCosObjectName = `/${cosDate}/${objectPath}`;
|
|
1197
|
-
const TEMP_COS_APPID = '1253665819';
|
|
1198
1205
|
const uploadParams = {
|
|
1199
|
-
Bucket: `shtempcos-${
|
|
1206
|
+
Bucket: `shtempcos-${constant_1.SCF_TEMP_COS.APPID}`,
|
|
1200
1207
|
Key: tempCosObjectName,
|
|
1201
|
-
Region:
|
|
1208
|
+
Region: constant_1.SCF_TEMP_COS.REGION,
|
|
1202
1209
|
FilePath: zipFilePath,
|
|
1203
1210
|
};
|
|
1204
1211
|
const cos = new cos_nodejs_sdk_v5_1.default({
|
|
@@ -1212,7 +1219,7 @@ class FunctionService {
|
|
|
1212
1219
|
// 清理临时文件
|
|
1213
1220
|
await packer.clean();
|
|
1214
1221
|
if (err) {
|
|
1215
|
-
reject(err);
|
|
1222
|
+
reject(new error_1.CloudBaseError(`COS 上传失败: ${err.message || err}`));
|
|
1216
1223
|
}
|
|
1217
1224
|
else {
|
|
1218
1225
|
resolve(data);
|
|
@@ -1323,32 +1330,26 @@ class FunctionService {
|
|
|
1323
1330
|
root: functionRootPath
|
|
1324
1331
|
});
|
|
1325
1332
|
await packer.build();
|
|
1326
|
-
//
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
// 再调用tcb COS 上传方式
|
|
1338
|
-
const cosResult = await this.uploadFunctionZipToCos(options, installDependency);
|
|
1333
|
+
// 指定 zip 上传方式:走 ZipFile base64 上传
|
|
1334
|
+
if (deployMode === 'zip') {
|
|
1335
|
+
// 判断是否超过 ZipFile 上传大小限制(1.5MB)
|
|
1336
|
+
const reachMax = await packer.isReachMaxSize();
|
|
1337
|
+
if (reachMax) {
|
|
1338
|
+
throw new error_1.CloudBaseError('ZipFile 上传不能大于 1.5MB,请使用 COS 上传方式(deployMode: "cos")');
|
|
1339
|
+
}
|
|
1340
|
+
const base64 = await packer.getBase64Code();
|
|
1341
|
+
if (!(base64 === null || base64 === void 0 ? void 0 : base64.length)) {
|
|
1342
|
+
throw new error_1.CloudBaseError('文件不能为空');
|
|
1343
|
+
}
|
|
1339
1344
|
return {
|
|
1340
|
-
|
|
1341
|
-
CosBucketRegion: 'ap-shanghai',
|
|
1342
|
-
TempCosObjectName: `/${legacyResult.Key}`
|
|
1345
|
+
ZipFile: base64
|
|
1343
1346
|
};
|
|
1344
1347
|
}
|
|
1345
|
-
//
|
|
1346
|
-
const
|
|
1347
|
-
if (!(base64 === null || base64 === void 0 ? void 0 : base64.length)) {
|
|
1348
|
-
throw new error_1.CloudBaseError('文件不能为空');
|
|
1349
|
-
}
|
|
1348
|
+
// 默认走 COS 上传
|
|
1349
|
+
const legacyResult = await this.uploadFunctionZipToCosLegacy(options, installDependency);
|
|
1350
1350
|
return {
|
|
1351
|
-
|
|
1351
|
+
CosBucketRegion: constant_1.SCF_TEMP_COS.REGION,
|
|
1352
|
+
TempCosObjectName: `/${legacyResult.Key}`
|
|
1352
1353
|
};
|
|
1353
1354
|
}
|
|
1354
1355
|
// 获取 COS 临时信息
|
|
@@ -1387,10 +1388,11 @@ class FunctionService {
|
|
|
1387
1388
|
* @memberof FunctionService
|
|
1388
1389
|
*/
|
|
1389
1390
|
getFunctionConfig() {
|
|
1390
|
-
var _a;
|
|
1391
|
+
var _a, _b, _c, _d;
|
|
1391
1392
|
const envConfig = this.environment.lazyEnvironmentConfig;
|
|
1392
|
-
|
|
1393
|
-
const
|
|
1393
|
+
// Functions 可能为空
|
|
1394
|
+
const namespace = ((_b = (_a = envConfig.Functions) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.Namespace) || '';
|
|
1395
|
+
const appId = (_d = (_c = envConfig.Storages) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.AppId;
|
|
1394
1396
|
const { proxy } = this.environment.cloudBaseContext;
|
|
1395
1397
|
return {
|
|
1396
1398
|
proxy,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Environment } from '../environment';
|
|
2
2
|
import { IResponseInfo } from '../interfaces';
|
|
3
|
-
import { CloudrunServerType, ICloudrunDetailResponse, ICloudrunListResponse, ICloudrunServerBaseConfig, ICloudrunServerBaseInfo, IDiffConfigItem, ITemplate
|
|
3
|
+
import { CloudrunServerType, ICloudrunDetailResponse, ICloudrunListResponse, ICloudrunServerBaseConfig, ICloudrunServerBaseInfo, IDiffConfigItem, ITemplate } from './type';
|
|
4
4
|
/**
|
|
5
5
|
* 云托管服务管理类
|
|
6
6
|
* 提供云托管服务的初始化、下载、列表查询和删除等功能
|
|
@@ -56,19 +56,6 @@ export declare class CloudRunService {
|
|
|
56
56
|
serverName?: string;
|
|
57
57
|
serverType?: CloudrunServerType;
|
|
58
58
|
}): Promise<ICloudrunListResponse>;
|
|
59
|
-
setTraffic(serverName: string, stablePercent: number, canaryPercent: number): Promise<{
|
|
60
|
-
RequestId?: string;
|
|
61
|
-
}>;
|
|
62
|
-
/**
|
|
63
|
-
* 完成灰度
|
|
64
|
-
*/
|
|
65
|
-
promote(serverName: string): Promise<void>;
|
|
66
|
-
/**
|
|
67
|
-
* 取消灰度
|
|
68
|
-
*/
|
|
69
|
-
rollback(serverName: string): Promise<{
|
|
70
|
-
RequestId?: string;
|
|
71
|
-
}>;
|
|
72
59
|
/**
|
|
73
60
|
*查询云托管服务详情
|
|
74
61
|
* @param {Object} params 查询参数
|
|
@@ -112,9 +99,6 @@ export declare class CloudRunService {
|
|
|
112
99
|
deploy(params: {
|
|
113
100
|
serverName: string;
|
|
114
101
|
targetPath: string;
|
|
115
|
-
deployInfo: {
|
|
116
|
-
ReleaseType: ReleaseTypeEnum;
|
|
117
|
-
};
|
|
118
102
|
serverConfig?: Partial<Pick<ICloudrunServerBaseConfig, 'OpenAccessTypes' | 'Cpu' | 'Mem' | 'MinNum' | 'MaxNum' | 'PolicyDetails' | 'CustomLogs' | 'EnvParams' | 'Port' | 'Dockerfile' | 'BuildDir' | 'InternalAccess' | 'InternalDomain' | 'EntryPoint' | 'Cmd' | 'InstallDependency'>>;
|
|
119
103
|
}): Promise<IResponseInfo>;
|
|
120
104
|
/**
|
package/types/cloudrun/type.d.ts
CHANGED
|
@@ -8,16 +8,6 @@ export declare enum CloudrunServerType {
|
|
|
8
8
|
*/
|
|
9
9
|
Container = "container"
|
|
10
10
|
}
|
|
11
|
-
export declare enum ReleaseTypeEnum {
|
|
12
|
-
/**
|
|
13
|
-
* 灰度发布
|
|
14
|
-
*/
|
|
15
|
-
GRAY = "GRAY",
|
|
16
|
-
/**
|
|
17
|
-
* 全量发布
|
|
18
|
-
*/
|
|
19
|
-
FULL = "FULL"
|
|
20
|
-
}
|
|
21
11
|
/**
|
|
22
12
|
* 服务基础信息接口
|
|
23
13
|
*/
|
|
@@ -337,71 +327,3 @@ export interface ITemplate {
|
|
|
337
327
|
language: string;
|
|
338
328
|
zipFileStore: string;
|
|
339
329
|
}
|
|
340
|
-
export interface ITaskStepInfo {
|
|
341
|
-
Name?: string;
|
|
342
|
-
Status?: string;
|
|
343
|
-
StartTime?: string;
|
|
344
|
-
EndTime?: string;
|
|
345
|
-
CostTime?: number;
|
|
346
|
-
FailReason?: string;
|
|
347
|
-
}
|
|
348
|
-
export interface IServerManageTaskInfo {
|
|
349
|
-
Id?: number;
|
|
350
|
-
EnvId?: string;
|
|
351
|
-
ServerName?: string;
|
|
352
|
-
CreateTime?: string;
|
|
353
|
-
ChangeType?: string;
|
|
354
|
-
ReleaseType?: string;
|
|
355
|
-
DeployType?: string;
|
|
356
|
-
PreVersionName?: string;
|
|
357
|
-
VersionName?: string;
|
|
358
|
-
PipelineId?: number;
|
|
359
|
-
PipelineTaskId?: number;
|
|
360
|
-
ReleaseId?: number;
|
|
361
|
-
Status?: string;
|
|
362
|
-
Steps?: ITaskStepInfo[];
|
|
363
|
-
FailReason?: string;
|
|
364
|
-
OperatorRemark?: string;
|
|
365
|
-
}
|
|
366
|
-
export interface IObjectKVPriority {
|
|
367
|
-
Key?: string;
|
|
368
|
-
Value?: string;
|
|
369
|
-
Priority?: number;
|
|
370
|
-
}
|
|
371
|
-
export interface IVersionInfo {
|
|
372
|
-
VersionName?: string;
|
|
373
|
-
FlowRatio?: number;
|
|
374
|
-
Status?: string;
|
|
375
|
-
CreatedTime?: string;
|
|
376
|
-
UpdatedTime?: string;
|
|
377
|
-
BuildId?: number;
|
|
378
|
-
UploadType?: string;
|
|
379
|
-
Remark?: string;
|
|
380
|
-
UrlParam?: IObjectKV;
|
|
381
|
-
Priority?: number;
|
|
382
|
-
IsDefaultPriority?: boolean;
|
|
383
|
-
FlowParams?: IObjectKVPriority[];
|
|
384
|
-
MinReplicas?: number;
|
|
385
|
-
MaxReplicas?: number;
|
|
386
|
-
RunId?: string;
|
|
387
|
-
Percent?: number;
|
|
388
|
-
CurrentReplicas?: number;
|
|
389
|
-
Architecture?: string;
|
|
390
|
-
}
|
|
391
|
-
export interface IObjectKV {
|
|
392
|
-
Key: string;
|
|
393
|
-
Value: string;
|
|
394
|
-
}
|
|
395
|
-
export interface IReleaseOrderInfo {
|
|
396
|
-
Id?: number;
|
|
397
|
-
ServerName?: string;
|
|
398
|
-
CurrentVersion?: IVersionInfo;
|
|
399
|
-
ReleaseVersion?: IVersionInfo;
|
|
400
|
-
GrayStatus?: string;
|
|
401
|
-
ReleaseStatus?: string;
|
|
402
|
-
TrafficTypeValues?: IObjectKV[];
|
|
403
|
-
TrafficType?: string;
|
|
404
|
-
FlowRatio?: number;
|
|
405
|
-
CreateTime?: string;
|
|
406
|
-
IsReleasing?: boolean;
|
|
407
|
-
}
|
package/types/constant.d.ts
CHANGED