You can call the AddAuthPolicy operation to create a service authentication rule.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mse:AddAuthPolicy |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
Yes |
The name of the rule. |
test |
| Source |
string |
Yes |
The source. The value can be `edasmsc`. |
edasmsc |
| Region |
string |
Yes |
The region. |
cn-hangzhou |
| Enable |
string |
Yes |
Specifies whether to enable the authentication rule. Valid values:
|
true |
| AppId |
string |
No |
The application ID. |
e9clba2xlc@*** |
| Protocol |
string |
Yes |
The protocol type. Valid values:
|
SPRING_CLOUD |
| AuthRule |
string |
Yes |
The content of the service authentication rule. |
[{"all":true,"black":false,"appIds":["dez4qt7weh@***"]}] |
| Namespace |
string |
No |
The MSE namespace to which the application belongs. |
default |
| AuthType |
integer |
No |
The type of the rule. Valid values:
|
0 |
| K8sNamespace |
string |
No |
The ID of the namespace in the Kubernetes cluster. |
c19c6c500e1ff4d7abc7*** |
| AcceptLanguage |
string |
No |
The language of the response. Valid values: zh-CN (default): Chinese, en-US: English |
zh |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| RequestId |
string |
The request ID. |
dc63-465d-8ef5-20dc18af**** |
| Message |
string |
The response message. |
OK |
| Data |
string |
The data overview. |
|
| Code |
integer |
The response code. Its value is synchronized with the `Success` parameter. |
200 |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
Examples
Success response
JSON format
{
"HttpStatusCode": 200,
"RequestId": "dc63-465d-8ef5-20dc18af****",
"Message": "OK",
"Data": "",
"Code": 200,
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IllegalRequest | Invalid request:%s | Invalid request: %s |
| 400 | InvalidParameter | Parameter error:%s | Request parameter error: %s |
| 500 | InternalError | Console error. Try again later:%s | Console error. Try again later: %s |
| 403 | NoPermission | You are not authorized to perform this operation:%s | You do not have the permission to use this interface:%s |
| 404 | NotFound | Not found:%s | The resource does not exist:%s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.