Watches a specific variable and waits for a change in the variable's value. When there is a change, this method returns the new value or times out.
If a variable is deleted while being watched, the variableState state is set to DELETED and the method returns the last known variable value.
If you set the deadline for watching to a larger value than internal timeout (60 seconds), the current variable value is returned and the variableState will be VARIABLE_STATE_UNSPECIFIED.
If specified, checks the current timestamp of the variable and if the current timestamp is newer than newerThan timestamp, the method returns immediately.
If not specified or the variable has an older timestamp, the watcher waits for a the value to change before returning.
A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".
Response body
If successful, the response body contains an instance of Variable.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-30 UTC."],[[["\u003cp\u003eThis method watches a specified variable for changes, returning the new value upon change or timing out.\u003c/p\u003e\n"],["\u003cp\u003eIf the watched variable is deleted, the method will return the last known value, and the \u003ccode\u003evariableState\u003c/code\u003e will be set to \u003ccode\u003eDELETED\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request is a \u003ccode\u003ePOST\u003c/code\u003e to a specific URL, which includes the variable's name in the format: \u003ccode\u003eprojects/[PROJECT_ID]/configs/[CONFIG_NAME]\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request body can contain a \u003ccode\u003enewerThan\u003c/code\u003e field, which is a timestamp used to immediately check if the current variable timestamp is newer than the provided timestamp.\u003c/p\u003e\n"],["\u003cp\u003eThe method requires authorization with either the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloudruntimeconfig\u003c/code\u003e OAuth scopes.\u003c/p\u003e\n"]]],[],null,["# Method: projects.configs.variables.watch\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization Scopes](#body.aspect)\n- [Try it!](#try-it)\n\nWatches a specific variable and waits for a change in the variable's value. When there is a change, this method returns the new value or times out.\n\nIf a variable is deleted while being watched, the `variableState` state is set to `DELETED` and the method returns the last known variable `value`.\n\nIf you set the deadline for watching to a larger value than internal timeout (60 seconds), the current variable value is returned and the `variableState` will be `VARIABLE_STATE_UNSPECIFIED`.\n\nTo learn more about creating a watcher, read the [Watching a Variable for Changes](/deployment-manager/runtime-configurator/watching-a-variable) documentation.\n\n### HTTP request\n\n`POST https://runtimeconfig.googleapis.com/v1beta1/{name=projects/*/configs/*/variables/**}:watch`\n\nThe URL uses [gRPC Transcoding](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Variable](/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables#Variable).\n\n### Authorization Scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n- `https://www.googleapis.com/auth/cloudruntimeconfig`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).\n\nTry it!\n-------"]]