Skip to content

Commit

Permalink
Merge pull request #98 from devsapp/wss/help
Browse files Browse the repository at this point in the history
Wss/help
  • Loading branch information
wss-git authored Jul 16, 2021
2 parents ea7fff9 + ce9faa4 commit 989452a
Show file tree
Hide file tree
Showing 47 changed files with 2,878 additions and 2,707 deletions.
239 changes: 162 additions & 77 deletions docs/Others/authority/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
本文档给出了命令相关配置对应的权限情况,其实一部分的策略是可以参考[阿里云函数计算的权限文档](https://help.aliyun.com/document_detail/253969.html#title-0wo-zl0-c61) , 但是还有一些权限的可能在使用命令中会比较细化,所以特编写该文档。

**目录**
- [deploy、remove 指令](#deployremove-指令)
- [deploy 指令](#deploy-指令)
- [remove 指令](#remove-指令)
- [info、sync 指令](#infosync-指令)
- [build、local 指令](#buildlocal-指令)
- [invoke 指令](#invoke-指令)
Expand All @@ -17,28 +18,182 @@
- [layer 指令](#layer-指令)
- [查看操作权限:list、versions、versionConfig](#查看操作权限listversionsversionConfig)
- [部署版本权限:publish](#部署版本权限publish)
- [删除层的版本:deleteVersion、deleteLayer](#删除层的版本deleteVersiondeleteLayer)
- [删除层:deleteLayer](#删除层:deleteLayer)
- [version 指令](#version-指令)
- [查看操作权限:list](#查看操作权限list)
- [发布版本:publish](#发布版本publish)
- [删除版本:delete](#删除版本delete)
- [alias 指令](#alias-指令)
- [查看操作权限:list](#查看操作权限list-1)
- [发布版本:publish](#发布版本publish-1)
- [删除:delete](#删除delete)
- [provision 指令](#provision-指令)
- [查看操作权限:list get](#查看操作权限list-get)
- [操作权限:put](#操作权限put)
- [onDemand 指令](#onDemand-指令)
- [查看操作权限:list get](#查看操作权限list-get-1)
- [发布/修改:put](#发布修改put)
- [删除:delete](#删除delete)

## deploy、remove 指令
## deploy 指令

这一部分和Yaml配置相关比较紧密,所以请[参考Yaml权限相关配置](./yaml.md)

## remove 指令
### 最大权限
系统策略:`AliyunFCFullAccess`

### s remove/s remove service
````json
{
"Statement": [
{
"Action": [
"fc:ListOnDemandConfigs",
"fc:DeleteFunctionOnDemandConfig",
"fc:ListProvisionConfigs",
"fc:PutProvisionConfig",
"fc:ListAliases",
"fc:DeleteAlias",
"fc:ListServiceVersions",
"fc:DeleteServiceVersion",
"fc:ListTriggers",
"fc:DeleteTrigger",
"fc:ListFunctions",
"fc:DeleteFunction",
"fc:DeleteService"
],
"Effect": "Allow",
"Resource": "*"
}
],
"Version": "1"
}
````
如果执行 s remove service --use-local
````json
{
"Statement": [
{
"Action": [
"fc:DeleteTrigger",
"fc:DeleteFunction",
"fc:DeleteService"
],
"Effect": "Allow",
"Resource": "*"
}
],
"Version": "1"
}
````

### s remove function
````json
{
"Statement": [
{
"Action": [
"fc:ListTriggers",
"fc:DeleteTrigger",
"fc:DeleteFunction"
],
"Effect": "Allow",
"Resource": "*"
}
],
"Version": "1"
}
````

### s remove trigger
````json
{
"Statement": [
{
"Action": [
"fc:DeleteTrigger"
],
"Effect": "Allow",
"Resource": "*"
}
],
"Version": "1"
}
````

### s remove alias
系统策略:`AliyunFCReadOnlyAccess`
```json
{
"Version": "1",
"Statement": [
{
"Action": "fc:DeleteAlias",
"Effect": "Allow",
"Resource": "acs:fc:<region>:<account-id>:services/<serviceName>/aliases/<aliasName>"
}
]
}
```

### s remove version
系统策略:`AliyunFCReadOnlyAccess`
```json
{
"Version": "1",
"Statement": [
{
"Action": "fc:DeleteServiceVersion",
"Effect": "Allow",
"Resource": "acs:fc:<region>:<account-id>:services/<serviceName>/versions/<version-id>"
}
]
}
```

### s remove provision
系统策略:`AliyunFCReadOnlyAccess`
```json
{
"Version": "1",
"Statement": [
{
"Action": "fc:PutProvisionConfig",
"Effect": "Allow",
"Resource": "acs:fc:<region>:<account-id>:services/services/<serviceName>.<qualifier>/functions/<functionName>"
}
]
}
```

### s remove onDemand
系统策略:`AliyunFCReadOnlyAccess`
```yaml
{
"Version": "1",
"Statement": [
{
"Action": "fc:DeleteFunctionOnDemandConfig",
"Effect": "Allow",
"Resource": "acs:fc:<region>:<account-id>:services/services/<serviceName>.<qualifier>/functions/<functionName>"
}
]
}
```

### s remove layer
系统策略:`AliyunFCReadOnlyAccess`
````json
{
"Version": "1",
"Statement": [
{
"Action": "fc:DeleteLayerVersion",
"Effect": "Allow",
"Resource": "acs:fc:<region>:<account-id>:layers/<layerName>/versions/*"
}
]
}
````


## info、sync 指令

系统策略:`AliyunFCReadOnlyAccess`
Expand Down Expand Up @@ -121,34 +276,6 @@
]
}
```
### 删除层的版本:deleteVersion、deleteLayer

```yaml
{
"Version": "1",
"Statement": [
{
"Action": "fc:DeleteLayerVersion",
"Effect": "Allow",
"Resource": "acs:fc:<region>:<account-id>:layers/<layerName>/versions/<versionId>"
}
]
}
```
### 删除层:deleteLayer
`AliyunFCReadOnlyAccess`
```yaml
{
"Version": "1",
"Statement": [
{
"Action": "fc:DeleteLayerVersion",
"Effect": "Allow",
"Resource": "acs:fc:<region>:<account-id>:layers/<layerName>/versions/*"
}
]
}
```

## version 指令
### 查看操作权限:list
Expand All @@ -167,19 +294,6 @@
]
}
```
### 删除版本:delete
```yaml
{
"Version": "1",
"Statement": [
{
"Action": "fc:DeleteServiceVersion",
"Effect": "Allow",
"Resource": "acs:fc:<region>:<account-id>:services/<serviceName>/versions/<version-id>"
}
]
}
```

## alias 指令
### 查看操作权限:list
Expand All @@ -201,19 +315,6 @@
]
}
```
### 删除:delete
```yaml
{
"Version": "1",
"Statement": [
{
"Action": "fc:DeleteAlias",
"Effect": "Allow",
"Resource": "acs:fc:<region>:<account-id>:services/<serviceName>/aliases/<aliasName>"
}
]
}
```

## provision 指令
### 查看操作权限:list get
Expand Down Expand Up @@ -251,20 +352,4 @@
]
}
```
### 删除:delete
```yaml
{
"Version": "1",
"Statement": [
{
"Action": "fc:DeleteFunctionOnDemandConfig",
"Effect": "Allow",
"Resource": "acs:fc:<region>:<account-id>:services/services/<serviceName>.<qualifier>/functions/<functionName>"
}
]
}
```




51 changes: 7 additions & 44 deletions docs/Usage/alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ SubCommand
get Get alias details, you can get help through [s alias get -h]
list View the list of service alias, you can get help through [s alias list -h]
publish Publish service alias, you can get help through [s alias publish -h]
delete Delete service alias, you can get help through [s alias delete -h]
publish Publish service alias, you can get help through [s alias publish -h]
```

Alias命令为我们提供了一些子命令:
Expand Down Expand Up @@ -61,6 +60,7 @@ Alias命令为我们提供了一些子命令:
$ s cli fc alias list --region cn-hangzhou --service-name name
```

- publish: 配置按量资源,可以通过`s alias publish -h`获取帮助文档
```
alias publish
Expand All @@ -76,7 +76,7 @@ Alias命令为我们提供了一些子命令:
--region string Specify the region parameter
--service-name string Specify the service name parameter
--alias-name string Specify the alias name parameter
--id, --version-id string Specify the version id parameter
--id,--version string Specify the version id parameter
--description string Specify the description parameter
--gversion string Specify the grayscale version id parameter
--weight string Specify the weight parameter
Expand All @@ -88,12 +88,12 @@ Alias命令为我们提供了一些子命令:
Examples with Yaml
$ s alias publish --alias-name pre --version-id 2
$ s exec -- alias publish --description xxx --alias-name pre --version-id 2 --gversion 3 --weight 20
$ s alias publish --alias-name pre --version 2
$ s exec -- alias publish --description xxx --alias-name pre --version 2 --gversion 3 --weight 20
Examples with CLI
$ s cli fc alias publish --region cn-hangzhou --service-name name --alias-name pre --version-id 2
$ s cli fc alias publish --region cn-hangzhou --service-name name --alias-name pre --version 2
```

- get: 查看按量资源,可以通过`s alias get -h`获取帮助文档
Expand Down Expand Up @@ -126,37 +126,7 @@ Alias命令为我们提供了一些子命令:
$ s cli fc alias get --region cn-hangzhou --service-name name --alias-name pre
```

- delete: 删除按量资源,可以通过`s alias delete -h`获取帮助文档
```
alias delete
Delete service alias

Usage
$ s alias delete
Command List
--region string Specify the region parameter
--service-name string Specify the service name parameter
--alias-name string Specify the alias parameter
Global Options
-a, --access Specify key alias
-h, --help Display help for command
Examples with Yaml
$ s alias delete --alias-name pre
$ s exec -- alias delete --alias-name pre
Examples with CLI
$ s cli fc alias delete --region cn-hangzhou --service-name name --alias-name pre
```

# 快速使用

Expand All @@ -172,7 +142,7 @@ s alias list


```
s alias publish --alias-name pre --version-id 2
s alias publish --alias-name pre --version 2
```

- 重点1:region、serviceName、aliasName、versionId 必填
Expand All @@ -186,13 +156,6 @@ s alias get --alias-name pre
- 重点1:region、serviceName、aliasName 必填


```
s alias delete --alias-name pre
```

- 重点1:region、serviceName、aliasName 必填



## 高级使用

Expand Down
Loading

0 comments on commit 989452a

Please sign in to comment.