Erstellt eine Variable innerhalb der angegebenen Konfiguration. Sie können keine Variable mit einem Namen, der ein Präfix eines bestehenden Variablennamens ist, oder einem Namen, der einen bestehenden Variablennamen als Präfix hat, erstellen.
Der Pfad zu der RuntimeConfig-Ressource, zu der die Variable gehören sollte. Die Konfiguration muss bereits vorhanden sein. Der Pfad muss das folgende Format haben:
projects/[PROJECT_ID]/configs/[CONFIG_NAME]
Zur Autorisierung ist die folgende Google IAM-Berechtigung für die angegebene Ressource parent erforderlich:
runtimeconfig.variables.create
Abfrageparameter
Parameter
requestId
string
Optional, aber empfohlen: Ein eindeutiger Wert für requestId. Wenn der Server zwei create()-Anfragen mit demselben requestId empfängt, wird die zweite Anfrage ignoriert und die erste im Back-End erstellte und gespeicherte Ressource zurückgegeben. Leere requestId-Felder werden ignoriert.
Der Kunde ist dafür verantwortlich, dass die requestId-Strings eindeutig sind.
requestId-Strings sind auf 64 Zeichen beschränkt.
Anfragetext
Der Anfragetext enthält eine Instanz von Variable.
Antworttext
Bei Erfolg enthält der Antworttext eine neu erstellte 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 documentation describes how to create a variable within a given configuration using a \u003ccode\u003ePOST\u003c/code\u003e request to the specified URL.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires a \u003ccode\u003eparent\u003c/code\u003e path parameter, which is the path to the RuntimeConfig resource in the format \u003ccode\u003eprojects/[PROJECT_ID]/configs/[CONFIG_NAME]\u003c/code\u003e, and the \u003ccode\u003eruntimeconfig.variables.create\u003c/code\u003e IAM permission.\u003c/p\u003e\n"],["\u003cp\u003eAn optional but recommended \u003ccode\u003erequestId\u003c/code\u003e query parameter can be used to ensure request idempotency, with a limit of 64 characters.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must include an instance of the \u003ccode\u003eVariable\u003c/code\u003e resource, and a successful response will return the newly created \u003ccode\u003eVariable\u003c/code\u003e instance.\u003c/p\u003e\n"],["\u003cp\u003eOne of the specified OAuth scopes, \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloudruntimeconfig\u003c/code\u003e, is required for authorization.\u003c/p\u003e\n"]]],[],null,["# Method: projects.configs.variables.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization Scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a variable within the given configuration. You cannot create a variable with a name that is a prefix of an existing variable name, or a name that has an existing variable name as a prefix.\n\nTo learn more about creating a variable, read the [Setting and Getting Data](/deployment-manager/runtime-configurator/set-and-get-variables) documentation.\n\n### HTTP request\n\n`POST https://runtimeconfig.googleapis.com/v1beta1/{parent=projects/*/configs/*}/variables`\n\nThe URL uses [gRPC Transcoding](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto) syntax.\n\n### Path parameters\n\n### Query parameters\n\n### Request body\n\nThe request body contains an instance of [Variable](/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables#Variable).\n\n### Response body\n\nIf successful, the response body contains a newly created 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-------"]]