Method: organizationSecurityPolicies.addAssociation

Inserts an association for the specified security policy.

HTTP request

POST https://compute.googleapis.com/compute/beta/locations/global/{resourceId=securityPolicies/*}/addAssociation

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
resourceId

string

Name of the security policy to update.

Query parameters

Parameters
requestId

string

An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.

For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

replaceExistingAssociation

boolean

Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists.

Request body

The request body contains data with the following structure:

JSON representation
{
  "name": string,
  "attachmentId": string,
  "securityPolicyId": string,
  "displayName": string
}
Fields
name

string

The name for an association.

attachmentId

string

The resource that the security policy is attached to.

securityPolicyId

string

[Output Only] The security policy ID of the association.

displayName

string

[Output Only] The display name of the security policy of the association.

Response body

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

Represents an Operation resource.

Google Compute Engine has three Operation resources:

You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.

Operations can be global, regional or zonal.

  • For global operations, use the globalOperations resource.
  • For regional operations, use the regionOperations resource.
  • For zonal operations, use the zonalOperations resource.

For more information, read Global, Regional, and Zonal Resources.

JSON representation
{
  "id": string,
  "creationTimestamp": string,
  "name": string,
  "zone": string,
  "clientOperationId": string,
  "operationType": string,
  "targetLink": string,
  "targetId": string,
  "status": enum,
  "statusMessage": string,
  "user": string,
  "progress": integer,
  "insertTime": string,
  "startTime": string,
  "endTime": string,
  "error": {
    "errors": [
      {
        "code": string,
        "location": string,
        "message": string
      }
    ]
  },
  "warnings": [
    {
      "code": enum,
      "message": string,
      "data": [
        {
          "key": string,
          "value": string
        }
      ]
    }
  ]