Stay organized with collections Save and categorize content based on your preferences.
gcloud services api-keys create
[--annotations
=[KEY
=VALUE
,…]] [--async
] [--display-name
=DISPLAY_NAME
] [--key-id
=KEY_ID
] [--service-account
=SERVICE_ACCOUNT
] [--api-target
=service
=SERVICE
,[…] --allowed-application
=[sha1_fingerprint
=SHA1_FINGERPRINT
,package_name
=PACKAGE_NAME
,…] | --allowed-bundle-ids
=[ALLOWED_BUNDLE_IDS
,…] | --allowed-ips
=[ALLOWED_IPS
,…] | --allowed-referrers
=[ALLOWED_REFERRERS
,…]] [GCLOUD_WIDE_FLAG …
]
gcloud services api-keys create --display-name="test name" --allowed-ips=2620:15c:2c4:203:2776:1f90:6b3b:217,104.133.8.78
To create a key with annotations:
gcloud services api-keys create --annotations=foo=bar,abc=def
To create a key with user-specified key ID:
gcloud services api-keys create --key-id="my-key-id"
To create a key with allowed referrers restriction:
gcloud services api-keys create --allowed-referrers="https://www.example.com/*,http://sub.exampl\
e.com/*"
To create a key with allowed IOS app bundle IDs:
gcloud services api-keys create --allowed-bundle-ids=my.app
To create a key with allowed Android application:
gcloud services api-keys create --allowed-application=sha1_fingerprint=foo1,package_name=bar.foo --allowed-application=sha1_fingerprint=foo2,package_name=foo.bar
To create a key with allowed API targets (service name only):
gcloud services api-keys create --api-target=service=bar.service.com --api-target=service=foo.service.com
To create a key with service account:
gcloud services api-keys create --service-account=my-service-account
To create a key with allowed API targets (service and methods are specified):
gcloud services api-keys create --flags-file=my-flags.yaml
The content of 'my-flags.yaml' is as follows:
- --api-target: service: "foo.service.com" - --api-target: service: "bar.service.com" methods: - "foomethod" - "barmethod"
--annotations
=[KEY
=VALUE
,…]
--async
--display-name
=DISPLAY_NAME
--key-id
=KEY_ID
--service-account
=SERVICE_ACCOUNT
--api-target
=service
=SERVICE
,[…]
--flags-file
. See $ gcloud topic flags-file for details. See the examples section for how to use --api-target
in --flags-file
.
--allowed-application
=[sha1_fingerprint
=SHA1_FINGERPRINT
,package_name
=PACKAGE_NAME
,…]
sha1_fingerprint
and package_name
.
--allowed-bundle-ids
=[ALLOWED_BUNDLE_IDS
,…]
--allowed-ips
=[ALLOWED_IPS
,…]
--allowed-referrers
=[ALLOWED_REFERRERS
,…]
--access-token-file
, --account
, --billing-project
, --configuration
, --flags-file
, --flatten
, --format
, --help
, --impersonate-service-account
, --log-http
, --project
, --quiet
, --trace-token
, --user-output-enabled
, --verbosity
.
Run $ gcloud help
for details.
gcloud alpha services api-keys create
gcloud beta services api-keys create
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-22 UTC.
[[["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-07-22 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4