Membuat variabel dalam konfigurasi yang diberikan. Anda tidak dapat membuat variabel dengan nama yang merupakan awalan dari nama variabel yang ada, atau nama yang memiliki nama variabel yang ada sebagai awalan.
Jalur ke resource RuntimeConfig yang harus dimiliki variabel ini. Konfigurasi harus ada sebelumnya; jalurnya harus dalam format:
projects/[PROJECT_ID]/configs/[CONFIG_NAME]
Otorisasi memerlukan izin Google IAM berikut di resource parent yang ditentukan:
runtimeconfig.variables.create
Parameter kueri
Parameter
requestId
string
requestId unik yang bersifat opsional, tetapi direkomendasikan. Jika server menerima dua permintaan create() dengan requestId yang sama, permintaan kedua akan diabaikan dan resource pertama yang dibuat dan disimpan di backend akan ditampilkan. Kolom requestId kosong akan diabaikan.
Klien bertanggung jawab untuk memastikan keunikan string requestId.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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-------"]]