Add Redirect Rule to Access Control List

POST/zstack/v1/access-control-lists/{aclUuid}/redirectRules

Headers

Authorization: OAuth the-session-uuid

Body

{
  "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/redirectRules

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
name (optional)Stringbody (contained in the params structure)Resource name 4.1.3
description (optional)Stringbody (contained in the params structure)Detailed description of the resource 4.1.3
domain (optional)Stringbody (contained in the params structure)Domain name 4.1.3
url (optional)Stringbody (contained in the params structure)url 4.1.3
aclUuidStringurlUnique identifier of the access control list 4.1.3
resourceUuid (optional)Stringbody (contained in the params structure)Resource UUID 4.1.3
tagUuids (optional)Listbody (contained in the params structure)Tag UUID list 4.1.3
systemTags (optional)ListbodySystem tags 4.1.3
userTags (optional)ListbodyUser tags 4.1.3

API Response

Response Example

{
  "inventory": {
    "aclUuid": "3e05577ffa823e759d67e112aa7e5f80",
    "ipEntries": "192.168.48.0/24"
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error3.9
inventoryAccessControlListEntryInventorySee inventory3.9

error

NameTypeDescriptionStarting Version
codeStringError code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field. Defaults to null0.6
opaqueLinkedHashMapReserved field. Defaults to null0.6
causeErrorCodeRoot error. The source error that caused this error. Null if no root cause exists0.6

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource0.6
aclUuidString 0.6
typeString 0.6
nameStringResource name0.6
domainString 0.6
urlString 0.6
ipEntriesString 0.6
descriptionStringDetailed description of the resource0.6
createDateTimestampCreation time0.6
lastOpDateTimestampLast modification time0.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()