---
title: "Get all network security rules"
method: POST
path: "/network_security_rules/list"
tags: ["network_security_rules"]
---

# Get all network security rules

`POST /network_security_rules/list`

This operation gets a list of Network security rules, allowing for sorting and pagination. Note: Entities that have not been created successfully are not listed.

## Request body

- NetworkSecurityRuleListMetadata — All api calls that return a list will have this metadata block as input
  - `filter` string — The filter in FIQL syntax used for the results.
  - `kind` string — The kind name
  - `sort_order` string — The sort order in which results are returned
  - `offset` integer — Offset from the start of the entity list
  - `length` integer — The number of records to retrieve relative to the offset
  - `sort_attribute` string — The attribute to perform sort on

## Response `200`

Success

- NetworkSecurityRuleListIntentResponse — Response object for intentful operation of network_security_rules
  - `entities` NetworkSecurityRuleIntentResource[]
    - `status` NetworkSecurityRuleDefStatus — Network security rule status
      - `state` string
      - `message_list` MessageResource[]
        - `message` string, required — If state is ERROR, a message describing the error.
        - `reason` string, required — If state is ERROR, a machine-readable snake-cased string.
        - `details` object — Custom key-value details relevant to the status.
      - `name` string
      - `resources` NetworkSecurityRuleResources — Network security rule resources
        - `app_rule` object — These rules govern what flows are allowed. Target group is a required attribute. Empty inbound_allow_list will not anything into target group. Empty outbound_allow_list will allow everything from target group.
          - `action` string — Type of deployment of the rule.
          - `outbound_allow_list` NetworkRule[]
            - `protocol` string — Select a protocol to allow. Multiple protocols can be allowed by repeating network_rule object. If a protocol is not configured in the network_rule object then it is allowed.
            - `ip_subnet` IpSubnet — IP subnet provided as an address and prefix length.
              - …
            - `tcp_port_range_list` PortRange[] — List of TCP ports that are allowed by this rule.
              - …
            - `udp_port_range_list` PortRange[] — List of UDP ports that are allowed by this rule.
              - …
            - `peer_specification_type` string — The set of categories that matching VMs need to have.
            - `filter` CategoryFilter — A category filter.
              - …
            - `icmp_type_code_list` object[] — List of ICMP types and codes allowed by this rule.
              - …
            - `network_function_chain_reference` NetworkFunctionChainReference — The reference to a network_function_chain
              - …
            - `expiration_time` string — Timestamp of expiration time.
          - `target_group` TargetGroup — Target group
            - `filter` CategoryFilter — A category filter.
              - …
            - `default_internal_policy` string — Default policy for communication within target group.
            - `peer_specification_type` string — Way to identify the object for which rule is applied.
          - `inbound_allow_list` NetworkRule[]
            - `protocol` string — Select a protocol to allow. Multiple protocols can be allowed by repeating network_rule object. If a protocol is not configured in the network_rule object then it is allowed.
            - `ip_subnet` IpSubnet — IP subnet provided as an address and prefix length.
              - …
            - `tcp_port_range_list` PortRange[] — List of TCP ports that are allowed by this rule.
              - …
            - `udp_port_range_list` PortRange[] — List of UDP ports that are allowed by this rule.
              - …
            - `peer_specification_type` string — The set of categories that matching VMs need to have.
            - `filter` CategoryFilter — A category filter.
              - …
            - `icmp_type_code_list` object[] — List of ICMP types and codes allowed by this rule.
              - …
            - `network_function_chain_reference` NetworkFunctionChainReference — The reference to a network_function_chain
              - …
            - `expiration_time` string — Timestamp of expiration time.
        - `quarantine_rule` object — These rules are used for quarantining suspected VMs. Target group is a required attribute. Empty inbound_allow_list will not allow anything into target group. Empty outbound_allow_list will allow everything from target group.
          - `action` string — Type of action.
          - `outbound_allow_list` NetworkRule[]
            - `protocol` string — Select a protocol to allow. Multiple protocols can be allowed by repeating network_rule object. If a protocol is not configured in the network_rule object then it is allowed.
            - `ip_subnet` IpSubnet — IP subnet provided as an address and prefix length.
              - …
            - `tcp_port_range_list` PortRange[] — List of TCP ports that are allowed by this rule.
              - …
            - `udp_port_range_list` PortRange[] — List of UDP ports that are allowed by this rule.
              - …
            - `peer_specification_type` string — The set of categories that matching VMs need to have.
            - `filter` CategoryFilter — A category filter.
              - …
            - `icmp_type_code_list` object[] — List of ICMP types and codes allowed by this rule.
              - …
            - `network_function_chain_reference` NetworkFunctionChainReference — The reference to a network_function_chain
              - …
            - `expiration_time` string — Timestamp of expiration time.
          - `target_group` TargetGroup — Target group
            - `filter` CategoryFilter — A category filter.
              - …
            - `default_internal_policy` string — Default policy for communication within target group.
            - `peer_specification_type` string — Way to identify the object for which rule is applied.
          - `inbound_allow_list` NetworkRule[]
            - `protocol` string — Select a protocol to allow. Multiple protocols can be allowed by repeating network_rule object. If a protocol is not configured in the network_rule object then it is allowed.
            - `ip_subnet` IpSubnet — IP subnet provided as an address and prefix length.
              - …
            - `tcp_port_range_list` PortRange[] — List of TCP ports that are allowed by this rule.
              - …
            - `udp_port_range_list` PortRange[] — List of UDP ports that are allowed by this rule.
              - …
            - `peer_specification_type` string — The set of categories that matching VMs need to have.
            - `filter` CategoryFilter — A category filter.
              - …
            - `icmp_type_code_list` object[] — List of ICMP types and codes allowed by this rule.
              - …
            - `network_function_chain_reference` NetworkFunctionChainReference — The reference to a network_function_chain
              - …
            - `expiration_time` string — Timestamp of expiration time.
        - `isolation_rule` object — These rules are used for environmental isolation.
          - `action` string — Type of action.
          - `first_entity_filter` CategoryFilter — A category filter.
            - `type` string — The type of the filter being used.
            - `kind_list` string[] — List of kinds associated with this filter.
            - `params` object, required — A list of category key and list of values.
          - `second_entity_filter` CategoryFilter — A category filter.
            - `type` string — The type of the filter being used.
            - `kind_list` string[] — List of kinds associated with this filter.
            - `params` object, required — A list of category key and list of values.
      - `description` string
    - `spec` NetworkSecurityRule — Network security rule
      - `name` string, required
      - `resources` NetworkSecurityRuleResources, required — Network security rule resources
        - `app_rule` object — These rules govern what flows are allowed. Target group is a required attribute. Empty inbound_allow_list will not anything into target group. Empty outbound_allow_list will allow everything from target group.
          - `action` string — Type of deployment of the rule.
          - `outbound_allow_list` NetworkRule[]
            - `protocol` string — Select a protocol to allow. Multiple protocols can be allowed by repeating network_rule object. If a protocol is not configured in the network_rule object then it is allowed.
            - `ip_subnet` IpSubnet — IP subnet provided as an address and prefix length.
              - …
            - `tcp_port_range_list` PortRange[] — List of TCP ports that are allowed by this rule.
              - …
            - `udp_port_range_list` PortRange[] — List of UDP ports that are allowed by this rule.
              - …
            - `peer_specification_type` string — The set of categories that matching VMs need to have.
            - `filter` CategoryFilter — A category filter.
              - …
            - `icmp_type_code_list` object[] — List of ICMP types and codes allowed by this rule.
              - …
            - `network_function_chain_reference` NetworkFunctionChainReference — The reference to a network_function_chain
              - …
            - `expiration_time` string — Timestamp of expiration time.
          - `target_group` TargetGroup — Target group
            - `filter` CategoryFilter — A category filter.
              - …
            - `default_internal_policy` string — Default policy for communication within target group.
            - `peer_specification_type` string — Way to identify the object for which rule is applied.
          - `inbound_allow_list` NetworkRule[]
            - `protocol` string — Select a protocol to allow. Multiple protocols can be allowed by repeating network_rule object. If a protocol is not configured in the network_rule object then it is allowed.
            - `ip_subnet` IpSubnet — IP subnet provided as an address and prefix length.
              - …
            - `tcp_port_range_list` PortRange[] — List of TCP ports that are allowed by this rule.
              - …
            - `udp_port_range_list` PortRange[] — List of UDP ports that are allowed by this rule.
              - …
            - `peer_specification_type` string — The set of categories that matching VMs need to have.
            - `filter` CategoryFilter — A category filter.
              - …
            - `icmp_type_code_list` object[] — List of ICMP types and codes allowed by this rule.
              - …
            - `network_function_chain_reference` NetworkFunctionChainReference — The reference to a network_function_chain
              - …
            - `expiration_time` string — Timestamp of expiration time.
        - `quarantine_rule` object — These rules are used for quarantining suspected VMs. Target group is a required attribute. Empty inbound_allow_list will not allow anything into target group. Empty outbound_allow_list will allow everything from target group.
          - `action` string — Type of action.
          - `outbound_allow_list` NetworkRule[]
            - `protocol` string — Select a protocol to allow. Multiple protocols can be allowed by repeating network_rule object. If a protocol is not configured in the network_rule object then it is allowed.
            - `ip_subnet` IpSubnet — IP subnet provided as an address and prefix length.
              - …
            - `tcp_port_range_list` PortRange[] — List of TCP ports that are allowed by this rule.
              - …
            - `udp_port_range_list` PortRange[] — List of UDP ports that are allowed by this rule.
              - …
            - `peer_specification_type` string — The set of categories that matching VMs need to have.
            - `filter` CategoryFilter — A category filter.
              - …
            - `icmp_type_code_list` object[] — List of ICMP types and codes allowed by this rule.
              - …
            - `network_function_chain_reference` NetworkFunctionChainReference — The reference to a network_function_chain
              - …
            - `expiration_time` string — Timestamp of expiration time.
          - `target_group` TargetGroup — Target group
            - `filter` CategoryFilter — A category filter.
              - …
            - `default_internal_policy` string — Default policy for communication within target group.
            - `peer_specification_type` string — Way to identify the object for which rule is applied.
          - `inbound_allow_list` NetworkRule[]
            - `protocol` string — Select a protocol to allow. Multiple protocols can be allowed by repeating network_rule object. If a protocol is not configured in the network_rule object then it is allowed.
            - `ip_subnet` IpSubnet — IP subnet provided as an address and prefix length.
              - …
            - `tcp_port_range_list` PortRange[] — List of TCP ports that are allowed by this rule.
              - …
            - `udp_port_range_list` PortRange[] — List of UDP ports that are allowed by this rule.
              - …
            - `peer_specification_type` string — The set of categories that matching VMs need to have.
            - `filter` CategoryFilter — A category filter.
              - …
            - `icmp_type_code_list` object[] — List of ICMP types and codes allowed by this rule.
              - …
            - `network_function_chain_reference` NetworkFunctionChainReference — The reference to a network_function_chain
              - …
            - `expiration_time` string — Timestamp of expiration time.
        - `isolation_rule` object — These rules are used for environmental isolation.
          - `action` string — Type of action.
          - `first_entity_filter` CategoryFilter — A category filter.
            - `type` string — The type of the filter being used.
            - `kind_list` string[] — List of kinds associated with this filter.
            - `params` object, required — A list of category key and list of values.
          - `second_entity_filter` CategoryFilter — A category filter.
            - `type` string — The type of the filter being used.
            - `kind_list` string[] — List of kinds associated with this filter.
            - `params` object, required — A list of category key and list of values.
      - `description` string
    - `api_version` string
    - `metadata` NetworkSecurityRuleMetadata, required — The network_security_rule kind metadata
      - `last_update_time` string, date-time — UTC date and time in RFC-3339 format when network_security_rule was last updated
      - `kind` string, required — The kind name
      - `uuid` string, UUID — network_security_rule uuid
      - `spec_version` integer — Version number of the latest spec.
      - `creation_time` string, date-time — UTC date and time in RFC-3339 format when network_security_rule was created
      - `spec_hash` string — Hash of the spec. This will be returned from server.
      - `should_force_translate` boolean — Applied on Prism Central only. Indicate whether force to translate the spec of the fanout request to fit the target cluster API schema.
      - `owner_reference` UserReference — The reference to a user
        - `kind` string, required — The kind name
        - `name` string
        - `uuid` string, UUID, required
      - `categories` object — Categories for the network_security_rule
      - `name` string — network_security_rule name
  - `api_version` string, required
  - `metadata` NetworkSecurityRuleListMetadataOutput, required — All api calls that return a list will have this metadata block
    - `filter` string — The filter used for the results
    - `kind` string — The kind name
    - `sort_order` string — The sort order in which results are returned
    - `offset` integer — Offset from the start of the entity list
    - `total_matches` integer — Total matches found
    - `length` integer — The number of records retrieved relative to the offset
    - `sort_attribute` string — The attribute to perform sort on

## Other responses

- `default` — Internal Error

---

[API](https://skmtc.net/nutanix/apis/nutanix-intentful-api.md) · [All operations](https://skmtc.net/nutanix/apis/nutanix-intentful-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nutanix/nutanix-intentful-api/revisions/40395083ab31/schema)
