Method: projects.locations.memberships.validateCreate

memberships.validateCreate is a preflight check for memberships.create. It checks the following: 1. Caller has the required gkehub.memberships.create permission. 2. The membershipId is still available.

HTTP request

POST https://gkehub.googleapis.com/v1alpha/{parent=projects/*/locations/*}/memberships:validateCreate

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The parent (project and location) where the Memberships will be created. Specified in the format projects/*/locations/*.

Authorization requires the following IAM permission on the specified resource parent:

  • gkehub.memberships.create

Request body

The request body contains data with the following structure:

JSON representation
{
  "membershipId": string,
  "membership": {
    object (Membership)
  }
}
Fields
membershipId

string

Required. Client chosen membership id.

membership

object (Membership)

Required. Membership resource to be created.

Response body

Response message for the GkeHub.ValidateCreateMembership method.

If successful, the response body contains data with the following structure:

JSON representation
{
  "validationResults": [
    {
      object (ValidationResult)
    }
  ]
}
Fields
validationResults[]

object (ValidationResult)

Wraps all the validator results.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ValidationResult

ValidationResults are results set by each validator running during memberships.validateCreate.

JSON representation
{
  "validator": enum (ValidationResult.ValidatorType),
  "success": boolean,
  "result": string
}
Fields
validator

enum (ValidationResult.ValidatorType)

Validator type to validate membership with.

success

boolean

Whether the validation is passed or not.

result

string

Additional information for the validation.

ValidationResult.ValidatorType

Specifies different types of validation.

Enums
VALIDATOR_TYPE_UNSPECIFIED UNSPECIFIED validator.
MEMBERSHIP_ID MEMBERSHIP_ID validator validates that the membershipId is still available.
CROSS_PROJECT_PERMISSION CROSS_PROJECT_PERMISSION validator validates that the cross-project role binding for the service agent is in place.