1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-18 23:08:48 +00:00

gcloud: Wed Dec 6 10:10:36 UTC 2023

This commit is contained in:
Automated 2023-12-06 10:10:36 +00:00
parent d3074f94bb
commit f36750d203
469 changed files with 9617 additions and 1400 deletions

View file

@ -0,0 +1,124 @@
NAME
gcloud services api-keys create - create an API key
SYNOPSIS
gcloud services api-keys create [--annotations=[KEY=VALUE,...]] [--async]
[--display-name=DISPLAY_NAME] [--key-id=KEY_ID]
[--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 ...]
DESCRIPTION
Create an API key.
EXAMPLES
To create a key with display name and allowed ips specified:
$ 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 keys 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 following:
- --api-target:
service:
- "foo.service.com"
- --api-target:
service:
- "bar.service.com"
methods:
- "foomethod"
- "barmethod"
FLAGS
--annotations=[KEY=VALUE,...]
Annotations are key resource. Specify annotations as a key-value
dictionary for small amounts of arbitrary client data.
--async
Return immediately, without waiting for the operation in progress to
complete.
--display-name=DISPLAY_NAME
Display name of the key to create.
--key-id=KEY_ID
User-specified ID of the key to create.
--api-target=service=SERVICE,[...]
Repeatable. Specify service and optionally one or multiple specific
methods. Both fields are case insensitive. If you need to specify
methods, it should be specified with the --flags-file. See $ gcloud
topic flags-file for details. See the examples section for how to use
--api-target in --flags-file.
At most one of these can be specified:
--allowed-application=[sha1_fingerprint=SHA1_FINGERPRINT,package_name=PACKAGE_NAME,...]
Repeatable. Specify multiple allowed applications. The accepted keys
are sha1_fingerprint and package_name.
--allowed-bundle-ids=[ALLOWED_BUNDLE_IDS,...]
iOS app's bundle ids that are allowed to use the key.
--allowed-ips=[ALLOWED_IPS,...]
A list of the caller IP addresses that are allowed to make API calls
with this key.
--allowed-referrers=[ALLOWED_REFERRERS,...]
A list of regular expressions for the referrer URLs that are allowed
to make API calls with this key.
GCLOUD WIDE FLAGS
These flags are available to all commands: --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.
NOTES
These variants are also available:
$ gcloud alpha services api-keys create
$ gcloud beta services api-keys create

View file

@ -0,0 +1,70 @@
NAME
gcloud services api-keys delete - delete an API key
SYNOPSIS
gcloud services api-keys delete (KEY : --location=LOCATION) [--async]
[GCLOUD_WIDE_FLAG ...]
DESCRIPTION
Delete an API key.
EXAMPLES
Delete an API Key :
$ gcloud services api-keys delete \
projects/myproject/locations/global/keys/1234
$ gcloud services api-keys delete 1234
POSITIONAL ARGUMENTS
Key resource - The name of the key to delete. The arguments in this group
can be used to specify the attributes of this resource. (NOTE) Some
attributes are not given arguments in this group but can be set in other
ways.
To set the project attribute:
◆ provide the argument key on the command line with a fully specified
name;
◆ provide the argument --project on the command line;
◆ set the property core/project.
This must be specified.
KEY
ID of the key or fully qualified identifier for the key.
To set the key attribute:
▸ provide the argument key on the command line.
This positional argument must be specified if any of the other
arguments in this group are specified.
--location=LOCATION
Location of the key.
To set the location attribute:
▸ provide the argument key on the command line with a fully
specified name;
▸ provide the argument --location on the command line;
▸ location will default to global.
FLAGS
--async
Return immediately, without waiting for the operation in progress to
complete.
GCLOUD WIDE FLAGS
These flags are available to all commands: --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.
NOTES
These variants are also available:
$ gcloud alpha services api-keys delete
$ gcloud beta services api-keys delete

View file

@ -0,0 +1,68 @@
NAME
gcloud services api-keys get-key-string - get the key string of an API key
SYNOPSIS
gcloud services api-keys get-key-string (KEY : --location=LOCATION)
[GCLOUD_WIDE_FLAG ...]
DESCRIPTION
Get the key string of an API key
EXAMPLES
To get the key string of API key 1234, run:
$ gcloud services api-keys get-key-string 1234
To get the key string of API key 1234 in project myproject using the fully
qualified API key name, run:
$ gcloud services api-keys get-key-string \
projects/myproject/locations/global/keys/1234
POSITIONAL ARGUMENTS
Key resource - The name of the key to retrieve key string. The arguments
in this group can be used to specify the attributes of this resource.
(NOTE) Some attributes are not given arguments in this group but can be
set in other ways.
To set the project attribute:
◆ provide the argument key on the command line with a fully specified
name;
◆ provide the argument --project on the command line;
◆ set the property core/project.
This must be specified.
KEY
ID of the key or fully qualified identifier for the key.
To set the key attribute:
▸ provide the argument key on the command line.
This positional argument must be specified if any of the other
arguments in this group are specified.
--location=LOCATION
Location of the key.
To set the location attribute:
▸ provide the argument key on the command line with a fully
specified name;
▸ provide the argument --location on the command line;
▸ location will default to global.
GCLOUD WIDE FLAGS
These flags are available to all commands: --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.
NOTES
These variants are also available:
$ gcloud alpha services api-keys get-key-string
$ gcloud beta services api-keys get-key-string

View file

@ -15,15 +15,27 @@ GCLOUD WIDE FLAGS
COMMANDS
COMMAND is one of the following:
create
Create an API key.
delete
Delete an API key.
describe
Describe an API key's metadata.
get-key-string
Get the key string of an API key.
list
Lists API keys.
lookup
Look up resource name of a key string.
update
Update an API key's metadata.
NOTES
These variants are also available:

View file

@ -0,0 +1,168 @@
NAME
gcloud services api-keys update - update an API key's metadata
SYNOPSIS
gcloud services api-keys update (KEY : --location=LOCATION) [--async]
[--display-name=DISPLAY_NAME]
[--annotations=[KEY=VALUE,...] | --clear-annotations]
[--clear-restrictions | --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 ...]
DESCRIPTION
Update an API key's metadata.
EXAMPLES
To remove all restrictions of the key:
$ gcloud services api-keys update \
projects/myproject/keys/my-key-id --clear-restrictions
To update display name and set allowed ips as server key restrictions:
$ gcloud services api-keys update \
projects/myproject/keys/my-key-id --display-name="test name" \
--allowed-ips=2620:15c:2c4:203:2776:1f90:6b3b:217,104.133.8.78
To update annotations:
$ gcloud services api-keys update \
projects/myproject/keys/my-key-id --annotations=foo=bar,abc=def
To update key's allowed referrers restriction:
$ gcloud services api-keys update \
projects/myproject/keys/my-key-id \
--allowed-referrers="https://www.example.com/*,http://sub.exampl\
e.com/*"
To update key's allowed ios app bundle ids:
$ gcloud services api-keys update \
projects/myproject/keys/my-key-id --allowed-bundle-ids=my.app
To update key's allowed android application:
$ gcloud services api-keys update \
projects/myproject/keys/my-key-id \
--allowed-application=sha1_fingerprint=foo1,package_name=bar1 \
--allowed-application=sha1_fingerprint=foo2,package_name=bar2
To update keys' allowed api target with multiple services:
$ gcloud services api-keys update \
projects/myproject/keys/my-key-id \
--api-target=service=bar.service.com \
--api-target=service=foo.service.com
To update keys' allowed api target with service and method:
$ gcloud services api-keys update \
projects/myproject/keys/my-key-id --flags-file=my-flags.yaml
The content of 'my-flags.yaml' is as following:
- --api-target:
service: "foo.service.com"
- --api-target:
service: "bar.service.com"
methods:
- "foomethod"
- "barmethod"
POSITIONAL ARGUMENTS
Key resource - The name of the key to update. The arguments in this group
can be used to specify the attributes of this resource. (NOTE) Some
attributes are not given arguments in this group but can be set in other
ways.
To set the project attribute:
◆ provide the argument key on the command line with a fully specified
name;
◆ provide the argument --project on the command line;
◆ set the property core/project.
This must be specified.
KEY
ID of the key or fully qualified identifier for the key.
To set the key attribute:
▸ provide the argument key on the command line.
This positional argument must be specified if any of the other
arguments in this group are specified.
--location=LOCATION
Location of the key.
To set the location attribute:
▸ provide the argument key on the command line with a fully
specified name;
▸ provide the argument --location on the command line;
▸ location will default to global.
FLAGS
--async
Return immediately, without waiting for the operation in progress to
complete.
--display-name=DISPLAY_NAME
Display name of the key to update.
At most one of these can be specified:
--annotations=[KEY=VALUE,...]
Annotations are key resource. Specify annotations as a key-value
dictionary for small amounts of arbitrary client data.
--clear-annotations
If set, clear all annotations on the key.
At most one of these can be specified:
--clear-restrictions
If set, clear all restrictions on the key.
--api-target=service=SERVICE,[...]
Repeatable. Specify service and optionally one or multiple specific
methods. Both fields are case insensitive. If you need to specify
methods, it should be specified with the --flags-file. See $ gcloud
topic flags-file for details. See the examples section for how to use
--api-target in --flags-file.
At most one of these can be specified:
--allowed-application=[sha1_fingerprint=SHA1_FINGERPRINT,package_name=PACKAGE_NAME,...]
Repeatable. Specify multiple allowed applications. The accepted
keys are sha1_fingerprint and package_name.
--allowed-bundle-ids=[ALLOWED_BUNDLE_IDS,...]
iOS app's bundle ids that are allowed to use the key.
--allowed-ips=[ALLOWED_IPS,...]
A list of the caller IP addresses that are allowed to make API
calls with this key.
--allowed-referrers=[ALLOWED_REFERRERS,...]
A list of regular expressions for the referrer URLs that are
allowed to make API calls with this key.
GCLOUD WIDE FLAGS
These flags are available to all commands: --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.
NOTES
These variants are also available:
$ gcloud alpha services api-keys update
$ gcloud beta services api-keys update