REST Resource: projects.locations.endpointPolicies

Resource: EndpointPolicy

EndpointPolicy is a resource that helps apply desired configuration on the endpoints that match specific criteria. For example, this resource can be used to apply "authentication config" an all endpoints that serve on port 8080.

JSON representation
{
  "name": string,
  "createTime": string,
  "updateTime": string,
  "labels": {
    string: string,
    ...
  },
  "type": enum (EndpointPolicyType),
  "authorizationPolicy": string,
  "endpointMatcher": {
    object (EndpointMatcher)
  },
  "trafficPortSelector": {
    object (TrafficPortSelector)
  },
  "description": string,
  "serverTlsPolicy": string,
  "clientTlsPolicy": string
}
Fields
name

string

Required. Name of the EndpointPolicy resource. It matches pattern projects/{project}/locations/global/endpointPolicies/{endpointPolicy}.

createTime

string (Timestamp format)

Output only. The timestamp when the resource was created.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. The timestamp when the resource was updated.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

labels

map (key: string, value: string)

Optional. Set of label tags associated with the EndpointPolicy resource.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

type

enum (EndpointPolicyType)

Required. The type of endpoint policy. This is primarily used to validate the configuration.

authorizationPolicy

string

Optional. This field specifies the URL of AuthorizationPolicy resource that applies authorization policies to the inbound traffic at the matched endpoints. Refer to Authorization. If this field is not specified, authorization is disabled(no authz checks) for this endpoint.

endpointMatcher

object (EndpointMatcher)

Required. A matcher that selects endpoints to which the policies should be applied.

trafficPortSelector

object (TrafficPortSelector)

Optional. Port selector for the (matched) endpoints. If no port selector is provided, the matched config is applied to all ports.

description

string

Optional. A free-text description of the resource. Max length 1024 characters.

serverTlsPolicy

string

Optional. A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is used to determine the authentication policy to be applied to terminate the inbound traffic at the identified backends. If this field is not set, authentication is disabled(open) for this endpoint.

clientTlsPolicy

string

Optional. A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy can be set to specify the authentication for traffic from the proxy to the actual endpoints. More specifically, it is applied to the outgoing traffic from the proxy to the endpoint. This is typically used for sidecar model where the proxy identifies itself as endpoint to the control plane, with the connection between sidecar and endpoint requiring authentication. If this field is not set, authentication is disabled(open). Applicable only when EndpointPolicyType is SIDECAR_PROXY.

EndpointPolicyType

The type of endpoint policy.

Enums
ENDPOINT_POLICY_TYPE_UNSPECIFIED Default value. Must not be used.
SIDECAR_PROXY Represents a proxy deployed as a sidecar.
GRPC_SERVER Represents a proxyless gRPC backend.

EndpointMatcher

A definition of a matcher that selects endpoints to which the policies should be applied.

JSON representation
{

  // Union field matcher_type can be only one of the following:
  "metadataLabelMatcher": {
    object (MetadataLabelMatcher)
  }
  // End of list of possible types for union field matcher_type.
}
Fields
Union field matcher_type. Specifies type of the matcher used for this endpoint matcher. matcher_type can be only one of the following:
metadataLabelMatcher

object (MetadataLabelMatcher)

The matcher is based on node metadata presented by xDS clients.

MetadataLabelMatcher

The matcher that is based on node metadata presented by xDS clients.

JSON representation
{
  "metadataLabelMatchCriteria": enum (MetadataLabelMatchCriteria),
  "metadataLabels": [
    {
      object (MetadataLabels)
    }
  ]
}
Fields
metadataLabelMatchCriteria

enum (MetadataLabelMatchCriteria)

Specifies how matching should be done.

Supported values are: MATCH_ANY: At least one of the Labels specified in the matcher should match the metadata presented by xDS client. MATCH_ALL: The metadata presented by the xDS client should contain all of the labels specified here.

The selection is determined based on the best match. For example, suppose there are three EndpointPolicy resources P1, P2 and P3 and if P1 has a the matcher as MATCH_ANY <A:1, B:1>, P2 has MATCH_ALL <A:1,B:1>, and P3 has MATCH_ALL <A:1,B:1,C:1>.

If a client with label <A:1> connects, the config from P1 will be selected.

If a client with label <A:1,B:1> connects, the config from P2 will be selected.

If a client with label <A:1,B:1,C:1> connects, the config from P3 will be selected.

If there is more than one best match, (for example, if a config P4 with selector <A:1,D:1> exists and if a client with label <A:1,B:1,D:1> connects), pick up the one with older creation time.

metadataLabels[]

object (MetadataLabels)

The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list can have at most 64 entries. The list can be empty if the match criteria is MATCH_ANY, to specify a wildcard match (i.e this matches any client).

MetadataLabelMatchCriteria

Possible criteria values that define logic of how matching is made.

Enums
METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED Default value. Should not be used.
MATCH_ANY At least one of the Labels specified in the matcher should match the metadata presented by xDS client.
MATCH_ALL The metadata presented by the xDS client should contain all of the labels specified here.

MetadataLabels

Defines a name-pair value for a single label.

JSON representation
{
  "labelName": string,
  "labelValue": string
}
Fields
labelName

string

Required. Label name presented as key in xDS Node Metadata.

labelValue

string

Required. Label value presented as value corresponding to the above key, in xDS Node Metadata.

TrafficPortSelector

Specification of a port-based selector.

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

string

Optional. A list of ports. Can be port numbers or port range (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or named ports or * to specify all ports. If the list is empty, all ports are selected.

Methods

create

Creates a new EndpointPolicy in a given project and location.

delete

Deletes a single EndpointPolicy.

get

Gets details of a single EndpointPolicy.

list

Lists EndpointPolicies in a given project and location.

patch

Updates the parameters of a single EndpointPolicy.

setIamPolicy

Sets the access control policy on the specified resource.

testIamPermissions

Returns permissions that a caller has on the specified resource.