DeletePortForwardingRule

API Request

URLs
DELETE zstack/v1/port-forwarding/{uuid}?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 064a2c25381042d6b623c12e26418e78" \
-X DELETE http://localhost:8080/zstack/v1/port-forwarding/495b48a2bcf745e1ac584be6e366f0ab?deleteMode=Permissive
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
deleteMode String body Optional. The delete mode. Options: Permissive | Enforcing. Default mode: Permissive.
  • Permissive: If an error occurs, or if the delete operation is refused, ZStack Cloud will stop the delete operation. In this mode, an error code that contains the failure reason will be returned.
  • Enforcing: ZStack Cloud will ignore all errors and permissions to delete directly the resource. In this mode, the delete operation will always succeed.
0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
    }
}

SDK Sample

Java SDK
DeletePortForwardingRuleAction action = new DeletePortForwardingRuleAction();
action.uuid = "42154ff320ea407dbc8b48088e541dcb";
action.deleteMode = "Permissive";
action.sessionId = "2b5cb5c82fb846669cd2c5e557bb140e";
DeletePortForwardingRuleAction.Result res = action.call();
Python SDK
DeletePortForwardingRuleAction action = DeletePortForwardingRuleAction()
action.uuid = "a8ac2d430d71487ea47419950e39ee4a"
action.deleteMode = "Permissive"
action.sessionId = "156eb3cd301546828a925386f331eb34"
DeletePortForwardingRuleAction.Result res = action.call()