Method: projects.settings.value.create
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
建立設定值。
如果設定不存在,會傳回 google.rpc.Code.NOT_FOUND
的 google.rpc.Status
。如果指定的 Cloud 資源上已經有設定值,則傳回包含 google.rpc.Code.ALREADY_EXISTS
的 google.rpc.Status
。如果設定標記為唯讀,會傳回含有 google.rpc.Code.FAILED_PRECONDITION
的 google.rpc.Status
。
HTTP 要求
POST https://resourcesettings.googleapis.com/v1alpha1/{settingValue.name=projects/*/settings/*/value}
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
settingValue.name |
string
設定值的資源名稱。必須採用下列其中一種格式:
projects/{project_number}/settings/{setting_name}/value
folders/{folder_id}/settings/{setting_name}/value
organizations/{organization_id}/settings/{setting_name}/value
例如:「/projects/123/settings/gcp-enableMyFeature/value」
|
要求主體
要求主體包含 SettingValue
的例項。
回應主體
如果成功,回應主體會包含新建立的 SettingValue
例項。
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/cloud-platform
詳情請參閱驗證總覽。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2023-05-25 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2023-05-25 (世界標準時間)。"],[[["Creates a new setting value for a specific Cloud resource, identified by its name."],["Returns errors if the setting doesn't exist, the value already exists, or the setting is read-only."],["Requires providing the `SettingValue` object in the request body, specifying the desired value."],["Uses the `cloud-platform` OAuth scope for authorization."],["Provides links for gRPC Transcoding, SettingValue definition, and Authentication Overview for additional context."]]],["This outlines creating a setting value via a POST request to a specified URL. The request requires a `settingValue.name` path parameter, formatted according to project, folder, or organization. The request body contains a `SettingValue` instance, and a successful response returns a new `SettingValue` instance. Potential errors include `NOT_FOUND` (setting doesn't exist), `ALREADY_EXISTS`, or `FAILED_PRECONDITION` (read-only setting). The operation requires the `cloud-platform` OAuth scope.\n"]]