Requires authorization
Sets metadata common to all instances within the specified project using the data included in the request. Try it now .
Request
HTTP request
POST https://www.googleapis.com/compute/v1/projects/project/setCommonInstanceMetadata
Parameters
Parameter name | Value | Description |
---|---|---|
Path parameters | ||
project
|
string
|
Project ID of the project scoping this request. |
Authorization
This request requires authorization with the following scope ( read more about authentication and authorization ).
Scope |
---|
https://www.googleapis.com/auth/compute
|
Request body
In the request body, supply data with the following structure:
{ "kind": "compute#metadata", "fingerprint": bytes, "items": [ { "key": string, "value": string } ] }
Property name | Value | Description | Notes |
---|---|---|---|
kind
|
string
|
Type of the resource. Always
compute#metadata
.
|
|
fingerprint
|
bytes
|
Fingerprint of this resource, which is essentially a hash of the metadata's contents. This field is used for optimistic locking. You must provide an up-to-date metadata fingerprint in order to modify metadata. | |
items[]
|
list
|
Array of key/value pairs. The total size of all keys and values must be less than 512 KB. | |
items[].
key
|
string
|
Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. | |
items[].
value
|
string
|
Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes. |
Response
If successful, this method returns a response body with the following structure:
{ "kind": "compute#operation", "id": unsigned long, "creationTimestamp": string, "name": string, "zone": string, "clientOperationId": string, "operationType": string, "targetLink": string, "targetId": unsigned long, "status": string, "statusMessage": string, "user": string, "progress": integer, "insertTime": string, "startTime": string, "endTime": string, "error": { "errors": [ { "code": string, "location": string, "message": string } ] }, "warnings": [ { "code": string, "message": string, "data": [ { "key": string, "value": string } ] } ], "httpErrorStatusCode": integer, "httpErrorMessage": string, "selfLink": string, "region": string }
Property name | Value | Description | Notes |
---|---|---|---|
kind
|
string
|
Type of the resource. | |
id
|
unsigned long
|
Unique identifier for the resource; defined by the server (output only). | |
creationTimestamp
|
string
|
Creation timestamp in RFC3339 text format (output only). | |
name
|
string
|
Name of the resource (output only). | |
zone
|
string
|
URL of the zone where the operation resides (output only). | |
clientOperationId
|
string
|
An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only). | |
operationType
|
string
|
Type of the operation. Examples include "insert", "update", and "delete" (output only). | |
targetLink
|
string
|
URL of the resource the operation is mutating (output only). | |
targetId
|
unsigned long
|
Unique target id which identifies a particular incarnation of the target (output only). | |
status
|
string
|
Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
Acceptable values are:
|
|
statusMessage
|
string
|
An optional textual description of the current status of the operation (output only). | |
user
|
string
|
User who requested the operation, for example "[email protected]" (output only). | |
progress
|
integer
|
An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only). | |
insertTime
|
string
|
The time that this operation was requested. This is in RFC 3339 format (output only). | |
startTime
|
string
|
The time that this operation was started by the server. This is in RFC 3339 format (output only). | |
endTime
|
string
|
The time that this operation was completed. This is in RFC 3339 format (output only). | |
error
|
object
|
If errors occurred during processing of this operation, this field will be populated (output only). | |
error.
errors[]
|
list
|
The array of errors encountered while processing this operation. | |
error.errors[].
code
|
string
|
The error type identifier for this error. | |
error.errors[].
location
|
string
|
Indicates the field in the request which caused the error. This property is optional. | |
error.errors[].
message
|
string
|
An optional, human-readable error message. | |
warnings[]
|
list
|
If warning messages generated during processing of this operation, this field will be populated (output only). | |
warnings[].
code
|
string
|
The warning type identifier for this warning.
Acceptable values are:
|
|
warnings[].
message
|
string
|
Optional human-readable details for this warning. | |
warnings[].
data[]
|
list
|
Metadata for this warning in 'key: value' format. | |
warnings[].data[].
key
|
string
|
A key for the warning data. | |
warnings[].data[].
value
|
string
|
A warning data value corresponding to the key. | |
httpErrorStatusCode
|
integer
|
If operation fails, the HTTP error status code returned, e.g. 404. (output only). | |
httpErrorMessage
|
string
|
If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only). | |
selfLink
|
string
|
Server defined URL for the resource (output only). | |
region
|
string
|
URL of the region where the operation resides (output only). |
Try it!
Use the APIs Explorer below to call this method on live data and see the response.