使用RAM管理API__使用手冊(開放API)_API 網關-阿裏雲
API網關結合阿裏雲訪問控製(RAM)來實現企業內多職員分權管理API。API提供者可以為員工建立子賬戶,並控製不同職員負責不同的API管理。
- 使用RAM可以允許子帳號,查看、創建、管理、刪除API分組、API、授權、流控策略等。但子帳號不是資源的所有者,其操作權限隨時都可以被主帳號收回。
- 在查看本文前,請確保您已經祥讀了《RAM幫助手冊》和《API網關API手冊》.
- 若您不無此業務場景, 請跳過此章節。
策略管理
授權策略(Policy),來描述授權的具體內容,授權內容主要包含效力(Effect)、資源(Resource)、對資源所授予的操作權限(Action)以及限製條件(Condition)這幾個基本元素。
係統授權策略
API網關已經預置了兩個係統權限,AliyunApiGatewayFullAccess和AliyunApiGatewayReadOnlyAccess,可以到RAM的在RAM控製台-策略管理進行查看。
- AliyunApiGatewayFullAccess:管理員權限,擁有主帳號下包含API分組、API、流控策略、應用等所有資源的管理權限。
- AliyunApiGatewayReadOnlyAccess:可以查看主帳號下包含API分組、API、流控策略、應用等所有資源,但不可以操作。
自定義授權策略
您可以根據需要自定義管理權限,支持更為精細化的授權,可以為某個操作,也可以是某個資源。如:API:GetUsers的編輯權限。可以在RAM控製台-策略管理-自定義授權策略查看已經定義好的“自定義授權”:自定義授權查看、創建、修改、刪除方法請參照:《授權策略管理》
授權策略內容填寫方法請參照:《Policy基本元素》和《Policy語法結構》和下文的授權策略。授權策略
授權策略是一組權限的集合,它以一種策略語言來描述。通過給用戶或群組附加授權策略,用戶或群組中的所有用戶就能獲得授權策略中指定的訪問權限。
授權策略內容填寫方法請參照:《Policy基本元素》和《Policy語法結構》。
示例:
{
"Version": "1",
"Statement": [
{
"Action": "apigateway:Describe*",
"Resource": "*",
"Effect": "Allow"
}
]
}
此示例表示:允許所有的查看操作
Action(操作名稱列表)格式為:
"Action":"<service-name>:<action-name>"
其中:
- service-name為:阿裏雲產品名稱,請填寫apigateway
- action-name為:api接口名稱,請參照下表
- 支持通配符“*”
"Action": "apigateway:Describe*"
表示所有的查詢操作
" Action": "apigateway:*"
表示API網關所有操作
Resource(操作對象列表)
Resource通常指操作對象,API網關中的API分組、流控策略、應用都被稱為Resource,書寫格式:
acs:<service-name>:<region>:<account-id>:<relative-id>
其中:
- acs: Aliyun Cloud Service的首字母縮寫,表示阿裏雲的公有雲平台
- service-name為:阿裏雲產品名稱,請填寫apigateway
- region: 地區信息,可以使用通配符“”號來代替,“”表示所有區域
- account-id: 賬號ID,比如 1234567890123456,也可以用“*”代替
- relative-id: 與API網關相關的資源描述部分,這部分的格式描述支持類似於一個文件路徑的樹狀結構。
示例:
acs:apigateway:$regionid:$accountid:apigroup/$groupId
書寫
acs:apigateway:*:$accountid:apigroup/
請結合API網關的《API手冊》來查看下表
action-name | 資源(Resource) |
---|---|
AbolishApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
AddTrafficSpecialControl | acs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolid |
CreateApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
CreateApiGroup | acs:apigateway:$regionid:$accountid:apigroup/* |
CreateTrafficControl | acs:apigateway:$regionid:$accountid:trafficcontrol/* |
DeleteAllTrafficSpecialControl | acs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolid |
DeleteApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DeleteApiGroup | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DeleteDomain | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DeleteDomainCertificate | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DeleteTrafficControl | acs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolId |
DeleteTrafficSpecialControl | acs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolId |
DeployApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeApiError | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeApiGroupDetail | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeApiGroups | acs:apigateway:$regionid:$accountid:apigroup/* |
DescribeApiLatency | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeApiQps | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeApiRules | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeApis | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeApisByRule | acs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolId oracs:apigateway:$regionid:$accountid:secretkey/$secretKeyId |
DescribeApiTraffic | acs:apigateway:$regionid:$accountid:apigroup/$groupid |
DescribeAppsByApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
AddBlackList | acs:apigateway:$regionid:$accountid:blacklist/* |
DescribeBlackLists | acs:apigateway:$regionid:$accountid:blacklist/* |
DescribeDeployedApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeDeployedApis | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeDomain | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeDomainResolution | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeHistoryApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
DescribeHistoryApis | acs:apigateway:$regionid:$accountid:apigroup/* |
DescribeRulesByApi | acs:apigateway:$regionid:$accountid:group/$groupId |
DescribeSecretKeys | acs:apigateway:$regionid:$accountid:secretkey/* |
DescribeTrafficControls | acs:apigateway:$regionid:$accountid:trafficcontrol/* |
ModifyApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
ModifyApiGroup | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
ModifySecretKey | acs:apigateway:$regionid:$accountid:secretkey/$secretKeyId |
RecoverApiFromHistorical | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
RefreshDomain | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
RemoveAccessPermissionByApis | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
RemoveAccessPermissionByApps | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
RemoveAllBlackList | acs:apigateway:$regionid:$accountid:blacklist/* |
RemoveApiRule | acs:apigateway:$regionid:$accountid:apigroup/$groupId(acs:apigateway:$regionid:$accountid:secretkey/$secretKeyId oracs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolId) |
RemoveAppsFromApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
RemoveBlackList | acs:apigateway:$regionid:$accountid:blacklist/$blacklistid |
SetAccessPermissionByApis | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
SetAccessPermissions | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
SetApiRule | acs:apigateway:$regionid:$accountid:apigroup/$groupId(acs:apigateway:$regionid:$accountid:secretkey/$secretKeyId oracs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolId) |
SetDomain | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
SetDomainCertificate | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
SwitchApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
CreateSecretKey | acs:apigateway:$regionid:$accountid:secretkey/* |
DeleteSecretKey | acs:apigateway:$regionid:$accountid:secretkey/$secretKeyId |
最後更新:2016-12-06 14:07:00
上一篇:
OpenID Connect認證__使用手冊(開放API)_API 網關-阿裏雲
下一篇:
創建API分組__快速入門(開放API)_API 網關-阿裏雲
付費模式轉換__購買指南_數據傳輸-阿裏雲
編寫Graph__快速開始_大數據計算服務-阿裏雲
kafka用戶遷移__常見問題_日誌服務-阿裏雲
修改共享帶寬包-減少公網IP__NAT網關相關接口_API 參考_雲服務器 ECS-阿裏雲
推薦引擎__數加產品概覽_數加平台介紹-阿裏雲
雲數據庫 MongoDB 版__雲服務監控_用戶指南_雲監控-阿裏雲
SetLoadBalancerName__LoadBalancer相關API_API 參考_負載均衡-阿裏雲
格式轉換___圖片處理指南_對象存儲 OSS-阿裏雲
SSH 登錄時出現如下錯誤:ssh_exchange_identification: read: Connection reset by peer__遠程登錄 (SSH)_Linux操作運維問題_雲服務器 ECS-阿裏雲
步驟4:修改DNS解析(可選)__快速入門(非網站業務)_DDoS 高防IP-阿裏雲
相關內容
常見錯誤說明__附錄_大數據計算服務-阿裏雲
發送短信接口__API使用手冊_短信服務-阿裏雲
接口文檔__Android_安全組件教程_移動安全-阿裏雲
運營商錯誤碼(聯通)__常見問題_短信服務-阿裏雲
設置短信模板__使用手冊_短信服務-阿裏雲
OSS 權限問題及排查__常見錯誤及排除_最佳實踐_對象存儲 OSS-阿裏雲
消息通知__操作指南_批量計算-阿裏雲
設備端快速接入(MQTT)__快速開始_阿裏雲物聯網套件-阿裏雲
查詢API調用流量數據__API管理相關接口_API_API 網關-阿裏雲
使用STS訪問__JavaScript-SDK_SDK 參考_對象存儲 OSS-阿裏雲