Describes a single variable within a RuntimeConfig resource. The name denotes the hierarchical variable name. For example, ports/serving_port is a valid variable name. The variable value is an opaque string and only leaf variables can have values (that is, variables that do not have any child variables).
JSON representation
{"name": string,"updateTime": string,"state": enum(VariableState),// Union field contents can be only one of the following:"value": string,"text": string// End of list of possible types for union field contents.}
The [PROJECT_ID] must be a valid project ID, [CONFIG_NAME] must be a valid RuntimeConfig resource and [VARIABLE_NAME] follows Unix file system file path naming.
The [VARIABLE_NAME] can contain ASCII letters, numbers, slashes and dashes. Slashes are used as path element separators and are not part of the [VARIABLE_NAME] itself, so [VARIABLE_NAME] must contain at least one non-slash character. Multiple slashes are coalesced into single slash character. Each path segment should match 0-9A-Za-z? regular expression. The length of a [VARIABLE_NAME] must be less than 256 characters.
Once you create a variable, you cannot change the variable name.
Output only. The current state of the variable. The variable state indicates the outcome of the variables().watch call and is visible through the get and list calls.
Union field contents. The value of the variable. It can be either a binary or a string value. You must specify one of either value or text. Specifying both will cause the server to return an error. contents can be only one of the following:
The binary value of the variable. The length of the value must be less than 4096 bytes. Empty values are also accepted. The value must be base64 encoded, and must comply with IETF RFC4648 (https://www.ietf.org/rfc/rfc4648.txt). Only one of value or text can be set.
A base64-encoded string.
text
string
The string value of the variable. The length of the value must be less than 4096 bytes. Empty values are also accepted. For example, text: "my text value". The string must be valid UTF-8.
VariableState
The VariableState describes the last known state of the variable and is used during a variables().watch call to distinguish the state of the variable.
Enums
VARIABLE_STATE_UNSPECIFIED
Default variable state.
UPDATED
The variable was updated, while variables().watch was executing.
DELETED
The variable was deleted, while variables().watch was executing.
[[["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 Variable describes a single variable within a RuntimeConfig resource, with a hierarchical name (e.g., \u003ccode\u003eports/serving_port\u003c/code\u003e), and only leaf variables can have values.\u003c/p\u003e\n"],["\u003cp\u003eThe JSON representation of a Variable includes its name, update time, state, and either a \u003ccode\u003evalue\u003c/code\u003e (binary) or \u003ccode\u003etext\u003c/code\u003e (string) content, but not both.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eVariableState\u003c/code\u003e indicates the last known state of the variable, and the \u003ccode\u003evariables().watch\u003c/code\u003e call will update its status to either \u003ccode\u003eUPDATED\u003c/code\u003e or \u003ccode\u003eDELETED\u003c/code\u003e, it also has an \u003ccode\u003eVARIABLE_STATE_UNSPECIFIED\u003c/code\u003e state.\u003c/p\u003e\n"],["\u003cp\u003eKey fields for a Variable include \u003ccode\u003ename\u003c/code\u003e (the resource name with project, config, and variable identifiers), \u003ccode\u003eupdateTime\u003c/code\u003e (last update timestamp), and \u003ccode\u003estate\u003c/code\u003e (current state), along with either a binary \u003ccode\u003evalue\u003c/code\u003e or string \u003ccode\u003etext\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSeveral methods can be performed on variables, including create, delete, get, list, testIamPermissions, update, and watch, allowing for managing and monitoring variable changes.\u003c/p\u003e\n"]]],[],null,["# REST Resource: projects.configs.variables\n\n- [Resource: Variable](#Variable)\n - [JSON representation](#Variable.SCHEMA_REPRESENTATION)\n- [VariableState](#VariableState)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Variable\n------------------\n\nDescribes a single variable within a RuntimeConfig resource. The name denotes the hierarchical variable name. For example, `ports/serving_port` is a valid variable name. The variable value is an opaque string and only leaf variables can have values (that is, variables that do not have any child variables).\n\nVariableState\n-------------\n\nThe `VariableState` describes the last known state of the variable and is used during a `variables().watch` call to distinguish the state of the variable."]]