services

POST /v1/services/{servicesId}:validate

Changed on

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.

Request

  • Base URL
    https://servicenetworking.googleapis.com
  • Auth
    • OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/cloud-platform
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/cloud-platform
    • or OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/service.management
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/service.management

Path parameters

servicesId, string required

Query parameters

$.xgafv, '1' | '2'

V1 error format.

access_token, string

OAuth access token.

alt, 'json' | 'media' | 'proto'

Data format for response.

callback, string

JSONP

fields, string

Selector specifying which fields to include in a partial response.

key, string

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_token, string

OAuth 2.0 token for the current user.

prettyPrint, boolean

Returns response with indentations and line breaks.

quotaUser, string

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

uploadType, string

Legacy upload protocol for media (e.g. "media", "multipart").

upload_protocol, string

Upload protocol for media (e.g. "raw", "multipart").

Request body

ValidateConsumerConfigRequest required
checkServiceNetworkingUsePermission, boolean

Optional. The IAM permission check determines whether the consumer project has 'servicenetworking.services.use' permission or not.

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.

consumerProject, ConsumerProject

Represents a consumer project.

rangeReservation, RangeReservation

Represents a range reservation.

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.

Response

Successful response

ValidateConsumerConfigResponse required
existingSubnetworkCandidates, Subnetwork[]

List of subnetwork candidates from the request which exist with the ip_cidr_range, secondary_ip_cider_ranges, and outside_allocation fields set.

isValid, boolean

Indicates whether all the requested validations passed.

validationError, 'VALIDATION_ERROR_UNSPECIFIED' | 'VALIDATION_NOT_REQUESTED' | 'SERVICE_NETWORKING_NOT_ENABLED' | 'NETWORK_NOT_FOUND' | 'NETWORK_NOT_PEERED' | 'NETWORK_PEERING_DELETED' | 'NETWORK_NOT_IN_CONSUMERS_PROJECT' | 'NETWORK_NOT_IN_CONSUMERS_HOST_PROJECT' | 'HOST_PROJECT_NOT_FOUND' | 'CONSUMER_PROJECT_NOT_SERVICE_PROJECT' | 'RANGES_EXHAUSTED' | 'RANGES_NOT_RESERVED' | 'RANGES_DELETED_LATER' | 'COMPUTE_API_NOT_ENABLED' | 'USE_PERMISSION_NOT_FOUND' | 'SN_SERVICE_AGENT_PERMISSION_DENIED_ON_CONSUMER_PROJECT'

The first validation which failed.

Changes

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/service.management was removed from the endpoint's security scheme Oauth2

    1 more change in this revision