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

# POST /v1/{+parent}:validate

`POST /v1/{+parent}:validate`

Service producers use this method to validate if the consumer provided network, project and requested range are valid. This allows them to use a fail-fast mechanism for consumer requests, and not have to wait for AddSubnetwork operation completion to determine if user request is invalid.

## Path parameters

- `parent` string, required

## Request body

- ValidateConsumerConfigRequest
  - `consumerNetwork` string — Required. The network that the consumer is using to connect with services. Must be in the form of projects/{project}/global/networks/{network} {project} is a project number, as in '12345' {network} is network name.
  - `rangeReservation` RangeReservation — Represents a range reservation.
    - `ipPrefixLength` integer — Required. The size of the desired subnet. Use usual CIDR range notation. For example, '29' to find unused x.x.x.x/29 CIDR range. The goal is to determine if one of the allocated ranges has enough free space for a subnet of the requested size. GCE disallows subnets with prefix_length > 29
    - `requestedRanges` string[] — Optional. The name of one or more allocated IP address ranges associated with this private service access connection. If no range names are provided all ranges associated with this connection will be considered. If a CIDR range with the specified IP prefix length is not available within these ranges the validation fails.
    - `secondaryRangeIpPrefixLengths` integer[] — Optional. The size of the desired secondary ranges for the subnet. Use usual CIDR range notation. For example, '29' to find unused x.x.x.x/29 CIDR range. The goal is to determine that the allocated ranges have enough free space for all the requested secondary ranges. GCE disallows subnets with prefix_length > 29
    - `subnetworkCandidates` Subnetwork[] — Optional. List of subnetwork candidates to validate. The required input fields are `name`, `network`, and `region`. Subnetworks from this list which exist will be returned in the response with the `ip_cidr_range`, `secondary_ip_cider_ranges`, and `outside_allocation` fields set.
      - `outsideAllocation` boolean — This is a discovered subnet that is not within the current consumer allocated ranges.
      - `name` string — Subnetwork name. See https://cloud.google.com/compute/docs/vpc/
      - `ipCidrRange` string — Subnetwork CIDR range in `10.x.x.x/y` format.
      - `secondaryIpRanges` SecondaryIpRange[] — List of secondary IP ranges in this subnetwork.
        - `rangeName` string — Name of the secondary IP range.
        - `ipCidrRange` string — Secondary IP CIDR range in `x.x.x.x/y` format.
      - `network` string — In the Shared VPC host project, the VPC network that's peered with the consumer network. For example: `projects/1234321/global/networks/host-network`
      - `region` string — GCP region where the subnetwork is located.
  - `consumerProject` ConsumerProject — Represents a consumer project.
    - `projectNum` string, int64 — Required. Project number of the consumer that is launching the service instance. It can own the network that is peered with Google or, be a service project in an XPN where the host project has the network.
  - `validateNetwork` boolean — The validations will be performed in the order listed in the ValidationError enum. The first failure will return. If a validation is not requested, then the next one will be performed. SERVICE_NETWORKING_NOT_ENABLED and NETWORK_NOT_PEERED checks are performed for all requests where validation is requested. NETWORK_NOT_FOUND and NETWORK_DISCONNECTED checks are done for requests that have validate_network set to true.
  - `checkServiceNetworkingUsePermission` boolean — Optional. The IAM permission check determines whether the consumer project has 'servicenetworking.services.use' permission or not.

## Response `200`

Successful response

---

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