Add Redirect Rule to Access Control List
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"name": "redirect-rule",
"domain": "zstack.io",
"url": "/cloud"
},
"systemTags": [],
"userTags": []
}The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"redirect-rule","domain":"zstack.io","url":"/cloud"}}' \
http://localhost:8080/zstack/v1/access-control-lists/f1ca42b8901833fbac7cbd06e3b4d7cb/redirectRulesParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| name (optional) | String | body (contained in the params structure) | Resource name | 4.1.3 | |
| description (optional) | String | body (contained in the params structure) | Detailed description of the resource | 4.1.3 | |
| domain (optional) | String | body (contained in the params structure) | Domain name | 4.1.3 | |
| url (optional) | String | body (contained in the params structure) | url | 4.1.3 | |
| aclUuid | String | url | Unique identifier of the access control list | 4.1.3 | |
| resourceUuid (optional) | String | body (contained in the params structure) | Resource UUID | 4.1.3 | |
| tagUuids (optional) | List | body (contained in the params structure) | Tag UUID list | 4.1.3 | |
| systemTags (optional) | List | body | System tags | 4.1.3 | |
| userTags (optional) | List | body | User tags | 4.1.3 |
API Response
Response Example
{
"inventory": {
"aclUuid": "3e05577ffa823e759d67e112aa7e5f80",
"ipEntries": "192.168.48.0/24"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. See error | 3.9 |
| inventory | AccessControlListEntryInventory | See inventory | 3.9 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field. Defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field. Defaults to null | 0.6 |
| cause | ErrorCode | Root error. The source error that caused this error. Null if no root cause exists | 0.6 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the resource. Uniquely identifies the resource | 0.6 |
| aclUuid | String | 0.6 | |
| type | String | 0.6 | |
| name | String | Resource name | 0.6 |
| domain | String | 0.6 | |
| url | String | 0.6 | |
| ipEntries | String | 0.6 | |
| description | String | Detailed description of the resource | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
SDK Examples
Java SDK
AddAccessControlListRedirectRuleAction action = new AddAccessControlListRedirectRuleAction();
action.name = "redirect-rule";
action.domain = "zstack.io";
action.url = "/cloud";
action.aclUuid = "f1ca42b8901833fbac7cbd06e3b4d7cb";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddAccessControlListRedirectRuleAction.Result res = action.call();Python SDK
AddAccessControlListRedirectRuleAction action = AddAccessControlListRedirectRuleAction()
action.name = "redirect-rule"
action.domain = "zstack.io"
action.url = "/cloud"
action.aclUuid = "f1ca42b8901833fbac7cbd06e3b4d7cb"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddAccessControlListRedirectRuleAction.Result res = action.call()