swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.
  title: NetworkManagementClient
  version: 2018-02-01
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/network/resource-manager/Microsoft.Network/stable/2018-02-01/networkSecurityGroup.json
      version: "2.0"
  x-preferred: false
  x-providerName: azure.com
  x-serviceName: network-networkSecurityGroup
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
  - text/json
produces:
  - application/json
  - text/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters:
  ApiVersionParameter:
    description: Client API version.
    in: query
    name: api-version
    required: true
    type: string
  SubscriptionIdParameter:
    description: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
    in: path
    name: subscriptionId
    required: true
    type: string
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups":
    get:
      description: Gets all network security groups in a subscription.
      operationId: NetworkSecurityGroups_ListAll
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Request successful. The operation returns a list of NetworkSecurityGroup resources.
          schema:
            $ref: "#/definitions/NetworkSecurityGroupListResult"
      tags:
        - NetworkSecurityGroups
      x-ms-examples:
        List all network security groups:
          parameters:
            api-version: 2018-02-01
            subscriptionId: subid
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1
                    location: westus
                    name: nsg1
                    properties:
                      defaultSecurityRules:
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound
                          name: AllowVnetInBound
                          properties:
                            access: Allow
                            description: Allow inbound traffic from all VMs in VNET
                            destinationAddressPrefix: VirtualNetwork
                            destinationPortRange: "*"
                            direction: Inbound
                            priority: 65000
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: VirtualNetwork
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound
                          name: AllowAzureLoadBalancerInBound
                          properties:
                            access: Allow
                            description: Allow inbound traffic from azure load balancer
                            destinationAddressPrefix: "*"
                            destinationPortRange: "*"
                            direction: Inbound
                            priority: 65001
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: AzureLoadBalancer
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllInBound
                          name: DenyAllInBound
                          properties:
                            access: Deny
                            description: Deny all inbound traffic
                            destinationAddressPrefix: "*"
                            destinationPortRange: "*"
                            direction: Inbound
                            priority: 65500
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: "*"
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetOutBound
                          name: AllowVnetOutBound
                          properties:
                            access: Allow
                            description: Allow outbound traffic from all VMs to all VMs in VNET
                            destinationAddressPrefix: VirtualNetwork
                            destinationPortRange: "*"
                            direction: Outbound
                            priority: 65000
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: VirtualNetwork
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowInternetOutBound
                          name: AllowInternetOutBound
                          properties:
                            access: Allow
                            description: Allow outbound traffic from all VMs to Internet
                            destinationAddressPrefix: Internet
                            destinationPortRange: "*"
                            direction: Outbound
                            priority: 65001
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: "*"
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllOutBound
                          name: DenyAllOutBound
                          properties:
                            access: Deny
                            description: Deny all outbound traffic
                            destinationAddressPrefix: "*"
                            destinationPortRange: "*"
                            direction: Outbound
                            priority: 65500
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: "*"
                            sourcePortRange: "*"
                      provisioningState: Succeeded
                      securityRules: []
                    type: Microsoft.Network/networkSecurityGroups
                  - id: /subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3
                    location: westus
                    name: nsg3
                    properties:
                      defaultSecurityRules:
                        - id: /subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetInBound
                          name: AllowVnetInBound
                          properties:
                            access: Allow
                            description: Allow inbound traffic from all VMs in VNET
                            destinationAddressPrefix: VirtualNetwork
                            destinationPortRange: "*"
                            direction: Inbound
                            priority: 65000
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: VirtualNetwork
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowAzureLoadBalancerInBound
                          name: AllowAzureLoadBalancerInBound
                          properties:
                            access: Allow
                            description: Allow inbound traffic from azure load balancer
                            destinationAddressPrefix: "*"
                            destinationPortRange: "*"
                            direction: Inbound
                            priority: 65001
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: AzureLoadBalancer
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllInBound
                          name: DenyAllInBound
                          properties:
                            access: Deny
                            description: Deny all inbound traffic
                            destinationAddressPrefix: "*"
                            destinationPortRange: "*"
                            direction: Inbound
                            priority: 65500
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: "*"
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetOutBound
                          name: AllowVnetOutBound
                          properties:
                            access: Allow
                            description: Allow outbound traffic from all VMs to all VMs in VNET
                            destinationAddressPrefix: VirtualNetwork
                            destinationPortRange: "*"
                            direction: Outbound
                            priority: 65000
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: VirtualNetwork
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowInternetOutBound
                          name: AllowInternetOutBound
                          properties:
                            access: Allow
                            description: Allow outbound traffic from all VMs to Internet
                            destinationAddressPrefix: Internet
                            destinationPortRange: "*"
                            direction: Outbound
                            priority: 65001
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: "*"
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllOutBound
                          name: DenyAllOutBound
                          properties:
                            access: Deny
                            description: Deny all outbound traffic
                            destinationAddressPrefix: "*"
                            destinationPortRange: "*"
                            direction: Outbound
                            priority: 65500
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: "*"
                            sourcePortRange: "*"
                      provisioningState: Succeeded
                      securityRules: []
                    type: Microsoft.Network/networkSecurityGroups
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups":
    get:
      description: Gets all network security groups in a resource group.
      operationId: NetworkSecurityGroups_List
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Request successful. The operation returns a list of NetworkSecurityGroup resources.
          schema:
            $ref: "#/definitions/NetworkSecurityGroupListResult"
      tags:
        - NetworkSecurityGroups
      x-ms-examples:
        List network security groups in resource group:
          parameters:
            api-version: 2018-02-01
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1
                    location: westus
                    name: nsg1
                    properties:
                      defaultSecurityRules:
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound
                          name: AllowVnetInBound
                          properties:
                            access: Allow
                            description: Allow inbound traffic from all VMs in VNET
                            destinationAddressPrefix: VirtualNetwork
                            destinationPortRange: "*"
                            direction: Inbound
                            priority: 65000
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: VirtualNetwork
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound
                          name: AllowAzureLoadBalancerInBound
                          properties:
                            access: Allow
                            description: Allow inbound traffic from azure load balancer
                            destinationAddressPrefix: "*"
                            destinationPortRange: "*"
                            direction: Inbound
                            priority: 65001
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: AzureLoadBalancer
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllInBound
                          name: DenyAllInBound
                          properties:
                            access: Deny
                            description: Deny all inbound traffic
                            destinationAddressPrefix: "*"
                            destinationPortRange: "*"
                            direction: Inbound
                            priority: 65500
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: "*"
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetOutBound
                          name: AllowVnetOutBound
                          properties:
                            access: Allow
                            description: Allow outbound traffic from all VMs to all VMs in VNET
                            destinationAddressPrefix: VirtualNetwork
                            destinationPortRange: "*"
                            direction: Outbound
                            priority: 65000
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: VirtualNetwork
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowInternetOutBound
                          name: AllowInternetOutBound
                          properties:
                            access: Allow
                            description: Allow outbound traffic from all VMs to Internet
                            destinationAddressPrefix: Internet
                            destinationPortRange: "*"
                            direction: Outbound
                            priority: 65001
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: "*"
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllOutBound
                          name: DenyAllOutBound
                          properties:
                            access: Deny
                            description: Deny all outbound traffic
                            destinationAddressPrefix: "*"
                            destinationPortRange: "*"
                            direction: Outbound
                            priority: 65500
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: "*"
                            sourcePortRange: "*"
                      provisioningState: Succeeded
                      securityRules: []
                    type: Microsoft.Network/networkSecurityGroups
                  - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3
                    location: westus
                    name: nsg3
                    properties:
                      defaultSecurityRules:
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetInBound
                          name: AllowVnetInBound
                          properties:
                            access: Allow
                            description: Allow inbound traffic from all VMs in VNET
                            destinationAddressPrefix: VirtualNetwork
                            destinationPortRange: "*"
                            direction: Inbound
                            priority: 65000
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: VirtualNetwork
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowAzureLoadBalancerInBound
                          name: AllowAzureLoadBalancerInBound
                          properties:
                            access: Allow
                            description: Allow inbound traffic from azure load balancer
                            destinationAddressPrefix: "*"
                            destinationPortRange: "*"
                            direction: Inbound
                            priority: 65001
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: AzureLoadBalancer
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllInBound
                          name: DenyAllInBound
                          properties:
                            access: Deny
                            description: Deny all inbound traffic
                            destinationAddressPrefix: "*"
                            destinationPortRange: "*"
                            direction: Inbound
                            priority: 65500
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: "*"
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowVnetOutBound
                          name: AllowVnetOutBound
                          properties:
                            access: Allow
                            description: Allow outbound traffic from all VMs to all VMs in VNET
                            destinationAddressPrefix: VirtualNetwork
                            destinationPortRange: "*"
                            direction: Outbound
                            priority: 65000
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: VirtualNetwork
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/AllowInternetOutBound
                          name: AllowInternetOutBound
                          properties:
                            access: Allow
                            description: Allow outbound traffic from all VMs to Internet
                            destinationAddressPrefix: Internet
                            destinationPortRange: "*"
                            direction: Outbound
                            priority: 65001
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: "*"
                            sourcePortRange: "*"
                        - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg3/defaultSecurityRules/DenyAllOutBound
                          name: DenyAllOutBound
                          properties:
                            access: Deny
                            description: Deny all outbound traffic
                            destinationAddressPrefix: "*"
                            destinationPortRange: "*"
                            direction: Outbound
                            priority: 65500
                            protocol: "*"
                            provisioningState: Succeeded
                            sourceAddressPrefix: "*"
                            sourcePortRange: "*"
                      provisioningState: Succeeded
                      securityRules: []
                    type: Microsoft.Network/networkSecurityGroups
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}":
    delete:
      description: Deletes the specified network security group.
      operationId: NetworkSecurityGroups_Delete
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
        - description: The name of the network security group.
          in: path
          name: networkSecurityGroupName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Delete successful.
        "202":
          description: Accepted and the operation will complete asynchronously.
        "204":
          description: Request successful. Resource does not exist.
      tags:
        - NetworkSecurityGroups
      x-ms-examples:
        Delete network security group:
          parameters:
            api-version: 2018-02-01
            networkSecurityGroupName: testnsg
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200": {}
            "202": {}
            "204": {}
      x-ms-long-running-operation: true
    get:
      description: Gets the specified network security group.
      operationId: NetworkSecurityGroups_Get
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
        - description: The name of the network security group.
          in: path
          name: networkSecurityGroupName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - description: Expands referenced resources.
          in: query
          name: $expand
          required: false
          type: string
      responses:
        "200":
          description: Request successful. The operation returns the resulting NetworkSecurityGroup resource.
          schema:
            $ref: "#/definitions/NetworkSecurityGroup"
      tags:
        - NetworkSecurityGroups
      x-ms-examples:
        Get network security group:
          parameters:
            api-version: 2018-02-01
            networkSecurityGroupName: testnsg
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg
                location: westus
                name: testnsg
                properties:
                  defaultSecurityRules:
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound
                      name: AllowVnetInBound
                      properties:
                        access: Allow
                        description: Allow inbound traffic from all VMs in VNET
                        destinationAddressPrefix: VirtualNetwork
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65000
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: VirtualNetwork
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound
                      name: AllowAzureLoadBalancerInBound
                      properties:
                        access: Allow
                        description: Allow inbound traffic from azure load balancer
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65001
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: AzureLoadBalancer
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound
                      name: DenyAllInBound
                      properties:
                        access: Deny
                        description: Deny all inbound traffic
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65500
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound
                      name: AllowVnetOutBound
                      properties:
                        access: Allow
                        description: Allow outbound traffic from all VMs to all VMs in VNET
                        destinationAddressPrefix: VirtualNetwork
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65000
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: VirtualNetwork
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound
                      name: AllowInternetOutBound
                      properties:
                        access: Allow
                        description: Allow outbound traffic from all VMs to Internet
                        destinationAddressPrefix: Internet
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65001
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound
                      name: DenyAllOutBound
                      properties:
                        access: Deny
                        description: Deny all outbound traffic
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65500
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                  provisioningState: Succeeded
                  securityRules:
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1
                      name: rule1
                      properties:
                        access: Allow
                        destinationAddressPrefix: "*"
                        destinationPortRange: "80"
                        direction: Inbound
                        priority: 130
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                type: Microsoft.Network/networkSecurityGroups
    patch:
      description: Updates a network security group tags.
      operationId: NetworkSecurityGroups_UpdateTags
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
        - description: The name of the network security group.
          in: path
          name: networkSecurityGroupName
          required: true
          type: string
        - description: Parameters supplied to update network security group tags.
          in: body
          name: parameters
          required: true
          schema:
            description: Tags object for patch operations.
            properties:
              tags:
                additionalProperties:
                  type: string
                description: Resource tags.
                type: object
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Update successful. The operation returns the resulting NetworkSecurityGroup resource.
          schema:
            $ref: "#/definitions/NetworkSecurityGroup"
      tags:
        - NetworkSecurityGroups
      x-ms-examples:
        Update network security group tags:
          parameters:
            api-version: 2018-02-01
            networkSecurityGroupName: testnsg
            parameters:
              tags:
                tag1: value1
                tag2: value2
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg
                location: westus
                name: testnsg
                properties:
                  defaultSecurityRules:
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound
                      name: AllowVnetInBound
                      properties:
                        access: Allow
                        description: Allow inbound traffic from all VMs in VNET
                        destinationAddressPrefix: VirtualNetwork
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65000
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: VirtualNetwork
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound
                      name: AllowAzureLoadBalancerInBound
                      properties:
                        access: Allow
                        description: Allow inbound traffic from azure load balancer
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65001
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: AzureLoadBalancer
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound
                      name: DenyAllInBound
                      properties:
                        access: Deny
                        description: Deny all inbound traffic
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65500
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound
                      name: AllowVnetOutBound
                      properties:
                        access: Allow
                        description: Allow outbound traffic from all VMs to all VMs in VNET
                        destinationAddressPrefix: VirtualNetwork
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65000
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: VirtualNetwork
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound
                      name: AllowInternetOutBound
                      properties:
                        access: Allow
                        description: Allow outbound traffic from all VMs to Internet
                        destinationAddressPrefix: Internet
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65001
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound
                      name: DenyAllOutBound
                      properties:
                        access: Deny
                        description: Deny all outbound traffic
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65500
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                  provisioningState: Succeeded
                  securityRules: []
                tags:
                  tag1: value1
                  tag2: value2
                type: Microsoft.Network/networkSecurityGroups
      x-ms-long-running-operation: true
    put:
      description: Creates or updates a network security group in the specified resource group.
      operationId: NetworkSecurityGroups_CreateOrUpdate
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
        - description: The name of the network security group.
          in: path
          name: networkSecurityGroupName
          required: true
          type: string
        - description: Parameters supplied to the create or update network security group operation.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/NetworkSecurityGroup"
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Update successful. The operation returns the resulting NetworkSecurityGroup resource.
          schema:
            $ref: "#/definitions/NetworkSecurityGroup"
        "201":
          description: Create successful. The operation returns the resulting NetworkSecurityGroup resource.
          schema:
            $ref: "#/definitions/NetworkSecurityGroup"
      tags:
        - NetworkSecurityGroups
      x-ms-examples:
        Create network security group:
          parameters:
            api-version: 2018-02-01
            networkSecurityGroupName: testnsg
            parameters:
              location: eastus
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg
                location: eastus
                name: testnsg
                properties:
                  defaultSecurityRules:
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound
                      name: AllowVnetInBound
                      properties:
                        access: Allow
                        description: Allow inbound traffic from all VMs in VNET
                        destinationAddressPrefix: VirtualNetwork
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65000
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: VirtualNetwork
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound
                      name: AllowAzureLoadBalancerInBound
                      properties:
                        access: Allow
                        description: Allow inbound traffic from azure load balancer
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65001
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: AzureLoadBalancer
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound
                      name: DenyAllInBound
                      properties:
                        access: Deny
                        description: Deny all inbound traffic
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65500
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound
                      name: AllowVnetOutBound
                      properties:
                        access: Allow
                        description: Allow outbound traffic from all VMs to all VMs in VNET
                        destinationAddressPrefix: VirtualNetwork
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65000
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: VirtualNetwork
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound
                      name: AllowInternetOutBound
                      properties:
                        access: Allow
                        description: Allow outbound traffic from all VMs to Internet
                        destinationAddressPrefix: Internet
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65001
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound
                      name: DenyAllOutBound
                      properties:
                        access: Deny
                        description: Deny all outbound traffic
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65500
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                  provisioningState: Succeeded
                  securityRules: []
                type: Microsoft.Network/networkSecurityGroups
            "201":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg
                location: eastus
                name: testnsg
                properties:
                  defaultSecurityRules:
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound
                      name: AllowVnetInBound
                      properties:
                        access: Allow
                        description: Allow inbound traffic from all VMs in VNET
                        destinationAddressPrefix: VirtualNetwork
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65000
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: VirtualNetwork
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound
                      name: AllowAzureLoadBalancerInBound
                      properties:
                        access: Allow
                        description: Allow inbound traffic from azure load balancer
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65001
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: AzureLoadBalancer
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound
                      name: DenyAllInBound
                      properties:
                        access: Deny
                        description: Deny all inbound traffic
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65500
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound
                      name: AllowVnetOutBound
                      properties:
                        access: Allow
                        description: Allow outbound traffic from all VMs to all VMs in VNET
                        destinationAddressPrefix: VirtualNetwork
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65000
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: VirtualNetwork
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound
                      name: AllowInternetOutBound
                      properties:
                        access: Allow
                        description: Allow outbound traffic from all VMs to Internet
                        destinationAddressPrefix: Internet
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65001
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound
                      name: DenyAllOutBound
                      properties:
                        access: Deny
                        description: Deny all outbound traffic
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65500
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                  provisioningState: Succeeded
                  securityRules: []
                type: Microsoft.Network/networkSecurityGroups
        Create network security group with rule:
          parameters:
            api-version: 2018-02-01
            networkSecurityGroupName: testnsg
            parameters:
              location: eastus
              properties:
                securityRules:
                  - name: rule1
                    properties:
                      access: Allow
                      destinationAddressPrefix: "*"
                      destinationPortRange: "80"
                      direction: Inbound
                      priority: 130
                      protocol: "*"
                      sourceAddressPrefix: "*"
                      sourcePortRange: "*"
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg
                location: eastus
                name: testnsg
                properties:
                  defaultSecurityRules:
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound
                      name: AllowVnetInBound
                      properties:
                        access: Allow
                        description: Allow inbound traffic from all VMs in VNET
                        destinationAddressPrefix: VirtualNetwork
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65000
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: VirtualNetwork
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound
                      name: AllowAzureLoadBalancerInBound
                      properties:
                        access: Allow
                        description: Allow inbound traffic from azure load balancer
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65001
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: AzureLoadBalancer
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound
                      name: DenyAllInBound
                      properties:
                        access: Deny
                        description: Deny all inbound traffic
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65500
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound
                      name: AllowVnetOutBound
                      properties:
                        access: Allow
                        description: Allow outbound traffic from all VMs to all VMs in VNET
                        destinationAddressPrefix: VirtualNetwork
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65000
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: VirtualNetwork
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound
                      name: AllowInternetOutBound
                      properties:
                        access: Allow
                        description: Allow outbound traffic from all VMs to Internet
                        destinationAddressPrefix: Internet
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65001
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound
                      name: DenyAllOutBound
                      properties:
                        access: Deny
                        description: Deny all outbound traffic
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65500
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                  provisioningState: Succeeded
                  securityRules:
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1
                      name: rule1
                      properties:
                        access: Allow
                        destinationAddressPrefix: "*"
                        destinationPortRange: "80"
                        direction: Inbound
                        priority: 130
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                type: Microsoft.Network/networkSecurityGroups
            "201":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg
                location: eastus
                name: testnsg
                properties:
                  defaultSecurityRules:
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetInBound
                      name: AllowVnetInBound
                      properties:
                        access: Allow
                        description: Allow inbound traffic from all VMs in VNET
                        destinationAddressPrefix: VirtualNetwork
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65000
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: VirtualNetwork
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowAzureLoadBalancerInBound
                      name: AllowAzureLoadBalancerInBound
                      properties:
                        access: Allow
                        description: Allow inbound traffic from azure load balancer
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65001
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: AzureLoadBalancer
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllInBound
                      name: DenyAllInBound
                      properties:
                        access: Deny
                        description: Deny all inbound traffic
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Inbound
                        priority: 65500
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowVnetOutBound
                      name: AllowVnetOutBound
                      properties:
                        access: Allow
                        description: Allow outbound traffic from all VMs to all VMs in VNET
                        destinationAddressPrefix: VirtualNetwork
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65000
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: VirtualNetwork
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/AllowInternetOutBound
                      name: AllowInternetOutBound
                      properties:
                        access: Allow
                        description: Allow outbound traffic from all VMs to Internet
                        destinationAddressPrefix: Internet
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65001
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/defaultSecurityRules/DenyAllOutBound
                      name: DenyAllOutBound
                      properties:
                        access: Deny
                        description: Deny all outbound traffic
                        destinationAddressPrefix: "*"
                        destinationPortRange: "*"
                        direction: Outbound
                        priority: 65500
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                  provisioningState: Succeeded
                  securityRules:
                    - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1
                      name: rule1
                      properties:
                        access: Allow
                        destinationAddressPrefix: "*"
                        destinationPortRange: "80"
                        direction: Inbound
                        priority: 130
                        protocol: "*"
                        provisioningState: Succeeded
                        sourceAddressPrefix: "*"
                        sourcePortRange: "*"
                type: Microsoft.Network/networkSecurityGroups
      x-ms-long-running-operation: true
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules":
    get:
      description: Gets all default security rules in a network security group.
      operationId: DefaultSecurityRules_List
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
        - description: The name of the network security group.
          in: path
          name: networkSecurityGroupName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Request successful. The operation returns a list of SecurityRule resources.
          schema:
            $ref: "#/definitions/SecurityRuleListResult"
      tags:
        - SecurityRules
      x-ms-examples:
        DefaultSecurityRuleList:
          parameters:
            api-version: 2018-02-01
            networkSecurityGroupName: nsg1
            resourceGroupName: testrg
            subscriptionId: subid
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound
                    name: AllowVnetInBound
                    properties:
                      access: Allow
                      description: Allow inbound traffic from all VMs in VNET
                      destinationAddressPrefix: VirtualNetwork
                      destinationAddressPrefixes: []
                      destinationPortRange: "*"
                      destinationPortRanges: []
                      direction: Inbound
                      priority: 65000
                      protocol: "*"
                      provisioningState: Succeeded
                      sourceAddressPrefix: VirtualNetwork
                      sourceAddressPrefixes: []
                      sourcePortRange: "*"
                      sourcePortRanges: []
                  - id: /subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowAzureLoadBalancerInBound
                    name: AllowAzureLoadBalancerInBound
                    properties:
                      access: Allow
                      description: Allow inbound traffic from azure load balancer
                      destinationAddressPrefix: "*"
                      destinationAddressPrefixes: []
                      destinationPortRange: "*"
                      destinationPortRanges: []
                      direction: Inbound
                      priority: 65001
                      protocol: "*"
                      provisioningState: Succeeded
                      sourceAddressPrefix: AzureLoadBalancer
                      sourceAddressPrefixes: []
                      sourcePortRange: "*"
                      sourcePortRanges: []
                  - id: /subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllInBound
                    name: DenyAllInBound
                    properties:
                      access: Deny
                      description: Deny all inbound traffic
                      destinationAddressPrefix: "*"
                      destinationAddressPrefixes: []
                      destinationPortRange: "*"
                      destinationPortRanges: []
                      direction: Inbound
                      priority: 65500
                      protocol: "*"
                      provisioningState: Succeeded
                      sourceAddressPrefix: "*"
                      sourceAddressPrefixes: []
                      sourcePortRange: "*"
                      sourcePortRanges: []
                  - id: /subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetOutBound
                    name: AllowVnetOutBound
                    properties:
                      access: Allow
                      description: Allow outbound traffic from all VMs to all VMs in VNET
                      destinationAddressPrefix: VirtualNetwork
                      destinationAddressPrefixes: []
                      destinationPortRange: "*"
                      destinationPortRanges: []
                      direction: Outbound
                      priority: 65000
                      protocol: "*"
                      provisioningState: Succeeded
                      sourceAddressPrefix: VirtualNetwork
                      sourceAddressPrefixes: []
                      sourcePortRange: "*"
                      sourcePortRanges: []
                  - id: /subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowInternetOutBound
                    name: AllowInternetOutBound
                    properties:
                      access: Allow
                      description: Allow outbound traffic from all VMs to Internet
                      destinationAddressPrefix: Internet
                      destinationAddressPrefixes: []
                      destinationPortRange: "*"
                      destinationPortRanges: []
                      direction: Outbound
                      priority: 65001
                      protocol: "*"
                      provisioningState: Succeeded
                      sourceAddressPrefix: "*"
                      sourceAddressPrefixes: []
                      sourcePortRange: "*"
                      sourcePortRanges: []
                  - id: /subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/DenyAllOutBound
                    name: DenyAllOutBound
                    properties:
                      access: Deny
                      description: Deny all outbound traffic
                      destinationAddressPrefix: "*"
                      destinationAddressPrefixes: []
                      destinationPortRange: "*"
                      destinationPortRanges: []
                      direction: Outbound
                      priority: 65500
                      protocol: "*"
                      provisioningState: Succeeded
                      sourceAddressPrefix: "*"
                      sourceAddressPrefixes: []
                      sourcePortRange: "*"
                      sourcePortRanges: []
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}":
    get:
      description: Get the specified default network security rule.
      operationId: DefaultSecurityRules_Get
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
        - description: The name of the network security group.
          in: path
          name: networkSecurityGroupName
          required: true
          type: string
        - description: The name of the default security rule.
          in: path
          name: defaultSecurityRuleName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Request successful. The operation returns the resulting SecurityRule resource.
          schema:
            $ref: "#/definitions/SecurityRule"
      tags:
        - SecurityRules
      x-ms-examples:
        DefaultSecurityRuleGet:
          parameters:
            api-version: 2018-02-01
            defaultSecurityRuleName: AllowVnetInBound
            networkSecurityGroupName: nsg1
            resourceGroupName: testrg
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound
                name: AllowVnetInBound
                properties:
                  access: Allow
                  description: Allow inbound traffic from all VMs in VNET
                  destinationAddressPrefix: VirtualNetwork
                  destinationAddressPrefixes: []
                  destinationPortRange: "*"
                  destinationPortRanges: []
                  direction: Inbound
                  priority: 65000
                  protocol: "*"
                  provisioningState: Succeeded
                  sourceAddressPrefix: VirtualNetwork
                  sourceAddressPrefixes: []
                  sourcePortRange: "*"
                  sourcePortRanges: []
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules":
    get:
      description: Gets all security rules in a network security group.
      operationId: SecurityRules_List
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
        - description: The name of the network security group.
          in: path
          name: networkSecurityGroupName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Request successful. The operation returns a list of SecurityRule resources.
          schema:
            $ref: "#/definitions/SecurityRuleListResult"
      tags:
        - SecurityRules
      x-ms-examples:
        List network security rules in network security group:
          parameters:
            api-version: 2018-02-01
            networkSecurityGroupName: testnsg
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1
                    name: rule1
                    properties:
                      access: Allow
                      destinationAddressPrefix: "*"
                      destinationPortRange: "80"
                      direction: Inbound
                      priority: 130
                      protocol: "*"
                      provisioningState: Succeeded
                      sourceAddressPrefix: "*"
                      sourcePortRange: "*"
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}":
    delete:
      description: Deletes the specified network security rule.
      operationId: SecurityRules_Delete
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
        - description: The name of the network security group.
          in: path
          name: networkSecurityGroupName
          required: true
          type: string
        - description: The name of the security rule.
          in: path
          name: securityRuleName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Delete successful.
        "202":
          description: Accepted and the operation will complete asynchronously.
        "204":
          description: Request successful. Resource does not exist.
      tags:
        - SecurityRules
      x-ms-examples:
        Delete network security rule from network security group:
          parameters:
            api-version: 2018-02-01
            networkSecurityGroupName: testnsg
            resourceGroupName: rg1
            securityRuleName: rule1
            subscriptionId: subid
          responses:
            "200": {}
            "202": {}
            "204": {}
      x-ms-long-running-operation: true
    get:
      description: Get the specified network security rule.
      operationId: SecurityRules_Get
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
        - description: The name of the network security group.
          in: path
          name: networkSecurityGroupName
          required: true
          type: string
        - description: The name of the security rule.
          in: path
          name: securityRuleName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Request successful. The operation returns the resulting SecurityRule resource.
          schema:
            $ref: "#/definitions/SecurityRule"
      tags:
        - SecurityRules
      x-ms-examples:
        Get network security rule in network security group:
          parameters:
            api-version: 2018-02-01
            networkSecurityGroupName: testnsg
            resourceGroupName: rg1
            securityRuleName: rule1
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1
                name: rule1
                properties:
                  access: Allow
                  destinationAddressPrefix: "*"
                  destinationPortRange: "80"
                  direction: Inbound
                  priority: 130
                  protocol: "*"
                  provisioningState: Succeeded
                  sourceAddressPrefix: "*"
                  sourcePortRange: "*"
    put:
      description: Creates or updates a security rule in the specified network security group.
      operationId: SecurityRules_CreateOrUpdate
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
        - description: The name of the network security group.
          in: path
          name: networkSecurityGroupName
          required: true
          type: string
        - description: The name of the security rule.
          in: path
          name: securityRuleName
          required: true
          type: string
        - description: Parameters supplied to the create or update network security rule operation.
          in: body
          name: securityRuleParameters
          required: true
          schema:
            $ref: "#/definitions/SecurityRule"
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Update successful. The operation returns the resulting SecurityRule resource.
          schema:
            $ref: "#/definitions/SecurityRule"
        "201":
          description: Create successful. The operation returns the resulting SecurityRule resource.
          schema:
            $ref: "#/definitions/SecurityRule"
      tags:
        - SecurityRules
      x-ms-examples:
        Create security rule:
          parameters:
            api-version: 2018-02-01
            networkSecurityGroupName: testnsg
            resourceGroupName: rg1
            securityRuleName: rule1
            securityRuleParameters:
              properties:
                access: Deny
                destinationAddressPrefix: 11.0.0.0/8
                destinationPortRange: "8080"
                direction: Outbound
                priority: 100
                protocol: "*"
                sourceAddressPrefix: 10.0.0.0/8
                sourcePortRange: "*"
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1
                name: rule1
                properties:
                  access: Deny
                  destinationAddressPrefix: 11.0.0.0/8
                  destinationPortRange: "8080"
                  direction: Outbound
                  priority: 100
                  protocol: "*"
                  provisioningState: Succeeded
                  sourceAddressPrefix: 10.0.0.0/8
                  sourcePortRange: "*"
            "201":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/testnsg/securityRules/rule1
                name: rule1
                properties:
                  access: Deny
                  destinationAddressPrefix: 11.0.0.0/8
                  destinationPortRange: "8080"
                  direction: Outbound
                  priority: 100
                  protocol: "*"
                  provisioningState: Succeeded
                  sourceAddressPrefix: 10.0.0.0/8
                  sourcePortRange: "*"
      x-ms-long-running-operation: true
definitions:
  NetworkSecurityGroup:
    allOf:
      - description: Common resource representation.
        properties:
          id:
            description: Resource ID.
            type: string
          location:
            description: Resource location.
            type: string
          name:
            description: Resource name.
            readOnly: true
            type: string
          tags:
            additionalProperties:
              type: string
            description: Resource tags.
            type: object
          type:
            description: Resource type.
            readOnly: true
            type: string
        x-ms-azure-resource: true
    description: NetworkSecurityGroup resource.
    properties:
      etag:
        description: A unique read-only string that changes whenever the resource is updated.
        type: string
      properties:
        $ref: "#/definitions/NetworkSecurityGroupPropertiesFormat"
        description: Properties of the network security group
        x-ms-client-flatten: true
  NetworkSecurityGroupListResult:
    description: Response for ListNetworkSecurityGroups API service call.
    properties:
      nextLink:
        description: The URL to get the next set of results.
        type: string
      value:
        description: A list of NetworkSecurityGroup resources.
        items:
          $ref: "#/definitions/NetworkSecurityGroup"
        type: array
  NetworkSecurityGroupPropertiesFormat:
    description: Network Security Group resource.
    properties:
      defaultSecurityRules:
        description: The default security rules of network security group.
        items:
          allOf:
            - description: Reference to another subresource.
              properties:
                id:
                  description: Resource ID.
                  type: string
              x-ms-azure-resource: true
          description: Network security rule.
          properties:
            etag:
              description: A unique read-only string that changes whenever the resource is updated.
              type: string
            name:
              description: The name of the resource that is unique within a resource group. This name can be used to access the resource.
              type: string
            properties:
              description: Security rule resource.
              properties:
                access:
                  description: "The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'."
                  enum:
                    - Allow
                    - Deny
                  type: string
                  x-ms-enum:
                    modelAsString: true
                    name: SecurityRuleAccess
                description:
                  description: A description for this rule. Restricted to 140 chars.
                  type: string
                destinationAddressPrefix:
                  description: The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
                  type: string
                destinationAddressPrefixes:
                  description: The destination address prefixes. CIDR or destination IP ranges.
                  items:
                    type: string
                  type: array
                destinationApplicationSecurityGroups:
                  description: The application security group specified as destination.
                  items:
                    allOf:
                      - description: Common resource representation.
                        properties:
                          id:
                            description: Resource ID.
                            type: string
                          location:
                            description: Resource location.
                            type: string
                          name:
                            description: Resource name.
                            readOnly: true
                            type: string
                          tags:
                            additionalProperties:
                              type: string
                            description: Resource tags.
                            type: object
                          type:
                            description: Resource type.
                            readOnly: true
                            type: string
                        x-ms-azure-resource: true
                    description: An application security group in a resource group.
                    properties:
                      etag:
                        description: A unique read-only string that changes whenever the resource is updated.
                        readOnly: true
                        type: string
                      properties:
                        description: Application security group properties.
                        properties:
                          provisioningState:
                            description: "The provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'."
                            readOnly: true
                            type: string
                          resourceGuid:
                            description: The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
                            readOnly: true
                            type: string
                  type: array
                destinationPortRange:
                  description: The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
                  type: string
                destinationPortRanges:
                  description: The destination port ranges.
                  items:
                    description: The destination port.
                    type: string
                  type: array
                direction:
                  description: "The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'."
                  enum:
                    - Inbound
                    - Outbound
                  type: string
                  x-ms-enum:
                    modelAsString: true
                    name: SecurityRuleDirection
                priority:
                  description: The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
                  format: int32
                  type: integer
                protocol:
                  description: Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.
                  enum:
                    - Tcp
                    - Udp
                    - "*"
                  type: string
                  x-ms-enum:
                    modelAsString: true
                    name: SecurityRuleProtocol
                provisioningState:
                  description: "The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'."
                  type: string
                sourceAddressPrefix:
                  description: "The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. "
                  type: string
                sourceAddressPrefixes:
                  description: The CIDR or source IP ranges.
                  items:
                    type: string
                  type: array
                sourceApplicationSecurityGroups:
                  description: The application security group specified as source.
                  items:
                    allOf:
                      - description: Common resource representation.
                        properties:
                          id:
                            description: Resource ID.
                            type: string
                          location:
                            description: Resource location.
                            type: string
                          name:
                            description: Resource name.
                            readOnly: true
                            type: string
                          tags:
                            additionalProperties:
                              type: string
                            description: Resource tags.
                            type: object
                          type:
                            description: Resource type.
                            readOnly: true
                            type: string
                        x-ms-azure-resource: true
                    description: An application security group in a resource group.
                    properties:
                      etag:
                        description: A unique read-only string that changes whenever the resource is updated.
                        readOnly: true
                        type: string
                      properties:
                        description: Application security group properties.
                        properties:
                          provisioningState:
                            description: "The provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'."
                            readOnly: true
                            type: string
                          resourceGuid:
                            description: The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
                            readOnly: true
                            type: string
                  type: array
                sourcePortRange:
                  description: The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
                  type: string
                sourcePortRanges:
                  description: The source port ranges.
                  items:
                    description: The source port.
                    type: string
                  type: array
              required:
                - protocol
                - access
                - direction
        type: array
      networkInterfaces:
        description: A collection of references to network interfaces.
        items:
          $ref: ./networkInterface.json#/definitions/NetworkInterface
        readOnly: true
        type: array
      provisioningState:
        description: "The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'."
        type: string
      resourceGuid:
        description: The resource GUID property of the network security group resource.
        type: string
      securityRules:
        description: A collection of security rules of the network security group.
        items:
          allOf:
            - description: Reference to another subresource.
              properties:
                id:
                  description: Resource ID.
                  type: string
              x-ms-azure-resource: true
          description: Network security rule.
          properties:
            etag:
              description: A unique read-only string that changes whenever the resource is updated.
              type: string
            name:
              description: The name of the resource that is unique within a resource group. This name can be used to access the resource.
              type: string
            properties:
              description: Security rule resource.
              properties:
                access:
                  description: "The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'."
                  enum:
                    - Allow
                    - Deny
                  type: string
                  x-ms-enum:
                    modelAsString: true
                    name: SecurityRuleAccess
                description:
                  description: A description for this rule. Restricted to 140 chars.
                  type: string
                destinationAddressPrefix:
                  description: The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
                  type: string
                destinationAddressPrefixes:
                  description: The destination address prefixes. CIDR or destination IP ranges.
                  items:
                    type: string
                  type: array
                destinationApplicationSecurityGroups:
                  description: The application security group specified as destination.
                  items:
                    allOf:
                      - description: Common resource representation.
                        properties:
                          id:
                            description: Resource ID.
                            type: string
                          location:
                            description: Resource location.
                            type: string
                          name:
                            description: Resource name.
                            readOnly: true
                            type: string
                          tags:
                            additionalProperties:
                              type: string
                            description: Resource tags.
                            type: object
                          type:
                            description: Resource type.
                            readOnly: true
                            type: string
                        x-ms-azure-resource: true
                    description: An application security group in a resource group.
                    properties:
                      etag:
                        description: A unique read-only string that changes whenever the resource is updated.
                        readOnly: true
                        type: string
                      properties:
                        description: Application security group properties.
                        properties:
                          provisioningState:
                            description: "The provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'."
                            readOnly: true
                            type: string
                          resourceGuid:
                            description: The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
                            readOnly: true
                            type: string
                  type: array
                destinationPortRange:
                  description: The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
                  type: string
                destinationPortRanges:
                  description: The destination port ranges.
                  items:
                    description: The destination port.
                    type: string
                  type: array
                direction:
                  description: "The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'."
                  enum:
                    - Inbound
                    - Outbound
                  type: string
                  x-ms-enum:
                    modelAsString: true
                    name: SecurityRuleDirection
                priority:
                  description: The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
                  format: int32
                  type: integer
                protocol:
                  description: Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.
                  enum:
                    - Tcp
                    - Udp
                    - "*"
                  type: string
                  x-ms-enum:
                    modelAsString: true
                    name: SecurityRuleProtocol
                provisioningState:
                  description: "The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'."
                  type: string
                sourceAddressPrefix:
                  description: "The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. "
                  type: string
                sourceAddressPrefixes:
                  description: The CIDR or source IP ranges.
                  items:
                    type: string
                  type: array
                sourceApplicationSecurityGroups:
                  description: The application security group specified as source.
                  items:
                    allOf:
                      - description: Common resource representation.
                        properties:
                          id:
                            description: Resource ID.
                            type: string
                          location:
                            description: Resource location.
                            type: string
                          name:
                            description: Resource name.
                            readOnly: true
                            type: string
                          tags:
                            additionalProperties:
                              type: string
                            description: Resource tags.
                            type: object
                          type:
                            description: Resource type.
                            readOnly: true
                            type: string
                        x-ms-azure-resource: true
                    description: An application security group in a resource group.
                    properties:
                      etag:
                        description: A unique read-only string that changes whenever the resource is updated.
                        readOnly: true
                        type: string
                      properties:
                        description: Application security group properties.
                        properties:
                          provisioningState:
                            description: "The provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'."
                            readOnly: true
                            type: string
                          resourceGuid:
                            description: The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
                            readOnly: true
                            type: string
                  type: array
                sourcePortRange:
                  description: The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
                  type: string
                sourcePortRanges:
                  description: The source port ranges.
                  items:
                    description: The source port.
                    type: string
                  type: array
              required:
                - protocol
                - access
                - direction
        type: array
      subnets:
        description: A collection of references to subnets.
        items:
          $ref: ./virtualNetwork.json#/definitions/Subnet
        readOnly: true
        type: array
  SecurityRule:
    allOf:
      - description: Reference to another subresource.
        properties:
          id:
            description: Resource ID.
            type: string
        x-ms-azure-resource: true
    description: Network security rule.
    properties:
      etag:
        description: A unique read-only string that changes whenever the resource is updated.
        type: string
      name:
        description: The name of the resource that is unique within a resource group. This name can be used to access the resource.
        type: string
      properties:
        description: Security rule resource.
        properties:
          access:
            description: "The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'."
            enum:
              - Allow
              - Deny
            type: string
            x-ms-enum:
              modelAsString: true
              name: SecurityRuleAccess
          description:
            description: A description for this rule. Restricted to 140 chars.
            type: string
          destinationAddressPrefix:
            description: The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
            type: string
          destinationAddressPrefixes:
            description: The destination address prefixes. CIDR or destination IP ranges.
            items:
              type: string
            type: array
          destinationApplicationSecurityGroups:
            description: The application security group specified as destination.
            items:
              allOf:
                - description: Common resource representation.
                  properties:
                    id:
                      description: Resource ID.
                      type: string
                    location:
                      description: Resource location.
                      type: string
                    name:
                      description: Resource name.
                      readOnly: true
                      type: string
                    tags:
                      additionalProperties:
                        type: string
                      description: Resource tags.
                      type: object
                    type:
                      description: Resource type.
                      readOnly: true
                      type: string
                  x-ms-azure-resource: true
              description: An application security group in a resource group.
              properties:
                etag:
                  description: A unique read-only string that changes whenever the resource is updated.
                  readOnly: true
                  type: string
                properties:
                  description: Application security group properties.
                  properties:
                    provisioningState:
                      description: "The provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'."
                      readOnly: true
                      type: string
                    resourceGuid:
                      description: The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
                      readOnly: true
                      type: string
            type: array
          destinationPortRange:
            description: The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
            type: string
          destinationPortRanges:
            description: The destination port ranges.
            items:
              description: The destination port.
              type: string
            type: array
          direction:
            description: "The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'."
            enum:
              - Inbound
              - Outbound
            type: string
            x-ms-enum:
              modelAsString: true
              name: SecurityRuleDirection
          priority:
            description: The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
            format: int32
            type: integer
          protocol:
            description: Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.
            enum:
              - Tcp
              - Udp
              - "*"
            type: string
            x-ms-enum:
              modelAsString: true
              name: SecurityRuleProtocol
          provisioningState:
            description: "The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'."
            type: string
          sourceAddressPrefix:
            description: "The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. "
            type: string
          sourceAddressPrefixes:
            description: The CIDR or source IP ranges.
            items:
              type: string
            type: array
          sourceApplicationSecurityGroups:
            description: The application security group specified as source.
            items:
              allOf:
                - description: Common resource representation.
                  properties:
                    id:
                      description: Resource ID.
                      type: string
                    location:
                      description: Resource location.
                      type: string
                    name:
                      description: Resource name.
                      readOnly: true
                      type: string
                    tags:
                      additionalProperties:
                        type: string
                      description: Resource tags.
                      type: object
                    type:
                      description: Resource type.
                      readOnly: true
                      type: string
                  x-ms-azure-resource: true
              description: An application security group in a resource group.
              properties:
                etag:
                  description: A unique read-only string that changes whenever the resource is updated.
                  readOnly: true
                  type: string
                properties:
                  description: Application security group properties.
                  properties:
                    provisioningState:
                      description: "The provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'."
                      readOnly: true
                      type: string
                    resourceGuid:
                      description: The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
                      readOnly: true
                      type: string
            type: array
          sourcePortRange:
            description: The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
            type: string
          sourcePortRanges:
            description: The source port ranges.
            items:
              description: The source port.
              type: string
            type: array
        required:
          - protocol
          - access
          - direction
  SecurityRuleListResult:
    description: Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security group.
    properties:
      nextLink:
        description: The URL to get the next set of results.
        type: string
      value:
        description: The security rules in a network security group.
        items:
          $ref: "#/definitions/SecurityRule"
        type: array
  SecurityRulePropertiesFormat:
    description: Security rule resource.
    properties:
      access:
        description: "The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'."
        enum:
          - Allow
          - Deny
        type: string
        x-ms-enum:
          modelAsString: true
          name: SecurityRuleAccess
      description:
        description: A description for this rule. Restricted to 140 chars.
        type: string
      destinationAddressPrefix:
        description: The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
        type: string
      destinationAddressPrefixes:
        description: The destination address prefixes. CIDR or destination IP ranges.
        items:
          type: string
        type: array
      destinationApplicationSecurityGroups:
        description: The application security group specified as destination.
        items:
          allOf:
            - description: Common resource representation.
              properties:
                id:
                  description: Resource ID.
                  type: string
                location:
                  description: Resource location.
                  type: string
                name:
                  description: Resource name.
                  readOnly: true
                  type: string
                tags:
                  additionalProperties:
                    type: string
                  description: Resource tags.
                  type: object
                type:
                  description: Resource type.
                  readOnly: true
                  type: string
              x-ms-azure-resource: true
          description: An application security group in a resource group.
          properties:
            etag:
              description: A unique read-only string that changes whenever the resource is updated.
              readOnly: true
              type: string
            properties:
              description: Application security group properties.
              properties:
                provisioningState:
                  description: "The provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'."
                  readOnly: true
                  type: string
                resourceGuid:
                  description: The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
                  readOnly: true
                  type: string
        type: array
      destinationPortRange:
        description: The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
        type: string
      destinationPortRanges:
        description: The destination port ranges.
        items:
          description: The destination port.
          type: string
        type: array
      direction:
        description: "The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'."
        enum:
          - Inbound
          - Outbound
        type: string
        x-ms-enum:
          modelAsString: true
          name: SecurityRuleDirection
      priority:
        description: The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
        format: int32
        type: integer
      protocol:
        description: Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.
        enum:
          - Tcp
          - Udp
          - "*"
        type: string
        x-ms-enum:
          modelAsString: true
          name: SecurityRuleProtocol
      provisioningState:
        description: "The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'."
        type: string
      sourceAddressPrefix:
        description: "The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. "
        type: string
      sourceAddressPrefixes:
        description: The CIDR or source IP ranges.
        items:
          type: string
        type: array
      sourceApplicationSecurityGroups:
        description: The application security group specified as source.
        items:
          allOf:
            - description: Common resource representation.
              properties:
                id:
                  description: Resource ID.
                  type: string
                location:
                  description: Resource location.
                  type: string
                name:
                  description: Resource name.
                  readOnly: true
                  type: string
                tags:
                  additionalProperties:
                    type: string
                  description: Resource tags.
                  type: object
                type:
                  description: Resource type.
                  readOnly: true
                  type: string
              x-ms-azure-resource: true
          description: An application security group in a resource group.
          properties:
            etag:
              description: A unique read-only string that changes whenever the resource is updated.
              readOnly: true
              type: string
            properties:
              description: Application security group properties.
              properties:
                provisioningState:
                  description: "The provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'."
                  readOnly: true
                  type: string
                resourceGuid:
                  description: The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups.
                  readOnly: true
                  type: string
        type: array
      sourcePortRange:
        description: The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
        type: string
      sourcePortRanges:
        description: The source port ranges.
        items:
          description: The source port.
          type: string
        type: array
    required:
      - protocol
      - access
      - direction
