NSX-T Data Center Global Manager REST API

Rule (type)

{
  "additionalProperties": false, 
  "description": "A rule indicates the action to be performed for various types of traffic flowing between workload groups.", 
  "extends": {
    "$ref": "BaseRule
  }, 
  "id": "Rule", 
  "module_id": "Policy", 
  "properties": {
    "_create_time": {
      "$ref": "EpochMsTimestamp, 
      "can_sort": true, 
      "description": "Timestamp of resource creation", 
      "readonly": true
    }, 
    "_create_user": {
      "description": "ID of the user who created this resource", 
      "readonly": true, 
      "type": "string"
    }, 
    "_last_modified_time": {
      "$ref": "EpochMsTimestamp, 
      "can_sort": true, 
      "description": "Timestamp of last modification", 
      "readonly": true
    }, 
    "_last_modified_user": {
      "description": "ID of the user who last modified this resource", 
      "readonly": true, 
      "type": "string"
    }, 
    "_links": {
      "description": "The server will populate this field when returing the resource. Ignored on PUT and POST.", 
      "items": {
        "$ref": "ResourceLink
      }, 
      "readonly": true, 
      "title": "References related to this resource", 
      "type": "array"
    }, 
    "_protection": {
      "description": "Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed             to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed                 to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super                    user and can modify it, but only when providing                    the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this           entity.", 
      "readonly": true, 
      "title": "Indicates protection status of this resource", 
      "type": "string"
    }, 
    "_revision": {
      "computed": true, 
      "description": "The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected.", 
      "title": "Generation of this resource config", 
      "type": "int"
    }, 
    "_schema": {
      "readonly": true, 
      "title": "Schema for this resource", 
      "type": "string"
    }, 
    "_self": {
      "$ref": "SelfResourceLink, 
      "readonly": true, 
      "title": "Link to this resource"
    }, 
    "_system_owned": {
      "description": "Indicates system owned resource", 
      "readonly": true, 
      "type": "boolean"
    }, 
    "action": {
      "description": "The action to be applied to all the services. REJECT is not allowed for Layer-2 (Ethernet category) rules -- use DROP instead. JUMP_TO_APPLICATION is only valid for DFW rules (not Gateway Firewall) created in the Environment category. Once a match is hit then the rule processing will jump to the rules present in the Application category, skipping all further rules in the Environment category. If no rules match in the Application category then the default application rule will be hit.", 
      "enum": [
        "ALLOW", 
        "DROP", 
        "REJECT", 
        "JUMP_TO_APPLICATION"
      ], 
      "required": false, 
      "title": "Action", 
      "type": "string"
    }, 
    "children": {
      "description": "Subtree for this type within policy tree containing nested elements. Note that  this type is applicable to be used in Hierarchical API only.", 
      "items": {
        "$ref": "ChildPolicyConfigResource
      }, 
      "required": false, 
      "title": "Subtree for this type within policy tree", 
      "type": "array"
    }, 
    "description": {
      "can_sort": true, 
      "maxLength": 1024, 
      "title": "Description of this resource", 
      "type": "string"
    }, 
    "destination_groups": {
      "description": "Specifies the destinations to match for this rule. This field accepts Group paths (e.g., \"/infra/domains/default/groups/db-vms\") or direct IP addresses. Group paths reference Group objects that define collections of workloads. IP addresses can be specified in CIDR notation, as individual addresses, or as ranges. Use the constant \"ANY\" to match all destinations. \"ANY\" is case insensitive and must be the ONLY element in the array if used. An error will be thrown if \"ANY\" is used in conjunction with other values.", 
      "items": {
        "type": "string"
      }, 
      "maxItems": 128, 
      "required": false, 
      "title": "Destination group paths", 
      "type": "array", 
      "x-vmw-cross-reference": [
        {
          "leftType": [
            "Rule", 
            "ForwardingRule", 
            "RedirectionRule"
          ], 
          "relationshipType": "COMMUNICATION_ENTRY_DEST_GROUP_RELATIONSHIP", 
          "rightType": [
            "Group"
          ]
        }, 
        {
          "leftType": [
            "TlsRule"
          ], 
          "relationshipType": "TLS_GATEWAY_RULE_DEST_GROUP_RELATIONSHIP", 
          "rightType": [
            "Group"
          ]
        }, 
        {
          "leftType": [
            "IdsRule"
          ], 
          "relationshipType": "IDS_RULE_DEST_GROUP_RELATIONSHIP", 
          "rightType": [
            "Group"
          ]
        }, 
        {
          "leftType": [
            "SecurityPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "GatewayPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "ForwardingPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "IdsGatewayPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }
      ]
    }, 
    "destinations_excluded": {
      "default": false, 
      "description": "If set to true, the rule gets applied on all the groups that are NOT part of the destination groups. If false, the rule applies to the destination groups", 
      "readonly": false, 
      "required": false, 
      "title": "Negation of destination groups", 
      "type": "boolean"
    }, 
    "direction": {
      "default": "IN_OUT", 
      "description": "Specifies the direction of traffic to which this rule applies: - IN: Applies to incoming traffic only (traffic coming into the workload) - OUT: Applies to outgoing traffic only (traffic leaving the workload) - IN_OUT: Applies to both incoming and outgoing traffic (default)", 
      "enum": [
        "IN", 
        "OUT", 
        "IN_OUT"
      ], 
      "required": false, 
      "title": "Direction", 
      "type": "string"
    }, 
    "disabled": {
      "default": false, 
      "description": "Flag to deactivate the rule. Default is activated.", 
      "readonly": false, 
      "required": false, 
      "title": "Flag to deactivate the rule", 
      "type": "boolean"
    }, 
    "display_name": {
      "can_sort": true, 
      "computed": true, 
      "description": "Defaults to ID if not set", 
      "maxLength": 255, 
      "title": "Identifier to use when displaying entity in logs or GUI", 
      "type": "string"
    }, 
    "id": {
      "can_sort": true, 
      "title": "Unique identifier of this resource", 
      "type": "string"
    }, 
    "ip_protocol": {
      "description": "Type of IP packet that should be matched while enforcing the rule. The value is set to IPV4_IPV6 for Layer3 rule if not specified. For Layer2/Ether rule the value must be null.", 
      "enum": [
        "IPV4", 
        "IPV6", 
        "IPV4_IPV6"
      ], 
      "readonly": false, 
      "required": false, 
      "title": "IPv4 vs IPv6 packet type", 
      "type": "string"
    }, 
    "is_default": {
      "description": "A flag to indicate whether rule is a default rule.", 
      "readonly": true, 
      "required": false, 
      "title": "Default rule flag", 
      "type": "boolean"
    }, 
    "logged": {
      "default": false, 
      "description": "Flag to enable packet logging. Default is deactivated.", 
      "readonly": false, 
      "required": false, 
      "title": "Enable logging flag", 
      "type": "boolean"
    }, 
    "marked_for_delete": {
      "default": false, 
      "description": "Intent objects are not directly deleted from the system when a delete is invoked on them. They are marked for deletion and only when all the realized entities for that intent object gets deleted, the intent object is deleted. Objects that are marked for deletion are not returned in GET call. One can use the search API to get these objects.", 
      "readonly": true, 
      "required": false, 
      "title": "Indicates whether the intent object is marked for deletion", 
      "type": "boolean"
    }, 
    "notes": {
      "description": "User level field which will be printed in CLI and packet logs. The notes field accepts up to 2048 characters. Internally, notes are truncated after 39 characters in CLI and packet logs.", 
      "maxLength": 2048, 
      "readonly": false, 
      "required": false, 
      "title": "Text for additional notes on changes", 
      "type": "string"
    }, 
    "origin_site_id": {
      "description": "This is a UUID generated by the system for knowing which site owns an object. This is used in NSX+.", 
      "readonly": true, 
      "required": false, 
      "title": "A unique identifier assigned by the system for knowing which site owns an object", 
      "type": "string"
    }, 
    "overridden": {
      "default": false, 
      "description": "Global intent objects cannot be modified by the user. However, certain global intent objects can be overridden locally by use of this property. In such cases, the overridden local values take precedence over the globally defined values for the properties.", 
      "readonly": true, 
      "required": false, 
      "title": "Indicates whether this object is the overridden intent object", 
      "type": "boolean"
    }, 
    "owner_id": {
      "description": "This is a UUID generated by the system for knowing who owns this object. This is used in NSX+.", 
      "readonly": true, 
      "required": false, 
      "title": "A unique identifier assigned by the system for the ownership of an object", 
      "type": "string"
    }, 
    "parent_path": {
      "description": "Path of its parent", 
      "readonly": true, 
      "required": false, 
      "title": "Path of its parent", 
      "type": "string"
    }, 
    "path": {
      "description": "Absolute path of this object", 
      "readonly": true, 
      "required": false, 
      "title": "Absolute path of this object", 
      "type": "string"
    }, 
    "profiles": {
      "description": "Paths to Layer 7 service profile objects or L7 access profile objects for advanced traffic inspection and filtering. These profiles enable matching on Layer 7 attributes and sub-attributes of network services such as: - Application IDs (L4 AppId) - Encryption algorithms and TLS versions   - Domain names and URLs - HTTP methods - CIFS/SMB versions You can use either Layer 7 service profiles (PolicyContextProfile) or an L7 access profile (L7AccessProfile) in a rule, but not both. When using an L7 access profile, only one profile path is allowed.", 
      "items": {
        "type": "string"
      }, 
      "maxItems": 128, 
      "required": false, 
      "title": "Layer 7 service profiles or L7 access profile paths", 
      "type": "array", 
      "x-vmw-cross-reference": [
        {
          "leftType": [
            "Rule", 
            "ForwardingRule", 
            "RedirectionRule"
          ], 
          "relationshipType": "COMMUNICATION_ENTRY_CONTEXT_PROFILE_RELATIONSHIP", 
          "rightType": [
            "PolicyContextProfile"
          ]
        }, 
        {
          "leftType": [
            "Rule"
          ], 
          "relationshipType": "COMMUNICATION_ENTRY_L7_ACCESS_PROFILE_RELATIONSHIP", 
          "rightType": [
            "L7AccessProfile"
          ]
        }, 
        {
          "leftType": [
            "TlsRule"
          ], 
          "relationshipType": "TLS_GATEWAY_RULE_CONTEXT_PROFILE_RELATIONSHIP", 
          "rightType": [
            "PolicyContextProfile"
          ]
        }, 
        {
          "leftType": [
            "SecurityPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "GatewayPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "ForwardingPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "IdsGatewayPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }
      ]
    }, 
    "realization_id": {
      "description": "This is a UUID generated by the system for realizing the entity object. In most cases this should be same as 'unique_id' of the entity. However, in some cases this can be different because of entities have migrated their unique identifier to NSX Policy intent objects later in the timeline and did not use unique_id for realization. Realization id is helpful for users to debug data path to correlate the configuration with corresponding intent.", 
      "readonly": true, 
      "required": false, 
      "title": "A unique identifier assigned by the system for realizing intent", 
      "type": "string"
    }, 
    "relative_path": {
      "description": "Path relative from its parent", 
      "readonly": true, 
      "required": false, 
      "title": "Relative path of this object", 
      "type": "string"
    }, 
    "remote_path": {
      "description": "This path is populated only in case of multi-site scenario. Currently it is supported only for LM objects. When LM is onboarded to multi-site platform like NAPP or GM, remote_path will be set to the globally unique path across multi-site topology . It is generated based on local site-name and uses /org tree namespace. Note: It is populated only for LM objects. Not supported on the GM.", 
      "readonly": true, 
      "required": false, 
      "title": "Path of the object on the remote end.", 
      "type": "string"
    }, 
    "resource_type": {
      "description": "The type of this resource.", 
      "readonly": false, 
      "type": "string"
    }, 
    "rule_id": {
      "description": "This is a unique positive integer identifier assigned by the system for each rule. The rule_id is passed down to the data path for rule matching and statistics. The system allocates rule IDs from a shared number space between Global Manager (GM)  and Local Manager (LM) using a zebra-style striped allocation: - 1000 to 999,999: allocated by LM - 1,000,000 to 1,999,999: allocated by GM - 2,000,000 to 2,999,999: allocated by LM - And so on, alternating in ranges of 1 million The rule_id is typically a small integer (1-4 digits for most deployments) rather  than utilizing the full 32-bit range.", 
      "readonly": true, 
      "required": false, 
      "title": "Unique rule ID", 
      "type": "integer"
    }, 
    "scope": {
      "description": "The list of group paths to which the rule applies. This determines which workloads (VMs, containers, etc.) the rule is enforced on. For Gateway Firewall rules, this can also include Tier-0, Tier-1, or interface paths to specify where the rule is enforced. Note that a given rule can be applied to multiple groups or network entities.", 
      "items": {
        "type": "string"
      }, 
      "maxItems": 128, 
      "required": false, 
      "type": "array", 
      "x-vmw-cross-reference": [
        {
          "leftType": [
            "Rule", 
            "ForwardingRule", 
            "RedirectionRule"
          ], 
          "relationshipType": "COMMUNICATION_ENTRY_SCOPE_RELATIONSHIP", 
          "rightType": [
            "PolicyLabel", 
            "Tier0Interface", 
            "Tier1Interface", 
            "Tier0", 
            "Tier1", 
            "IPSecVpnSession", 
            "Group"
          ]
        }, 
        {
          "leftType": [
            "TlsRule"
          ], 
          "relationshipType": "TLS_GATEWAY_RULE_SCOPE_RELATIONSHIP", 
          "rightType": [
            "PolicyLabel", 
            "Tier1Interface", 
            "Tier0", 
            "Tier1Interface", 
            "Tier1", 
            "Group"
          ]
        }, 
        {
          "leftType": [
            "IdsRule"
          ], 
          "relationshipType": "IDS_RULE_SCOPE_RELATIONSHIP", 
          "rightType": [
            "PolicyLabel", 
            "Tier1Interface", 
            "Tier0", 
            "Tier1Interface", 
            "Tier1", 
            "Group"
          ]
        }, 
        {
          "leftType": [
            "SecurityPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "GatewayPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "ForwardingPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "IdsGatewayPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }
      ]
    }, 
    "sequence_number": {
      "description": "This field is used to resolve conflicts between multiple Rules under a Security or Gateway Policy for a Domain. Rules are evaluated in ascending sequence number order. If no sequence number is specified in the payload, the system assigns a default value of 0. If there are multiple rules with the same sequence number then their order is not deterministic. If a specific order of rules is desired, specify unique sequence numbers or use the POST request on the rule entity with a query parameter action=revise to let the framework assign a sequence number.", 
      "minimum": 0, 
      "required": false, 
      "title": "Sequence number of this Rule", 
      "type": "int"
    }, 
    "service_entries": {
      "description": "In order to specify raw services this can be used, along with services which contains path to services. This can be empty or null.", 
      "items": {
        "$ref": "ServiceEntry
      }, 
      "maxItems": 128, 
      "required": false, 
      "title": "Raw services", 
      "type": "array"
    }, 
    "services": {
      "description": "Paths to Service objects (e.g., \"/infra/services/HTTP\") that define the network services (protocols and ports) to which this rule applies. In order to specify all services, use the constant \"ANY\". This is case insensitive. If \"ANY\" is used, it should be the ONLY element in the services array. Error will be thrown if ANY is used in conjunction with other values.", 
      "items": {
        "type": "string"
      }, 
      "maxItems": 128, 
      "required": false, 
      "title": "Service paths", 
      "type": "array", 
      "x-vmw-cross-reference": [
        {
          "leftType": [
            "Rule", 
            "ForwardingRule", 
            "RedirectionRule"
          ], 
          "relationshipType": "COMMUNICATION_ENTRY_SERVICE_RELATIONSHIP", 
          "rightType": [
            "Service"
          ]
        }, 
        {
          "leftType": [
            "TlsRule"
          ], 
          "relationshipType": "TLS_GATEWAY_RULE_SERVICE_RELATIONSHIP", 
          "rightType": [
            "Service"
          ]
        }, 
        {
          "leftType": [
            "IdsRule"
          ], 
          "relationshipType": "IDS_RULE_SERVICE_RELATIONSHIP", 
          "rightType": [
            "Service"
          ]
        }, 
        {
          "leftType": [
            "SecurityPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "GatewayPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "ForwardingPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "IdsGatewayPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }
      ]
    }, 
    "source_groups": {
      "description": "Specifies the sources to match for this rule. This field accepts Group paths (e.g., \"/infra/domains/default/groups/web-vms\") or direct IP addresses. Group paths reference Group objects that define collections of workloads. IP addresses can be specified in CIDR notation, as individual addresses, or as ranges. Use the constant \"ANY\" to match all sources. \"ANY\" is case insensitive and must be the ONLY element in the array if used. An error will be thrown if \"ANY\" is used in conjunction with other values.", 
      "items": {
        "type": "string"
      }, 
      "maxItems": 128, 
      "required": false, 
      "title": "Source group paths", 
      "type": "array", 
      "x-vmw-cross-reference": [
        {
          "leftType": [
            "Rule", 
            "ForwardingRule", 
            "RedirectionRule"
          ], 
          "relationshipType": "COMMUNICATION_ENTRY_SOURCE_GROUP_RELATIONSHIP", 
          "rightType": [
            "Group"
          ]
        }, 
        {
          "leftType": [
            "TlsRule"
          ], 
          "relationshipType": "TLS_GATEWAY_RULE_SOURCE_GROUP_RELATIONSHIP", 
          "rightType": [
            "Group"
          ]
        }, 
        {
          "leftType": [
            "IdsRule"
          ], 
          "relationshipType": "IDS_RULE_SOURCE_GROUP_RELATIONSHIP", 
          "rightType": [
            "Group"
          ]
        }, 
        {
          "leftType": [
            "SecurityPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "GatewayPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "ForwardingPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }, 
        {
          "leftType": [
            "IdsGatewayPolicy"
          ], 
          "relationshipType": "IGNORE", 
          "rightType": []
        }
      ]
    }, 
    "sources_excluded": {
      "default": false, 
      "description": "If set to true, the rule gets applied on all the groups that are NOT part of the source groups. If false, the rule applies to the source groups", 
      "readonly": false, 
      "required": false, 
      "title": "Negation of source groups", 
      "type": "boolean"
    }, 
    "tag": {
      "description": "User level field which will be printed in CLI and packet logs. Even though there is no limitation on length of a tag, internally tag will get truncated after 32 characters.", 
      "required": false, 
      "title": "Tag applied on the rule", 
      "type": "string"
    }, 
    "tags": {
      "items": {
        "$ref": "Tag
      }, 
      "maxItems": 30, 
      "title": "Opaque identifiers meaningful to the API user", 
      "type": "array"
    }, 
    "unique_id": {
      "description": "This is a UUID generated by the GM/LM to uniquely identify entities in a federated environment. For entities that are stretched across multiple sites, the same ID will be used on all the stretched sites.", 
      "readonly": true, 
      "required": false, 
      "title": "A unique identifier assigned by the system", 
      "type": "string"
    }
  }, 
  "title": "A rule specifies the security policy rule between the workload groups", 
  "type": "object"
}