@newbeebox/newbeebox-app-engine-cli 1.0.3 → 1.1.0
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/package.json +1 -1
- package/src/index.js +20 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -14,7 +14,7 @@ const program = new Command()
|
|
|
14
14
|
program
|
|
15
15
|
.name('nae')
|
|
16
16
|
.description('NewBee App Engine CLI —— 默认人类可读,-o json 输出 JSON 供脚本解析')
|
|
17
|
-
.version('1.0
|
|
17
|
+
.version('1.1.0')
|
|
18
18
|
.option('--base-url <url>', '覆盖平台地址(也可用环境变量 NAE_BASE_URL)')
|
|
19
19
|
.option('--token <token>', '覆盖访问密钥(也可用环境变量 NAE_TOKEN)')
|
|
20
20
|
.option('-o, --output <format>', '输出格式:text(默认,人类可读)| json', 'text')
|
|
@@ -176,7 +176,7 @@ program
|
|
|
176
176
|
.option('--env <json>', '环境变量 JSON,如 \'{"KEY":"val"}\'')
|
|
177
177
|
.option(
|
|
178
178
|
'--config <json>',
|
|
179
|
-
"模板应用的服务特性参数 JSON。可用字段随模板而定,运行 'nae templates' 看每个模板的 ConfigSchema(key/类型/默认值/可选项)。redis: {\"password\",\"persistence\":\"rdb|aof|none\"};milvus: {\"root_password\"}"
|
|
179
|
+
"模板应用的服务特性参数 JSON。可用字段随模板而定,运行 'nae templates' 看每个模板的 ConfigSchema(key/类型/默认值/可选项)。redis: {\"password\",\"persistence\":\"rdb|aof|none\"};postgres: {\"database\",\"username\",\"password\"};milvus: {\"root_password\"}"
|
|
180
180
|
)
|
|
181
181
|
.option('--owner <uid>', '管理员代他人创建时的归属用户 ID', (v) => parseInt(v, 10))
|
|
182
182
|
.addHelpText(
|
|
@@ -193,6 +193,10 @@ program
|
|
|
193
193
|
nae create --kind template --app-id myredis --template redis --storage 2Gi \\
|
|
194
194
|
--config '{"password":"s3cret","persistence":"rdb"}'
|
|
195
195
|
|
|
196
|
+
# 模板应用 PostgreSQL 14:持久化 + 库名/用户名/密码
|
|
197
|
+
nae create --kind template --app-id mypg --template postgres --storage 5Gi \\
|
|
198
|
+
--config '{"database":"appdb","username":"appuser","password":"s3cret"}'
|
|
199
|
+
|
|
196
200
|
# 模板应用 Milvus
|
|
197
201
|
nae create --kind template --app-id myvec --template milvus --storage 10Gi \\
|
|
198
202
|
--config '{"root_password":"s3cret"}'
|
|
@@ -247,6 +251,20 @@ program
|
|
|
247
251
|
.description('滚动重启应用')
|
|
248
252
|
.action(run(async (id) => emit(await request(cfg(), 'POST', `/apps/${id}/restart`))))
|
|
249
253
|
|
|
254
|
+
program
|
|
255
|
+
.command('reset-password <appid>')
|
|
256
|
+
.description('重置模板应用连接密码(不清数据;当前支持 Redis/PostgreSQL)。留空 --password 则随机生成')
|
|
257
|
+
.option('--password <pw>', '指定新密码(留空=平台随机生成;可打印 ASCII,1-128 位)')
|
|
258
|
+
.action(
|
|
259
|
+
run(async (id, opts) => {
|
|
260
|
+
emit(
|
|
261
|
+
await request(cfg(), 'POST', `/apps/${id}/reset-credential`, {
|
|
262
|
+
body: { password: opts.password ?? '' },
|
|
263
|
+
})
|
|
264
|
+
)
|
|
265
|
+
})
|
|
266
|
+
)
|
|
267
|
+
|
|
250
268
|
program
|
|
251
269
|
.command('scale <appid> <replicas>')
|
|
252
270
|
.description('扩缩容到指定副本数')
|