File: //snap/google-cloud-cli/396/help/man/man1/gcloud_alpha_services_api-keys_update.1
.TH "GCLOUD_ALPHA_SERVICES_API\-KEYS_UPDATE" 1
.SH "NAME"
.HP
gcloud alpha services api\-keys update \- update an API key's metadata
.SH "SYNOPSIS"
.HP
\f5gcloud alpha services api\-keys update\fR (\fIKEY\fR\ :\ \fB\-\-location\fR=\fILOCATION\fR) [\fB\-\-async\fR] [\fB\-\-display\-name\fR=\fIDISPLAY_NAME\fR] [\fB\-\-annotations\fR=[\fIKEY\fR=\fIVALUE\fR,...]\ |\ \fB\-\-clear\-annotations\fR] [\fB\-\-clear\-restrictions\fR\ |\ \fB\-\-api\-target\fR=\fIservice\fR=\fISERVICE\fR,[...]\ \fB\-\-allowed\-application\fR=[\fIsha1_fingerprint\fR=\fISHA1_FINGERPRINT\fR,\fIpackage_name\fR=\fIPACKAGE_NAME\fR,...]\ |\ \fB\-\-allowed\-bundle\-ids\fR=[\fIALLOWED_BUNDLE_IDS\fR,...]\ |\ \fB\-\-allowed\-ips\fR=[\fIALLOWED_IPS\fR,...]\ |\ \fB\-\-allowed\-referrers\fR=[\fIALLOWED_REFERRERS\fR,...]] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR Update an API key's metadata.
.SH "EXAMPLES"
To remove all restrictions of the key:
.RS 2m
$ gcloud alpha services api\-keys update \e
projects/myproject/keys/my\-key\-id \-\-clear\-restrictions
.RE
To update display name and set allowed ips as server key restrictions:
.RS 2m
$ gcloud alpha services api\-keys update \e
projects/myproject/keys/my\-key\-id \-\-display\-name="test name" \e
\-\-allowed\-ips=2620:15c:2c4:203:2776:1f90:6b3b:217,104.133.8.78
.RE
To update annotations:
.RS 2m
$ gcloud alpha services api\-keys update \e
projects/myproject/keys/my\-key\-id \-\-annotations=foo=bar,abc=def
.RE
To update key's allowed referrers restriction:
.RS 2m
$ gcloud alpha services api\-keys update \e
projects/myproject/keys/my\-key\-id \e
\-\-allowed\-referrers="https://www.example.com/*,http://sub.exampl\e
e.com/*"
.RE
To update key's allowed ios app bundle ids:
.RS 2m
$ gcloud alpha services api\-keys update \e
projects/myproject/keys/my\-key\-id \-\-allowed\-bundle\-ids=my.app
.RE
To update key's allowed android application:
.RS 2m
$ gcloud alpha services api\-keys update \e
projects/myproject/keys/my\-key\-id \e
\-\-allowed\-application=sha1_fingerprint=foo1,package_name=bar1 \e
\-\-allowed\-application=sha1_fingerprint=foo2,package_name=bar2
.RE
To update keys' allowed api target with multiple services:
.RS 2m
$ gcloud alpha services api\-keys update \e
projects/myproject/keys/my\-key\-id \e
\-\-api\-target=service=bar.service.com \e
\-\-api\-target=service=foo.service.com
.RE
To update keys' allowed api target with service and method:
.RS 2m
$ gcloud alpha services api\-keys update \e
projects/myproject/keys/my\-key\-id \-\-flags\-file=my\-flags.yaml
.RE
.RS 2m
The content of 'my\-flags.yaml' is as following:
.RE
.RS 2m
\- \-\-api\-target:
service: "foo.service.com"
\- \-\-api\-target:
service: "bar.service.com"
methods:
\- "foomethod"
\- "barmethod"
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
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 \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5key\fR on the command line with a fully specified name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
This must be specified.
.RS 2m
.TP 2m
\fIKEY\fR
ID of the key or fully qualified identifier for the key.
To set the \f5key\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5key\fR on the command line.
.RE
.sp
This positional argument must be specified if any of the other arguments in this
group are specified.
.TP 2m
\fB\-\-location\fR=\fILOCATION\fR
Location of the key.
To set the \f5location\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5key\fR on the command line with a fully specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-location\fR on the command line;
.IP "\(bu" 2m
location will default to global.
.RE
.sp
.RE
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-async\fR
Return immediately, without waiting for the operation in progress to complete.
.TP 2m
\fB\-\-display\-name\fR=\fIDISPLAY_NAME\fR
Display name of the key to update.
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-annotations\fR=[\fIKEY\fR=\fIVALUE\fR,...]
Annotations are key resource. Specify annotations as a key\-value dictionary for
small amounts of arbitrary client data.
.TP 2m
\fB\-\-clear\-annotations\fR
If set, clear all annotations on the key.
.RE
.sp
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-clear\-restrictions\fR
If set, clear all restrictions on the key.
.TP 2m
\fB\-\-api\-target\fR=\fIservice\fR=\fISERVICE\fR,[...]
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 \f5\-\-flags\-file\fR. See $ gcloud topic flags\-file for
details. See the examples section for how to use \f5\-\-api\-target\fR in
\f5\-\-flags\-file\fR.
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-allowed\-application\fR=[\fIsha1_fingerprint\fR=\fISHA1_FINGERPRINT\fR,\fIpackage_name\fR=\fIPACKAGE_NAME\fR,...]
Repeatable. Specify multiple allowed applications. The accepted keys are
\f5sha1_fingerprint\fR and \f5package_name\fR.
.TP 2m
\fB\-\-allowed\-bundle\-ids\fR=[\fIALLOWED_BUNDLE_IDS\fR,...]
iOS app's bundle ids that are allowed to use the key.
.TP 2m
\fB\-\-allowed\-ips\fR=[\fIALLOWED_IPS\fR,...]
A list of the caller IP addresses that are allowed to make API calls with this
key.
.TP 2m
\fB\-\-allowed\-referrers\fR=[\fIALLOWED_REFERRERS\fR,...]
A list of regular expressions for the referrer URLs that are allowed to make API
calls with this key.
.RE
.RE
.RE
.sp
.SH "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 \fB$ gcloud help\fR for details.
.SH "NOTES"
This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. These variants are also available:
.RS 2m
$ gcloud services api\-keys update
.RE
.RS 2m
$ gcloud beta services api\-keys update
.RE