Skip to content

Commit

Permalink
commit by Serverless devs docs 3-22-2024 9:51:57
Browse files Browse the repository at this point in the history
  • Loading branch information
serverless-devs committed Mar 22, 2024
1 parent d457dba commit 16d0c0d
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 39 deletions.
40 changes: 26 additions & 14 deletions content/en/serverless-devs/command/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Usage: s cli [options]
Utilize Serverless Devs components for application development and management without the need for yaml configuration.

Examples:
$ s cli fc api ListServices
$ s cli fc api ListFunctions --path '{"serviceName": "serviceName"}' --body '{"K1": "V1"}'
$ s cli fc3 info --region cn-hangzhou --function-name test -a myAccess
$ s cli fc3 invoke --region cn-hangzhou --function-name test -e "{"key" : "val"}" -a myAccess

📖 Documentation: https://serverless.help/t/s/
Options:
Expand Down Expand Up @@ -73,22 +73,34 @@ s cli devsapp/website deploy -p "{\"bucket\":\"testbucket\",\"src\":{\"codeUri\"

### Specific Component Support

Serverless Devs offers several well-designed components that are optimized for Cli mode. For example, the `fc api` component is prioritized for command line usage, facilitating quick interactions with certain Aliyun Function Compute (FC) service interfaces, such as:
Serverless Devs offers several well-designed components that are optimized for Cli mode. For example, the `fc3` component is prioritized for command line usage, facilitating quick interactions with certain Aliyun Function Compute (FC) service interfaces, such as:

- Listing functions within a specified service and region:
- Listing functions within a specified function and region:

```shell script
s cli fc api listFunctions --service-name my-service --region cn-beijing -a myaccess
```
```bash
s cli fc3 info --region cn-hangzhou --function-name test -a myAccess
```

- Updating function code via the command line:
- Invoking function via the command line:

```shell script
s cli fc api updateFunction --region cn-hangzhou --serviceName fc-deploy-service --functionName http-trigger-function --code '{"zipFile":"./"}'
```
```bash
s cli fc3 invoke --region cn-hangzhou --function-name test -e "{\"key\" : \"val\"}" -a myAccess
```

Furthermore, several components that typically support Yaml mode may also offer an optimized pure command line interface for specific operations. An example is the `fc` component, which provides commands for resource synchronization:
Furthermore, several components that typically support Yaml mode may also offer an optimized pure command line interface for specific operations. An example is the `fc3` component, which provides commands for resource synchronization:

```shell script
s cli fc sync --region cn-shanghai --service-name myService --type config
```bash
$ s cli fc3 sync -h
Usage: s cli fc3 sync [options]

Synchronize online resources to offline resources.

Examples with Yaml:
$ s sync
$ s sync --target-dir ./test --qualifier testAlias

Examples with CLI:
$ s cli fc3 sync --region cn-hangzhou --function-name test -a default
$ s cli fc3 sync --region cn-hangzhou --function-name s1\$f1 -a default
...
```
6 changes: 3 additions & 3 deletions content/en/serverless-devs/command/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Options:
-h, --help Display help for command

Commands:
config 👤 Configure venders account
config 👤 Configure vendors account
env 🌱 Environment operation
set 🔧 Settings for the tool
registry 🚢 Serverless registry platform
Expand All @@ -56,9 +56,9 @@ Commands:
<custom> 🧭 Custom Commands


🙌 Quick Start: https://docs.serverless-devs.com/quick-start
🙌 Quick Start: https://manual.serverless-devs.com/getting-started/
🌟 Github Repo: https://github.com/Serverless-Devs/Serverless-Devs
💡 Documentation: https://docs.serverless-devs.com
💡 Documentation: https://manual.serverless-devs.com
🚀 Example Projects: https://registry.serverless-devs.com
📝 Feedback: https://github.com/Serverless-Devs/Serverless-Devs/issues
```
Expand Down
2 changes: 1 addition & 1 deletion content/en/serverless-devs/command/verify.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The functionality of the `verify` command includes two parts:
1. Serverless Devs tool side: Performs basic checks on the Yaml file's format, magic variables, and versions. This part of the functionality is similar to the `preview` command.
2. Component side: The component provides a method, according to certain conventions, to conduct a more detailed truth verification of all resource attribute values in the Yaml file, such as whether the type is correct and whether the value exists in the enumeration options.

The convention method and development examples for the component side can be found here: [Serverless Devs Component Development Specification](https://docs.serverless-devs.com/serverless-devs/development-manual/component#约定方法).
The convention method and development examples for the component side can be found here: [Serverless Devs Component Development Specification](https://manual.serverless-devs.com/dev-guide/component/).

### Operation Examples

Expand Down
42 changes: 29 additions & 13 deletions content/zh/serverless-devs/command/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Usage: s cli [options]
Directly use serverless devs to use components, develop and manage applications without yaml configuration.

Example:
$ s cli fc api ListServices
$ s cli fc api ListFunctions --path '{"serviceName": "serviceName"}' --body '{"K1": "V1"}'
$ s cli fc3 info --region cn-hangzhou --function-name test -a myAccess
$ s cli fc3 invoke --region cn-hangzhou --function-name test -e "{"key" : "val"}" -a myAccess

📖 Document: https://serverless.help/t/s/cli

Expand Down Expand Up @@ -79,18 +79,34 @@ s cli devsapp/website deploy -p "{\"bucket\":\"testbucket\",\"src\":{\"codeUri\"

### 特定组件的支持

在 Serverless Devs 目前已经存在的组件中,已经有一些比较优秀且针对 Cli 模式设计的组件,例如`fc api`组件,就是一款命令行模式优先的组件,通过该组件,可以快速的使用阿里云函数计算的一些接口,进行操作,例如:
在 Serverless Devs 目前已经存在的组件中,已经有一些比较优秀且针对 Cli 模式设计的组件,例如`fc3`组件,就是一款命令行模式优先的组件,通过该组件,可以快速的使用阿里云函数计算的一些接口,进行操作,例如:

- 查看阿里云函数计算的某个地区下某个服务下的函数列表:
```shell script
s cli fc api listFunctions --service-name my-service --region cn-beijing -a myaccess
- 查看阿里云函数计算的某个地区下某个函数信息:

```bash
s cli fc3 info --region cn-hangzhou --function-name test -a myAccess
```
- 通过纯命令行形式,对函数进行代码更新:
```shell script
s cli fc api updateFunction --region cn-hangzhou --serviceName fc-deploy-service --functionName http-trigger-function --code '{"zipFile":"./"}'

- 调用阿里云函数计算的某个地区下某个函数:

```bash
s cli fc3 invoke --region cn-hangzhou --function-name test -e "{\"key\" : \"val\"}" -a myAccess
```

除此之外,很多组件可以即对 Yaml 模式有比较好的支持,也会在某些情况下对 纯命令行模式,进行额外优化设计,例如 `fc` 组件的线上线下资源同步操作:
```shell script
s cli fc sync --region cn-shanghai --service-name myService --type config
```
除此之外,很多组件既可以对 Yaml 模式有比较好的支持,也会在某些情况下对 纯命令行模式,进行额外优化设计,例如 `fc3` 组件的线上线下资源同步操作:

```bash
$ s cli fc3 sync -h
Usage: s cli fc3 sync [options]

Synchronize online resources to offline resources.

Examples with Yaml:
$ s sync
$ s sync --target-dir ./test --qualifier testAlias

Examples with CLI:
$ s cli fc3 sync --region cn-hangzhou --function-name test -a default
$ s cli fc3 sync --region cn-hangzhou --function-name s1\$f1 -a default
...
```
6 changes: 3 additions & 3 deletions content/zh/serverless-devs/command/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Options:
-h, --help Display help for command

Commands:
config 👤 Configure venders account
config 👤 Configure vendors account
env 🌱 Environment operation
set 🔧 Settings for the tool
registry 🚢 Serverless registry platform
Expand All @@ -58,9 +58,9 @@ Commands:
<custom> 🧭 Custom Commands


🙌 Quick Start: https://docs.serverless-devs.com/quick-start
🙌 Quick Start: https://manual.serverless-devs.com/getting-started/
🌟 Github Repo: https://github.com/Serverless-Devs/Serverless-Devs
💡 Documentation: https://docs.serverless-devs.com
💡 Documentation: https://manual.serverless-devs.com
🚀 Example Projects: https://registry.serverless-devs.com
📝 Feedback: https://github.com/Serverless-Devs/Serverless-Devs/issues
```
Expand Down
2 changes: 1 addition & 1 deletion content/zh/serverless-devs/command/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ category: '命令'

# Registry 命令

`registry`命令是将安利模板发到 [Serverless Registry](https://registry.serverless-devs.com) 并对相关内容进行管理的命令。
`registry`命令是将案例模板发到 [Serverless Registry](https://registry.serverless-devs.com) 并对相关内容进行管理的命令。

- [命令解析](#命令解析)
- [login 命令](#registry-login-命令)
Expand Down
2 changes: 1 addition & 1 deletion content/zh/serverless-devs/command/verify.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Options:
1. Serverless Devs 工具侧:对 Yaml 文件的格式,魔法变量,版本等进行基本校验。这部分功能与`preview`命令的功能雷同。
2. 组件侧:通过组件按照一定约定提供的方法,对 Yaml 文件中所有资源的属性值进行更加细致的真值校验,例如类型是否正确,取值是否存在于枚举项中等。

组件侧的约定方法和开发案例可见:[Serverless Devs 组件开发规范](https://docs.serverless-devs.com/serverless-devs/development-manual/component#%E7%BA%A6%E5%AE%9A%E6%96%B9%E6%B3%95)
组件侧的约定方法和开发案例可见:[Serverless Devs 组件开发规范](https://manual.serverless-devs.com/dev-guide/component/)

### 操作案例

Expand Down
6 changes: 3 additions & 3 deletions content/zh/serverless-devs/development-manual/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ services:
component-test:
component: demo
props:
name: {{ inputsrgs }}
name: {{ inputargs }}
```
## 开发与调试
为了兼容[spec 0.0.1](https://github.com/Serverless-Devs/Serverless-Devs/blob/master/spec/zh/0.0.1/serverless_package_model/package_model.md#%E5%BA%94%E7%94%A8%E6%A8%A1%E5%9E%8B%E8%A7%84%E8%8C%83) 中,关于`s.yaml`的特殊格式定义,在当前版本中:
Expand All @@ -238,7 +238,7 @@ services:

> 您可以使用固定的 dev 版本用于持续发布测试版本

- 首次发布需要通过 [registry](https://docs.serverless-devs.com/serverless-devs/command/registry) 命令先登录 Serverless Devs Registry。
- 首次发布需要通过 [registry](https://manual.serverless-devs.com/user-guide/builtin/registry/) 命令先登录 Serverless Devs Registry。

```shell script
s registry login
Expand All @@ -257,7 +257,7 @@ services:

### 查看已发布的应用

> 详细可见 [registry 命令文档](https://docs.serverless-devs.com/serverless-devs/command/registry)
> 详细可见 [registry 命令文档](https://manual.serverless-devs.com/user-guide/builtin/registry/)

可以通过`s registry list`指令查看当前登陆到 [Serverless Registry](https://registry.serverless-devs.com) 账号所发布的组件。例如:

Expand Down

0 comments on commit 16d0c0d

Please sign in to comment.