REST Resource: regionNetworkPolicies

Resource: NetworkPolicy

Represents a Network Policy resource.

JSON representation
{
  "kind": string,
  "id": string,
  "creationTimestamp": string,
  "name": string,
  "description": string,
  "trafficClassificationRules": [
    {
      object (TrafficClassificationRule)
    }
  ],
  "selfLink": string,
  "selfLinkWithId": string,
  "associations": [
    {
      object (Association)
    }
  ],
  "ruleTupleCount": integer,
  "region": string
}
Fields
kind

string

Output only. Type of the resource. Always

compute#networkPolicy

for network policies

id

string (uint64 format)

Output only. The unique identifier for the resource. This identifier is defined by the server.

creationTimestamp

string

Output only. Creation timestamp in RFC3339 text format.

name

string

Name of the resource.

description

string

An optional description of this resource. Provide this property when you create the resource.

trafficClassificationRules[]

object (TrafficClassificationRule)

Output only. A list of traffic classification rules that belong to this policy.

associations[]

object (Association)

Output only. A list of associations that belong to this network policy.

ruleTupleCount

integer

Output only. Total count of all network policy rule tuples. A network policy can not exceed a set number of tuples.

region

string

Output only. URL of the region where the regional network policy resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.

TrafficClassificationRule

Represents a traffic classification rule that describes one or more match conditions along with the action to be taken when traffic matches this condition.

JSON representation
{
  "kind": string,
  "ruleName": string,
  "description": string,
  "priority": integer,
  "match": {
    object (Matcher)
  },
  "action": {
    object (Action)
  },
  "ruleTupleCount": integer,
  "targetServiceAccounts": [
    string
  ],
  "targetSecureTags": [
    {
      object (SecureTag)
    }
  ],
  "disabled": boolean
}
Fields
kind

string

Output only. Type of the resource. Always

compute#networkPolicyTrafficClassificationRule

for network policy traffic classification rules

ruleName

string

An optional name for the rule. This field is not a unique identifier and can be updated.

description

string

An optional description for this resource.

priority

integer

An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.

match

object (Matcher)

A match condition that outgoing traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.

action

object (Action)

The Action to perform when the client connection triggers the rule.

ruleTupleCount

integer

Output only. Calculation of the complexity of a single network policy rule.

targetServiceAccounts[]

string

A list of service accounts indicating the sets of instances that are applied with this rule.

targetSecureTags[]

object (SecureTag)

A list of secure tags that controls which instances the traffic classification rule applies to. If

targetSecureTag

are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the

targetSecureTag

are in INEFFECTIVE state, then this rule will be ignored.

targetSecureTag

may not be set at the same time as

targetServiceAccounts

. If neither

targetServiceAccounts

nor

targetSecureTag

are specified, the traffic classification rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256.

disabled

boolean

Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.

Matcher

Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified.

JSON representation
{
  "srcIpRanges": [
    string
  ],
  "destIpRanges": [
    string
  ],
  "layer4Configs": [
    {
      object (Layer4Config)
    }
  ]
}
Fields
srcIpRanges[]

string

CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000.

destIpRanges[]

string

CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000.

layer4Configs[]

object (Layer4Config)

Pairs of IP protocols and ports that the rule should match.

Layer4Config

JSON representation
{
  "ipProtocol": string,
  "ports": [
    string
  ]
}
Fields
ipProtocol

string

The IP protocol to which this rule applies. The protocol type is required when creating a traffic classification rule. This value can either be one of the following well known protocol strings (

tcp

,

udp

,

icmp

,

esp

,

ah

,

ipip

,

sctp

), or the IP protocol number.

ports[]

string

An optional list of ports to which this rule applies. This field is only applicable for UDP, TCP or SCTP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port.

Example inputs include:

["22"]

,

["80","443"]

, and

["12345-12349"]

.

Action

JSON representation
{
  "type": string,
  "trafficClass": enum (TrafficClass),
  "dscpMode": enum (DscpMode),
  "dscpValue": integer
}
Fields
type

string

Always "apply_traffic_classification" for traffic classification rules.

trafficClass

enum (TrafficClass)

The traffic class that should be applied to the matching packet.

dscpMode

enum (DscpMode)

DSCP mode. When set to

AUTO

, the DSCP value will be picked automatically based on selected

trafficClass

. Otherwise,

dscpValue

needs to be explicitly specified.

dscpValue

integer

Custom DSCP value from 0-63 range.

TrafficClass

Enum representing the various traffic classes offered by AAI.

Enums
TC1 Traffic Class 1, corresponding to DSCP ranges (0-7) 000xxx.
TC2 Traffic Class 2, corresponding to DSCP ranges (8-15) 001xxx.
TC3 Traffic Class 3, corresponding to DSCP ranges (16-23) 010xxx.
TC4 Traffic Class 4, corresponding to DSCP ranges (24-31) 011xxx.
TC5 Traffic Class 5, corresponding to DSCP ranges (32-47) 10xxxx.
TC6 Traffic Class 6, corresponding to DSCP ranges (48-63) 11xxxx.

DscpMode

Enum representing the DSCP mode.

Enums
AUTO DSCP value will be automatically picked up based on configured trafficClass.
CUSTOM Allows to specify custom DSCP value from selected trafficClass range.

SecureTag

JSON representation
{
  "name": string,
  "state": enum (State)
}
Fields
name

string

Name of the secure tag, created with TagManager's TagValue API.

state

enum (State)

Output only. State of the secure tag, either EFFECTIVE or INEFFECTIVE. A secure tag is INEFFECTIVE when it is deleted or its network is deleted.

State

Enums
STATE_UNSPECIFIED
EFFECTIVE
INEFFECTIVE

Association

JSON representation
{
  "name": string,
  "attachmentTarget": string
}
Fields
name

string

The name for an association.

attachmentTarget

string

The target that the network policy is attached to.

Methods

addAssociation

The method compute.beta.RegionNetworkPoliciesService.AddAssociation is not available in Cloud de Confiance by S3NS.

addTrafficClassificationRule

The method compute.beta.RegionNetworkPoliciesService.AddTrafficClassificationRule is not available in Cloud de Confiance by S3NS.

aggregatedList

The method compute.beta.RegionNetworkPoliciesService.AggregatedList is not available in Cloud de Confiance by S3NS.

delete

The method compute.beta.RegionNetworkPoliciesService.Delete is not available in Cloud de Confiance by S3NS.

get

The method compute.beta.RegionNetworkPoliciesService.Get is not available in Cloud de Confiance by S3NS.

getAssociation

The method compute.beta.RegionNetworkPoliciesService.GetAssociation is not available in Cloud de Confiance by S3NS.

getTrafficClassificationRule

The method compute.beta.RegionNetworkPoliciesService.GetTrafficClassificationRule is not available in Cloud de Confiance by S3NS.

insert

The method compute.beta.RegionNetworkPoliciesService.Insert is not available in Cloud de Confiance by S3NS.

list

The method compute.beta.RegionNetworkPoliciesService.List is not available in Cloud de Confiance by S3NS.

patch

The method compute.beta.RegionNetworkPoliciesService.Patch is not available in Cloud de Confiance by S3NS.

patchTrafficClassificationRule

The method compute.beta.RegionNetworkPoliciesService.PatchTrafficClassificationRule is not available in Cloud de Confiance by S3NS.

removeAssociation

The method compute.beta.RegionNetworkPoliciesService.RemoveAssociation is not available in Cloud de Confiance by S3NS.

removeTrafficClassificationRule

The method compute.beta.RegionNetworkPoliciesService.RemoveTrafficClassificationRule is not available in Cloud de Confiance by S3NS.