Descreve uma única variável em um recurso RuntimeConfig. O nome representa a variável hierárquica. Por exemplo, ports/serving_port é um nome de variável válido. O valor da variável é uma string opaca, e somente variáveis de folha podem ter valores (ou seja, variáveis que não têm filhos).
Representação JSON
{"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.}
O [PROJECT_ID] precisa ser um ID de projeto válido, o [CONFIG_NAME] precisa ser um recurso RuntimeConfig válido e o [VARIABLE_NAME] precisa seguir a nomenclatura de caminho de arquivo do sistema de arquivos Unix.
[VARIABLE_NAME] pode ter letras ASCII, números, barras e traços. As barras são usadas como separadores de elementos de caminho e não fazem parte do [VARIABLE_NAME]. Portanto, [VARIABLE_NAME] precisa conter pelo menos um caractere que não seja uma barra. Várias barras são unidas em um caractere de barra única. Cada segmento do caminho precisa corresponder à expressão regular 0-9A-Za-z?. O comprimento de um [VARIABLE_NAME] precisa ser menor que 256 caracteres.
Após criar uma variável, você não poderá alterar o nome dela.
Apenas saída. O estado atual da variável. O estado da variável indica o resultado da chamada variables().watch e fica visível nas chamadas get e list.
Campo de união contents. O valor da variável. Ele pode ser binário ou string. É preciso especificar value ou text. Especificar os dois fará com que o servidor retorne um erro. contents pode ser apenas um dos seguintes:
O valor binário da variável. O comprimento dele precisa ser inferior a 4096 bytes. Valores vazios também são aceitos. O valor precisa ser codificado em base64 e estar em conformidade com o IETF RFC4648 (https://www.ietf.org/rfc/rfc4648.txt). Apenas uma das opções value ou text pode ser definida.
Uma string codificada em base64.
text
string
O valor da string da variável. O comprimento dele precisa ser inferior a 4096 bytes. Valores vazios também são aceitos. Por exemplo, text: "my text value" A string precisa ser UTF-8 válido.
VariableState
O VariableState descreve o último estado conhecido da variável e é usado durante uma chamada variables().watch para distinguir o estado da variável.
Enums
VARIABLE_STATE_UNSPECIFIED
Estado padrão da variável.
UPDATED
A variável foi atualizada enquanto variables().watch estava sendo executada.
DELETED
A variável foi excluída enquanto variables().watch estava sendo executada.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-03-04 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."]]