Mengamati variabel tertentu dan menunggu perubahan pada nilai variabel. Jika ada perubahan, metode ini akan menampilkan nilai baru atau waktu tunggu habis.
Jika variabel dihapus saat sedang dipantau, status variableState akan disetel ke DELETED dan metode akan menampilkan variabel terakhir yang diketahui value.
Jika Anda menetapkan batas waktu untuk menonton ke nilai yang lebih besar dari waktu tunggu internal (60 detik), nilai variabel saat ini akan ditampilkan dan variableState akan menjadi VARIABLE_STATE_UNSPECIFIED.
Jika ditentukan, periksa stempel waktu variabel saat ini dan jika stempel waktu saat ini lebih baru dari stempel waktu newerThan, metode akan segera ditampilkan.
Jika tidak ditentukan atau variabel memiliki stempel waktu yang lebih lama, pengamat akan menunggu nilai berubah sebelum ditampilkan.
Stempel waktu dalam format RFC3339 UTC "Zulu", akurat hingga nanodetik. Contoh: "2014-10-02T15:01:23.045123456Z".
Isi respons
Jika berhasil, isi respons akan berisi instance Variable.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-03-04 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-------"]]