Skip to content

Commit

Permalink
Merge pull request #461 from devsapp/jiangyu-docs-wss
Browse files Browse the repository at this point in the history
Jiangyu docs wss
  • Loading branch information
anycodes authored Nov 18, 2021
2 parents 6e92cea + 2f67300 commit 1d8ff5a
Show file tree
Hide file tree
Showing 15 changed files with 118 additions and 566 deletions.
99 changes: 4 additions & 95 deletions docs/command/alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
- [alias publish 命令](#alias-publish-命令)
- [参数解析](#参数解析-2)
- [操作案例](#操作案例-2)
- [alias delete 命令](#alias-delete-命令)
- [参数解析](#参数解析-3)
- [操作案例](#操作案例-3)
- [remove alias 命令](./remove.md#remove-alias-命令)
- [权限与策略说明](#权限与策略说明)

> 关于 `alias` 命令的常见问题和解决方法,可以参考[ FC 组件自动问答系统](http://qa.devsapp.cn/ )
Expand All @@ -41,16 +39,14 @@ SubCommand List
get Get alias details; help command [s alias get -h]
list View the list of alias; help command [s alias list -h]
publish Publish alias; help command [s alias publish -h]
delete Delete alias; help command [s alias delete -h]
```


在该命令中,包括了四个子命令
在该命令中,包括了三个子命令

- [get:查看指定别名详情](#alias-get-命令)
- [list:获取别名列表](#alias-list-命令)
- [publish:发布/更新别名](#alias-publish-命令)
- [delete:删除指定别名](#version-delete-命令)

## alias get 命令

Expand Down Expand Up @@ -276,9 +272,9 @@ Examples with CLI
| service-name | - | 选填 | 必填 | 服务名 |
| description | - | 选填 | 选填 | 别名描述 |
| alias-name | - | 必填 | 必填 | 别名 |
| gversion | - | 选填 | 选填 | 灰度版本Id |
| gversion | - | 选填 | 选填 | 灰度版本Id。灰度版本权重填写时必填|
| version-id | - | 必填 | 必填 | 版本Id |
| weight | - | 选填 | 选填 | 灰度版本权重 |
| weight | - | 选填 | 选填 | 灰度版本权重。灰度版本Id填写时必填 |
| access | a | 选填 | 选填 | 本次请求使用的密钥,可以使用通过[config命令](https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/config.md#config-add-命令) 配置的密钥信息,以及[配置到环境变量的密钥信息](https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/config.md#通过环境变量配置密钥信息) |
| debug | - | 选填 | 选填 | 打开`debug`模式,将会输出更多日志信息 |
| help | h | 选填 | 选填 | 查看帮助信息 |
Expand Down Expand Up @@ -312,76 +308,6 @@ fc-deploy-test:
lastModifiedTime: 2021-11-08T06:54:02Z
```

## alias delete 命令

`alias delete` 命令,是删除指定函数别名的命令。

当执行命令`alias delete -h`/`alias delete --help`时,可以获取帮助文档:

```shell script
Alias delete

Delete alias

Usage

s alias delete <options>

Document

https://github.com/devsapp/fc/blob/main/docs/command/alias.md

Options

--region [string] [C-Required] Specify the fc region, value: cn-hangzhou/cn-beijing/cn-beijing/cn-hangzhou/cn-shanghai/cn-qingdao/cn-zhangjiakou/cn-huhehaote/cn-shenzhen/cn-chengdu/cn-hongkong/ap-southeast-1/ap-southeast-2/ap-southeast-3/ap-southeast-5/ap-northeast-1/eu-central-1/eu-west-1/us-west-1/us-east-1/ap-south-1
--service-name [string] [C-Required] Specify the fc service name
--alias-name [string] [Required] Specify the fc alias name

Global Options

-h, --help [Optional] Help for command
-a, --access [string] [Optional] Specify key alias
--debug [Optional] Output debug informations

Options Help

Required: Required parameters in YAML mode and CLI mode
C-Required: Required parameters in CLI mode
Y-Required: Required parameters in Yaml mode
Optional: Non mandatory parameter
✋ The difference between Yaml mode and CLI mode: https://github.com/Serverless-Devs/Serverless-Devs/blob/master/docs/zh/yaml_and_cli.md

Examples with Yaml

$ s alias delete --alias-name aliasName

Examples with CLI

$ s cli fc alias delete --region cn-hangzhou --service-name serviceName --alias-name aliasName
```

### 参数解析

| 参数全称 | 参数缩写 | Yaml模式下必填 | Cli模式下必填 | 参数含义 |
| ------------ | -------- | -------------- | ------------- | ------------------------------------------------------------ |
| region | - | 选填 | 必填 | 地区,取值范围:`cn-hangzhou, cn-beijing, cn-beijing, cn-hangzhou, cn-shanghai, cn-qingdao, cn-zhangjiakou, cn-huhehaote, cn-shenzhen, cn-chengdu, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1, eu-west-1, us-west-1, us-east-1, ap-south-1` |
| service-name | - | 选填 | 必填 | 服务名 |
| alias-name | - | 必填 | 必填 | 别名 |
| access | a | 选填 | 选填 | 本次请求使用的密钥,可以使用通过[config命令](https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/config.md#config-add-命令) 配置的密钥信息,以及[配置到环境变量的密钥信息](https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/config.md#通过环境变量配置密钥信息) |
| debug | - | 选填 | 选填 | 打开`debug`模式,将会输出更多日志信息 |
| help | h | 选填 | 选填 | 查看帮助信息 |

### 操作案例

- **有资源描述文件(Yaml)时**,可以直接执行`s alias delete --alias-name aliasName`删除指定别名;
- **纯命令行形式(在没有资源描述 Yaml 文件时)**,需要指定服务所在地区以及服务名称,例如`s cli fc alias delete --region cn-hangzhou --service-name fc-deploy-service --alias-name pre`

上述命令的执行结果示例:

```text
AliasName [pre] deleted successfully.
```

## 权限与策略说明

- `alias list``alias get` 命令所需要的权限策略: `AliyunFCReadOnlyAccess`
Expand All @@ -403,20 +329,3 @@ AliasName [pre] deleted successfully.
]
}
```

- `alias delete` 命令所需要的权限策略:

```
{
"Version": "1",
"Statement": [
{
"Action": [
"fc:DeleteAlias"
],
"Effect": "Allow",
"Resource": "acs:fc:<region>:<account-id>:services/<serviceName>/aliases/*"
}
]
}
```
6 changes: 3 additions & 3 deletions docs/command/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ Examples with Yaml

| 参数全称 | 参数缩写 | Cli模式下必填 | 参数含义 |
| ------------ | -------- | ------------- | ------------------------------------- |
| dockerfile | f | 选填 | |
| use-docker | d | 选填 | |
| use-buildkit | b | 选填 | |
| dockerfile | f | 选填 | 指定构建自定义镜像的文件 |
| use-docker | d | 选填 | 通过 docker 构建 |
| use-buildkit | b | 选填 | 通过 buildctl 构建 |
| debug | - | 选填 | 打开`debug`模式,将会输出更多日志信息 |
| help | h | 选填 | 查看帮助信息 |

Expand Down
22 changes: 11 additions & 11 deletions docs/command/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ fc-deploy-test:
| -------- | -------- | -------------- | -------------- | -------- | ------------------------ | ------------------------------------ |
| 存在 | 存在 | 与线上一致 | 与线上一致 | 无交互 | 线上服务与函数将会被更新 | 线上服务与函数不做任何操作 |
| 存在 | 不存在 | 与线上一致 | - | 无交互 | 线上服务与函数将会被更新 | 线上服务不做任何操作,函数将会被创建 |
| 不存在 | 不存在 | - | - | 无交互 | 线上服务与函数将会被更新 | 线上服务与函数将会被更新 |
| 不存在 | 不存在 | 与线上不一致 | 与线上不一致 | 有交互 | 线上服务与函数将会被更新 | 线上服务与函数不做任何操作 |
| 不存在 | 不存在 | - | - | 无交互 | 线上服务与函数将会被更新 | 线上服务与函数将会被创建 |
| 存在 | 存在 | 与线上不一致 | 与线上不一致 | 有交互 | 线上服务与函数将会被更新 | 线上服务与函数不做任何操作 |
> 线上服务&线上函数:指的是已经部署过的服务和函数;
>
Expand Down Expand Up @@ -174,7 +174,7 @@ fc-deploy-test:
## deploy service 命令
`deploy service` 命令,是服务资源的命令
`deploy service` 命令,是部署服务资源的命令
当执行命令`deploy service -h`/`deploy service --help`时,可以获取帮助文档:
Expand Down Expand Up @@ -244,7 +244,7 @@ fc-deploy-test:
## deploy function 命令
`deploy function` 命令,是服务资源的命令
`deploy function` 命令,是部署函数的命令
当执行命令`deploy function -h`/`deploy function --help`时,可以获取帮助文档:
Expand Down Expand Up @@ -325,7 +325,7 @@ fc-deploy-test:
## deploy trigger 命令
`deploy trigger` 命令,是服务资源的命令
`deploy trigger` 命令,是部署函数触发器的命令
当执行命令`deploy trigger -h`/`deploy trigger --help`时,可以获取帮助文档:
Expand Down Expand Up @@ -376,7 +376,7 @@ Examples with Yaml
| 参数全称 | 参数缩写 | Yaml模式下必填 | 参数含义 |
| ------------ | -------- | -------------- | ------------------------------------------------------------ |
| trigger-name | - | 选填 | 触发器名称 |
| trigger-name | - | 选填 | 仅部署指定的触发器名称 |
| use-local | - | 选填 | 使用本地配置进行部署 |
| user-remote | - | 选填 | |
| assume-yes | y | 选填 | 在交互时,默认选择`y` |
Expand Down Expand Up @@ -413,7 +413,7 @@ $ s deploy trigger --trigger-name httpTrigger
## deploy domain 命令
`deploy domain` 命令,是服务资源的命令
`deploy domain` 命令,是部署自定义域名的命令
当执行命令`deploy domain -h`/`deploy domain --help`时,可以获取帮助文档:
Expand Down Expand Up @@ -462,9 +462,9 @@ Examples with Yaml
| 参数全称 | 参数缩写 | Yaml模式下必填 | 参数含义 |
| ----------- | -------- | -------------- | ------------------------------------------------------------ |
| domain | - | 选填 | 域名 |
| use-local | - | 选填 | 使用本地配置进行部署 |
| user-remote | - | 选填 | |
| domain | - | 选填 | 仅操作指定域名 |
| use-local | - | 选填 | 使用本地配置进行部署 |
| user-remote | - | 选填 | 使用线上配置 |
| assume-yes | y | 选填 | 在交互时,默认选择`y` |
| access | a | 选填 | 本次请求使用的密钥,可以使用通过[config命令](https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/config.md#config-add-命令) 配置的密钥信息,以及[配置到环境变量的密钥信息](https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/config.md#通过环境变量配置密钥信息) |
| debug | - | 选填 | 打开`debug`模式,将会输出更多日志信息 |
Expand All @@ -489,7 +489,7 @@ fc-deploy-test:
> 在进行服务资源部署时,可能会涉及到交互式操作,相关的描述参考[ deploy 命令 注意事项](#注意事项) 中的`在部署时可能会涉及到交互式操作`。
单独部署某个指定的自定义域名,可以通过增加`--dimai`参数实现,参考命令:
单独部署某个指定的自定义域名,可以通过增加`--domain`参数实现,参考命令:
```
$ s deploy domain --domain http-trigger-py36.fc-deploy-service.1583208943291465.cn-hangzhou.fc.devsapp.net
Expand Down
4 changes: 2 additions & 2 deletions docs/command/fun2s.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Examples with CLI

| 参数全称 | 参数缩写 | Cli模式下必填 | 参数含义 |
| -------- | -------- | ------------- | ------------------------------------------------------------ |
| force | - | 选填 | 强行覆盖已存在/已指定的 Serverless Devs 资源描述文档 |
| region | - | 选填 | 地区,取值范围:`cn-hangzhou, cn-beijing, cn-beijing, cn-hangzhou, cn-shanghai, cn-qingdao, cn-zhangjiakou, cn-huhehaote, cn-shenzhen, cn-chengdu, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1, eu-west-1, us-west-1, us-east-1, ap-south-1` |
| force | - | 选填 | 强行覆盖已存在/已指定的 Serverless Devs 资源描述文件 |
| region | - | 选填 | 地区,默认读取 Funcraft 的配置。取值范围:`cn-hangzhou, cn-beijing, cn-beijing, cn-hangzhou, cn-shanghai, cn-qingdao, cn-zhangjiakou, cn-huhehaote, cn-shenzhen, cn-chengdu, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1, eu-west-1, us-west-1, us-east-1, ap-south-1` |
| source | - | 选填 | Funcraft的配置文档路径(默认是`template.yaml`/`template.yml`|
| target | - | 选填 | 生成的 Serverless Devs 的配置文档路径(默认是`s.yaml`|
| access | a | 选填 | 本次请求使用的密钥,可以使用通过[config命令](https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/config.md#config-add-命令) 配置的密钥信息,以及[配置到环境变量的密钥信息](https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/config.md#通过环境变量配置密钥信息) |
Expand Down
3 changes: 2 additions & 1 deletion docs/command/info.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ Examples with CLI
| ------------- | -------- | -------------- | ------------- | ------------------------------------------------------------ |
| region | - | 选填 | 必填 | 地区,取值范围:`cn-hangzhou, cn-beijing, cn-beijing, cn-hangzhou, cn-shanghai, cn-qingdao, cn-zhangjiakou, cn-huhehaote, cn-shenzhen, cn-chengdu, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1, eu-west-1, us-west-1, us-east-1, ap-south-1` |
| service-name | - | 选填 | 必填 | 服务名 |
| function-name | - | 选填 | 必填 | 函数名 |
| function-name | - | 选填 | 选填 | 函数名 |
| trigger-name | - | 选填 | 选填 | 触发器名 |
| access | a | 选填 | 选填 | 本次请求使用的密钥,可以使用通过[config命令](https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/config.md#config-add-命令) 配置的密钥信息,以及[配置到环境变量的密钥信息](https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/config.md#通过环境变量配置密钥信息) |
| debug | - | 选填 | 选填 | 打开`debug`模式,将会输出更多日志信息 |
| help | h | 选填 | 选填 | 查看帮助信息 |
Expand Down
Loading

0 comments on commit 1d8ff5a

Please sign in to comment.