File: //snap/google-cloud-cli/396/help/man/man1/gcloud_policy-intelligence_query-activity.1
.TH "GCLOUD_POLICY\-INTELLIGENCE_QUERY\-ACTIVITY" 1
.SH "NAME"
.HP
gcloud policy\-intelligence query\-activity \- query activities on cloud resource
.SH "SYNOPSIS"
.HP
\f5gcloud policy\-intelligence query\-activity\fR \fB\-\-activity\-type\fR=\fIACTIVITY_TYPE\fR \fB\-\-project\fR=\fIPROJECT\fR [\fB\-\-limit\fR=\fILIMIT\fR;\ default=1000] [\fB\-\-page\-size\fR=\fIPAGE_SIZE\fR;\ default=500] [\fB\-\-query\-filter\fR=\fIQUERY_FILTER\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
Query activities with certain types of specific container resource. For
\-\-activity\-type, supported values are:
.RS 2m
.IP "\(bu" 2m
serviceAccountLastAuthentication
.IP "\(bu" 2m
serviceAccountKeyLastAuthentication
.RE
.sp
.SH "EXAMPLES"
To query serviceAccountKeyLastAuthentication activities of a project, run:
.RS 2m
$ gcloud policy\-intelligence query\-activity \e
\-\-activity\-type=serviceAccountKeyLastAuthentication \e
\-\-project=project\-id
.RE
To query serviceAccountLastAuthentication activities of a project with no limit,
run:
.RS 2m
$ gcloud policy\-intelligence query\-activity \e
\-\-activity\-type=serviceAccountLastAuthentication \e
\-\-project=project\-id \-\-limit=unlimited
.RE
To query serviceAccountLastAuthentication with filtering on certain service
account, run:
.RS 2m
$ gcloud policy\-intelligence query\-activity \e
\-\-activity\-type=serviceAccountLastAuthentication \e
\-\-project=project\-id \e
\-\-query\-filter='activities.full_resource_name="//iam.googleapis.\e
com/projects/project\-id/serviceAccounts/service\-account\-name@project\e
\-id.iam.gserviceaccount.com"'
.RE
To query serviceAccountLastAuthentication with filtering on multiple service
accounts, run:
.RS 2m
$ gcloud policy\-intelligence query\-activity \e
\-\-activity\-type=serviceAccountLastAuthentication \e
\-\-project=project\-id \e
\-\-query\-filter='activities.full_resource_name="//iam.googleapis.\e
com/projects/project\-id/serviceAccounts/service\-account\-name\-1@proje\e
ct\-id.iam.gserviceaccount.com" OR
activities.full_resource_name="//iam.googleapis.com/projects/projec\e
t\-id/serviceAccounts/service\-account\-name\-2@project\-id.iam.gservicea\e
ccount.com" OR
activities.full_resource_name="//iam.googleapis.com/projects/projec\e
t\-id/serviceAccounts/service\-account\-name\-3@project\-id.iam.gservicea\e
ccount.com"'
.RE
.SH "REQUIRED FLAGS"
.RS 2m
.TP 2m
\fB\-\-activity\-type\fR=\fIACTIVITY_TYPE\fR
Type of the activities. \fIACTIVITY_TYPE\fR must be one of:
\fBserviceAccountLastAuthentication\fR,
\fBserviceAccountKeyLastAuthentication\fR.
.TP 2m
\fB\-\-project\fR=\fIPROJECT\fR
The project ID or number to query the activities.
.RE
.sp
.SH "OPTIONAL FLAGS"
.RS 2m
.TP 2m
\fB\-\-limit\fR=\fILIMIT\fR; default=1000
Max number of query result. Default to be 1000 and max to be unlimited, i.e.,
\-\-limit=unlimited.
.TP 2m
\fB\-\-page\-size\fR=\fIPAGE_SIZE\fR; default=500
Max page size for each http response. Default to be 500 and max to be 1000.
.TP 2m
\fB\-\-query\-filter\fR=\fIQUERY_FILTER\fR
Filter on activities, separated by "OR" if multiple filters are specified. At
most 10 filter restrictions are supported in the query\-filter. e.g.
\-\-query\-filter='activities.full_resource_name="//iam.googleapis.com/projects/project\-id/serviceAccounts/service\-account\-name\-1@project\-id.iam.gserviceaccount.com"
OR
activities.full_resource_name="//iam.googleapis.com/projects/project\-id/serviceAccounts/service\-account\-name\-2@project\-id.iam.gserviceaccount.com"'
.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.