Create Flow Network Security Policy

July 5, 2021

by Chris Rasmussen

Intended Audience Level: Beginner/Intro

Code Sample Type: Snippet

Nutanix Technologies: Flow

Minimum Product Version: N/A

Script/Code Language: JSON Payload

REST API Sample? Yes

REST API Version: v3

JSON payload to create a Nutanix Flow Network Security Rule a.k.a Security Policy. To use this code sample, please make sure all variable placeholders are replaced with values appropriate for your environment.

Code Sample Details

Note this section may be empty, if additional code sample details are not available.

JSON payload to create a Nutanix Flow Network Security Rule a.k.a Security Policy. To use this code sample, please make sure all variable placeholders are replaced with values appropriate for your environment.

{
    "spec": {
        "name": "{{network_security_rule_name}}",
        "description": "{{network_security_rule_description}}",
        "resources": {
            "is_policy_hitlog_enabled": {{true/false}},
            "isolation_rule": {
                "action": "{{MONITOR_or_APPLY}}",
                "first_entity_filter": {
                    "params": {
                        "{{category_name}}": [
                            "{{category_value}}"
                        ]
                    },
                    "kind_list": [
                        "{{entity_type_eg_vm}}"
                    ],
                    "type": "{{CATEGORIES_MATCH_ALL or CATEGORIES_MATCH_ANY}}"
                },
                "second_entity_filter": {
                    "params": {
                        "{{category_name}}": [
                            "{{category_value}}"
                        ]
                    },
                    "kind_list": [
                        "{[entity_type_eg_vm}}"
                    ],
                    "type": "{{CATEGORIES_MATCH_ALL or CATEGORIES_MATCH_ANY}}"
                }
            }
        }
    },
    "metadata": {
        "kind": "network_security_rule"
    }
}