Update IP Access Control Rule

PUT/zstack/v1/login-control/access-control/rules/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateAccessControlRule": {
    "name": "rule1",
    "description": "this is a rule"
  },
  "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 PUT -d '{"updateAccessControlRule":{"name":"rule1","description":"this is a rule"}}' http://localhost:8080/zstack/v1/login-control/access-control/rules/6bc3181222854438ac8af53f2b57ecf7/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlThe UUID of the resource. Uniquely identifies the resource 3.5.1
name (optional)Stringbody (contained in the updateAccessControlRule structure)Resource name 3.5.1
description (optional)Stringbody (contained in the updateAccessControlRule structure)Detailed description of the resource 3.5.1
systemTags (optional)Listbody  3.5.1
userTags (optional)Listbody  3.5.1

API Response

Response Example

{
  "inventory": {
    "name": "rule",
    "description": "this is rule description",
    "rule": "172.20.1.1",
    "strategy": "ACCEPT",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error3.5.1
inventoryAccessControlRuleInventorySee inventory3.5.1

error

NameTypeDescriptionStarting Version
codeStringError code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.10013.5.1
descriptionStringBrief description of the error3.5.1
detailsStringDetailed error information3.5.1
elaborationStringReserved field. Defaults to null3.5.1
opaqueLinkedHashMapReserved field. Defaults to null3.5.1
causeErrorCodeRoot error. The source error that caused this error. Null if no root cause exists3.5.1

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource3.5.1
nameStringResource name3.5.1
descriptionStringDetailed description of the resource3.5.1
ruleString 3.5.1
createDateTimestampCreation time3.5.1
lastOpDateTimestampLast modification time3.5.1
strategyControlStrategySee strategy3.5.1

strategy

NameTypeDescriptionStarting Version
ACCEPTControlStrategy 3.5.1
REJECTControlStrategy 3.5.1

SDK Examples

Java SDK

UpdateAccessControlRuleAction action = new UpdateAccessControlRuleAction();
action.uuid = "c3fb6843d7b84791bbffb762e35b3065";
action.name = "rule1";
action.description = "this is a rule";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateAccessControlRuleAction.Result res = action.call();

Python SDK

UpdateAccessControlRuleAction action = UpdateAccessControlRuleAction()
action.uuid = "4c30b1ea5adf450ebca75f8b8606b964"
action.name = "rule1"
action.description = "this is a rule"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateAccessControlRuleAction.Result res = action.call()