Resource: Waiter
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.
JSON representation | |
---|---|
{ "name": string, "timeout": string, "failure": { object( |
Fields | |
---|---|
name |
The name of the Waiter resource, in the format:
The After you create a Waiter resource, you cannot change the resource name. |
timeout |
[Required] Specifies the timeout of the waiter in seconds, beginning from the instant that A duration in seconds with up to nine fractional digits, terminated by ' |
failure |
[Optional] The failure condition of this waiter. If this condition is met, |
success |
[Required] The success condition. If this condition is met, |
createTime |
Output only. The instant at which this Waiter resource was created. Adding the value of A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: |
done |
Output only. If the value is If true, the waiter has finished. If the waiter finished due to a timeout or failure, |
error |
Output only. If the waiter ended due to a failure or timeout, this value will be set. |
EndCondition
The condition that a Waiter resource is waiting for.
JSON representation | |
---|---|
{
"cardinality": {
object( |
Fields | |
---|---|
cardinality |
The cardinality of the |
Cardinality
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 |
The root of the variable subtree to monitor. For example, |
number |
The number variables under the |
Methods |
|
---|---|
|
Creates a Waiter resource. |
|
Deletes the waiter with the specified name. |
|
Gets information about a single waiter. |
|
List waiters within the given configuration. |
|
Returns permissions that a caller has on the specified resource. |