A Waiter resource waits for some end condition within a RuntimeConfig resource to be met before it returns. For example, assume you have a distributed system where each node writes to a Variable resource indicating the node's readiness as part of the startup process.
You then configure a Waiter resource with the success condition set to wait until some number of nodes have checked in. Afterwards, your application runs some arbitrary code after the condition has been met and the waiter returns successfully.
Once created, a Waiter resource is immutable.
To learn more about using waiters, read the Creating a Waiter documentation.
The [PROJECT_ID] must be a valid Google Cloud project ID, the [CONFIG_NAME] must be a valid RuntimeConfig resource, the [WAITER_NAME] must match RFC 1035 segment specification, and the length of [WAITER_NAME] must be less than 64 bytes.
After you create a Waiter resource, you cannot change the resource name.
[Required] Specifies the timeout of the waiter in seconds, beginning from the instant that waiters().create method is called. If this time elapses before the success or failure conditions are met, the waiter fails and sets the error code to DEADLINE_EXCEEDED.
A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
[Optional] The failure condition of this waiter. If this condition is met, done will be set to true and the error code will be set to ABORTED. The failure condition takes precedence over the success condition. If both conditions are met, a failure will be indicated. This value is optional; if no failure condition is set, the only failure scenario will be a timeout.
[Required] The success condition. If this condition is met, done will be set to true and the error value will remain unset. The failure condition takes precedence over the success condition. If both conditions are met, a failure will be indicated.
Output only. The instant at which this Waiter resource was created. Adding the value of timeout to this instant yields the timeout deadline for the waiter.
A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".
done
boolean
Output only. If the value is false, it means the waiter is still waiting for one of its conditions to be met.
If true, the waiter has finished. If the waiter finished due to a timeout or failure, error will be set.
A Cardinality condition for the Waiter resource. A cardinality condition is met when the number of variables under a specified path prefix reaches a predefined number. For example, if you set a Cardinality condition where the path is set to /foo and the number of paths is set to 2, the following variables would meet the condition in a RuntimeConfig resource:
/foo/variable1 = "value1"
/foo/variable2 = "value2"
/bar/variable3 = "value3"
It would not satisfy the same condition with the number set to 3, however, because there is only 2 paths that start with /foo. Cardinality conditions are recursive; all subtrees under the specific path prefix are counted.
JSON representation
{"path": string,"number": number}
Fields
path
string
The root of the variable subtree to monitor. For example, /foo.
number
number
The number variables under the path that must exist to meet this condition. Defaults to 1 if not specified.
[[["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\u003eA Waiter resource monitors a RuntimeConfig resource, waiting for a specified success condition to be met before returning.\u003c/p\u003e\n"],["\u003cp\u003eWaiters have a timeout period and can also be configured with a failure condition, which takes precedence over the success condition, causing the waiter to fail if both are met.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eEndCondition\u003c/code\u003e for a Waiter is defined by a \u003ccode\u003eCardinality\u003c/code\u003e, which checks if a certain number of variables exist under a specific path prefix in the RuntimeConfig.\u003c/p\u003e\n"],["\u003cp\u003eCardinality conditions are recursive and count all subtrees under a specified path, and the \u003ccode\u003enumber\u003c/code\u003e field defaults to 1 if not set.\u003c/p\u003e\n"],["\u003cp\u003eYou can create, delete, get, list, and check permissions on a waiter with the various methods provided.\u003c/p\u003e\n"]]],[],null,["# REST Resource: projects.configs.waiters\n\n- [Resource: Waiter](#Waiter)\n - [JSON representation](#Waiter.SCHEMA_REPRESENTATION)\n- [EndCondition](#EndCondition)\n - [JSON representation](#EndCondition.SCHEMA_REPRESENTATION)\n- [Cardinality](#Cardinality)\n - [JSON representation](#Cardinality.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Waiter\n----------------\n\nA Waiter resource waits for some end condition within a RuntimeConfig resource to be met before it returns. For example, assume you have a distributed system where each node writes to a Variable resource indicating the node's readiness as part of the startup process.\n\nYou then configure a Waiter resource with the success condition set to wait until some number of nodes have checked in. Afterwards, your application runs some arbitrary code after the condition has been met and the waiter returns successfully.\n\nOnce created, a Waiter resource is immutable.\n\nTo learn more about using waiters, read the [Creating a Waiter](/deployment-manager/runtime-configurator/creating-a-waiter) documentation.\n\nEndCondition\n------------\n\nThe condition that a Waiter resource is waiting for.\n\nCardinality\n-----------\n\nA Cardinality condition for the Waiter resource. A cardinality condition is met when the number of variables under a specified path prefix reaches a predefined number. For example, if you set a Cardinality condition where the `path` is set to `/foo` and the number of paths is set to `2`, the following variables would meet the condition in a RuntimeConfig resource:\n\n- `/foo/variable1 = \"value1\"`\n- `/foo/variable2 = \"value2\"`\n- `/bar/variable3 = \"value3\"`\n\nIt would not satisfy the same condition with the `number` set to `3`, however, because there is only 2 paths that start with `/foo`. Cardinality conditions are recursive; all subtrees under the specific path prefix are counted."]]