Beobachtet eine bestimmte Variable und wartet auf eine Änderung des Werts der Variable. Wenn eine Änderung auftritt, gibt diese Methode den neuen Wert zurück oder es tritt eine Zeitüberschreitung ein.
Wenn eine Variable während der Beobachtung gelöscht wird, wird der Status variableState auf DELETED festgelegt und die Methode gibt die letzte bekannte Variable value zurück.
Wenn Sie für die Frist für die Beobachtung einen Wert festlegen, der größer als die interne Zeitüberschreitung (60 Sekunden) ist, wird der aktuelle Variablenwert zurückgegeben und variableState ist VARIABLE_STATE_UNSPECIFIED.
Wenn angegeben, wird der aktuelle Zeitstempel der Variablen geprüft. Wenn der aktuelle Zeitstempel neuer als der Zeitstempel von newerThan ist, gibt die Methode sofort eine Antwort zurück.
Wenn nicht angegeben oder die Variable einen älteren Zeitstempel hat, wartet der Watcher mit der Antwort darauf, dass sich eine Variable ändert.
Ein Zeitstempel im Format "RFC3339 UTC 'Zulu'" in Nanosekunden. Beispiel: "2014-10-02T15:01:23.045123456Z".
Antworttext
Wenn der Vorgang erfolgreich abgeschlossen wurde, enthält der Antworttext eine Instanz von Variable.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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-------"]]