@cloudbase/cli 2.0.13 → 2.0.14

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.
@@ -81,6 +81,10 @@ let CreateServiceTcbr = class CreateServiceTcbr extends common_1.Command {
81
81
  flags: '--envParams <envParams>',
82
82
  desc: '环境变量,格式为xx=a&yy=b,默认为空'
83
83
  },
84
+ {
85
+ flags: '--log_type <log_type>',
86
+ desc: '日志类型,只能为 none,如需自定义日志,请前往控制台配置'
87
+ },
84
88
  {
85
89
  flags: '--containerPort <containerPort>',
86
90
  desc: '监听端口,必填'
@@ -80,6 +80,10 @@ let DeployServiceTcbr = class DeployServiceTcbr extends common_1.Command {
80
80
  flags: '--envParams <envParams>',
81
81
  desc: '环境变量,格式为xx=a&yy=b,默认为空'
82
82
  },
83
+ {
84
+ flags: '--log_type <log_type>',
85
+ desc: '日志类型,只能为 none,如需自定义日志,请前往控制台配置'
86
+ },
83
87
  {
84
88
  flags: '--containerPort <containerPort>',
85
89
  desc: '监听端口,必填'
@@ -80,6 +80,10 @@ let UpdateServiceTcbr = class UpdateServiceTcbr extends common_1.Command {
80
80
  flags: '--envParams <envParams>',
81
81
  desc: '环境变量,格式为xx=a&yy=b,默认为空'
82
82
  },
83
+ {
84
+ flags: '--log_type <log_type>',
85
+ desc: '日志类型,只能为 none,如需自定义日志,请前往控制台配置'
86
+ },
83
87
  {
84
88
  flags: '--containerPort <containerPort>',
85
89
  desc: '监听端口,必填'
@@ -87,7 +87,7 @@ function checkRequiredParams(options) {
87
87
  }
88
88
  function tcbrServiceOptions(options, isCreated, defaultOverride, previousServerConfig) {
89
89
  return __awaiter(this, void 0, void 0, function* () {
90
- let { noConfirm: _noConfirm = false, override: _override = (defaultOverride || false), envId, serviceName, path, cpu, mem, minNum, maxNum, policyDetails, customLogs, envParams, containerPort, remark, targetDir, dockerfile, image, custom_image, library_image, json: _json = false } = options;
90
+ let { noConfirm: _noConfirm = false, override: _override = (defaultOverride || false), envId, serviceName, path, cpu, mem, minNum, maxNum, policyDetails, customLogs, envParams, containerPort, remark, targetDir, dockerfile, image, custom_image, library_image, log_type, json: _json = false } = options;
91
91
  checkRequiredParams({
92
92
  envId,
93
93
  serviceName,
@@ -111,7 +111,10 @@ function tcbrServiceOptions(options, isCreated, defaultOverride, previousServerC
111
111
  maxNum,
112
112
  minNum
113
113
  });
114
- const defaultLogType = 'none';
114
+ if (log_type && log_type !== "none") {
115
+ throw new toolbox_1.CloudBaseError('日志类型 log_type 只能为 none,如需自定义日志,请前往控制台配置');
116
+ }
117
+ const defaultLogType = "none";
115
118
  const newServiceOptions = {
116
119
  ServerName: serviceName,
117
120
  EnvId: envId,
@@ -132,7 +135,10 @@ function tcbrServiceOptions(options, isCreated, defaultOverride, previousServerC
132
135
  Port: containerPort,
133
136
  HasDockerfile: true,
134
137
  Dockerfile: dockerfile || 'Dockerfile',
135
- LogType: defaultLogType
138
+ LogType: (0, utils_1.parseInputParam)(log_type, _override, null, previousServerConfig === null || previousServerConfig === void 0 ? void 0 : previousServerConfig.LogType, defaultLogType),
139
+ LogSetId: previousServerConfig === null || previousServerConfig === void 0 ? void 0 : previousServerConfig.LogSetId,
140
+ LogTopicId: previousServerConfig === null || previousServerConfig === void 0 ? void 0 : previousServerConfig.LogTopicId,
141
+ LogParseType: previousServerConfig === null || previousServerConfig === void 0 ? void 0 : previousServerConfig.LogParseType,
136
142
  },
137
143
  DeployInfo: Object.assign({}, DeployInfo)
138
144
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cli",
3
- "version": "2.0.13",
3
+ "version": "2.0.14",
4
4
  "description": "cli tool for cloudbase",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -27,7 +27,10 @@ export declare function tcbrServiceOptions(options: ITcbrServiceOptions, isCreat
27
27
  Port: number;
28
28
  HasDockerfile: boolean;
29
29
  Dockerfile: string;
30
- LogType: string;
30
+ LogType: any;
31
+ LogSetId: any;
32
+ LogTopicId: any;
33
+ LogParseType: any;
31
34
  };
32
35
  DeployInfo: any;
33
36
  }>;
package/types/types.d.ts CHANGED
@@ -490,6 +490,9 @@ export interface IDescribeCloudRunServerDetail {
490
490
  ServerConfig: ITcbrServerBaseConfig;
491
491
  RequestId: string;
492
492
  }
493
+ export declare const enum TCBR_LOG_TYPE {
494
+ NONE = "none"
495
+ }
493
496
  export interface ITcbrServiceOptions {
494
497
  noConfirm: boolean;
495
498
  override: boolean;
@@ -511,6 +514,7 @@ export interface ITcbrServiceOptions {
511
514
  image: string;
512
515
  custom_image: string;
513
516
  library_image: string;
517
+ log_type: TCBR_LOG_TYPE;
514
518
  json: boolean;
515
519
  }
516
520
  export interface ICloudRunProcessLog {