---
title: "POST /v1/{+parent}/endpointPolicies"
method: POST
path: "/v1/{+parent}/endpointPolicies"
tags: ["projects"]
---

# POST /v1/{+parent}/endpointPolicies

`POST /v1/{+parent}/endpointPolicies`

Creates a new EndpointPolicy in a given project and location.

## Path parameters

- `parent` string, required

## Query parameters

- `endpointPolicyId` string

## Request body

- 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.
  - `name` string — Identifier. Name of the EndpointPolicy resource. It matches pattern `projects/{project}/locations/*/endpointPolicies/{endpoint_policy}`.
  - `createTime` string, google-datetime — Output only. The timestamp when the resource was created.
  - `updateTime` string, google-datetime — Output only. The timestamp when the resource was updated.
  - `labels` object — Optional. Set of label tags associated with the EndpointPolicy resource.
  - `type` 'ENDPOINT_POLICY_TYPE_UNSPECIFIED' | 'SIDECAR_PROXY' | 'GRPC_SERVER' — 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` EndpointMatcher — A definition of a matcher that selects endpoints to which the policies should be applied.
    - `metadataLabelMatcher` EndpointMatcherMetadataLabelMatcher — The matcher that is based on node metadata presented by xDS clients.
      - `metadataLabelMatchCriteria` 'METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED' | 'MATCH_ANY' | 'MATCH_ALL' — 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 , P2 has MATCH_ALL , and P3 has MATCH_ALL . If a client with label connects, the config from P1 will be selected. If a client with label connects, the config from P2 will be selected. If a client with label connects, the config from P3 will be selected. If there is more than one best match, (for example, if a config P4 with selector exists and if a client with label connects), pick up the one with older creation time.
      - `metadataLabels` EndpointMatcherMetadataLabelMatcherMetadataLabels[] — 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).
        - `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` TrafficPortSelector — Specification of a port-based selector.
    - `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.
  - `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.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/networkservices.md) · [All operations](https://skmtc.net/google/apis/networkservices/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/networkservices/revisions/ff841dec54e1/schema)
