- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- Try it!
Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.
HTTP request
POST https://compute.s3nsapis.fr/compute/v1/projects/{project}/global/snapshots/{resource}/setLabels
The URL uses gRPC Transcoding syntax. To know more about valid error responses that can be thrown by this HTTP request, please refer to the service error catalog
Path parameters
Parameters | |
---|---|
project |
Project ID for this request. |
resource |
Name or id of the resource for this request. |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "labels": { string: string, ... }, "labelFingerprint": string } |
Fields | |
---|---|
labels |
A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example,
. A label value can also be empty (e.g.
). |
labelFingerprint |
The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error
. Make a
request to the resource to get the latest fingerprint. A base64-encoded string. |
Response body
If successful, the response body contains an instance of Operation
.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/compute
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
In addition to any permissions specified on the fields above, authorization requires one or more of the following IAM permissions:
compute.snapshots.setLabels
To find predefined roles that contain those permissions, see Compute Engine IAM Roles.