1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-08 10:35:03 +00:00
gcloud-help/gcloud/monitoring/uptime/create

343 lines
11 KiB
Text
Raw Normal View History

2024-01-18 10:21:20 +00:00
NAME
gcloud monitoring uptime create - create a new uptime check or synthetic
monitor
SYNOPSIS
gcloud monitoring uptime create DISPLAY_NAME
(--synthetic-target=SYNTHETIC_TARGET
| [--group-id=GROUP_ID : --group-type=GROUP_TYPE]
| [--resource-labels=[KEY=VALUE,...]
: --resource-type=RESOURCE_TYPE])
[--body=BODY --content-type=CONTENT_TYPE
--custom-content-type=CUSTOM_CONTENT_TYPE --headers=[KEY=VALUE,...]
--mask-headers=MASK_HEADERS --password=PASSWORD --path=PATH
--pings-count=PINGS_COUNT --port=PORT --protocol=PROTOCOL
2024-05-01 09:26:55 +00:00
--request-method=REQUEST_METHOD
--service-agent-auth=SERVICE_AGENT_AUTH --username=USERNAME
2024-01-18 10:21:20 +00:00
--validate-ssl=VALIDATE_SSL --status-classes=[status-class,...]
| --status-codes=[status-code,...]]
[--matcher-content=MATCHER_CONTENT
: --matcher-type=MATCHER_TYPE [--json-path=JSON_PATH
: --json-path-matcher-type=JSON_PATH_MATCHER_TYPE]]
[--period=PERIOD --regions=[field,...]
--timeout=TIMEOUT --user-labels=[KEY=VALUE,...]]
[GCLOUD_WIDE_FLAG ...]
DESCRIPTION
Create a new uptime check or synthetic monitor.
Flags only apply to uptime checks unless noted that they apply to synthetic
monitors.
For information about the JSON/YAML format of an uptime check:
https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.uptimeCheckConfigs
EXAMPLES
To create an uptime check against a URL, run:
$ gcloud monitoring uptime create DISPLAY_NAME \
--resource-type=uptime-url \
--resource-labels=host=google.com,project_id=PROJECT_ID
To create a synthetic monitor, run:
$ gcloud monitoring uptime create SYNTHETIC_MONITOR_NAME \
--synthetic-target=projects/PROJECT_ID/locations/REGION/\
functions/FUNCTION_NAME
POSITIONAL ARGUMENTS
DISPLAY_NAME
Display name for the uptime check or synthetic monitor.
REQUIRED FLAGS
Uptime check resource.
Exactly one of these must be specified:
--synthetic-target=SYNTHETIC_TARGET
The target of the Synthetic Monitor. This is the fully qualified
GCFv2 resource name.
2026-02-11 11:28:25 +00:00
Or at least one of these can be specified:
Monitored resource group
2024-01-18 10:21:20 +00:00
--group-id=GROUP_ID
The group of resources being monitored.
This flag argument must be specified if any of the other arguments
in this group are specified.
--group-type=GROUP_TYPE
The resource type of the group members, defaults to gce-instance.
GROUP_TYPE must be one of:
aws-elb-load-balancer
Uptime check against a group of Amazon ELB load balancers.
gce-instance
Uptime check against a group of instances from Google Cloud or
Amazon Web Services.
2026-02-11 11:28:25 +00:00
Or at least one of these can be specified:
Monitored resource
2024-01-18 10:21:20 +00:00
--resource-labels=[KEY=VALUE,...]
Values for all of the labels listed in the associated monitored
resource descriptor. See
https://cloud.google.com/monitoring/api/resources for more
information and allowed keys.
This flag argument must be specified if any of the other arguments
in this group are specified.
--resource-type=RESOURCE_TYPE
Type of monitored resource, defaults to uptime-url. RESOURCE_TYPE
must be one of:
aws-ec2-instance
Uptime check against an AWS EC2 instance.
aws-elb-load-balancer
Uptime check against an ElasticLoadBalancer.
cloud-run-revision
Uptime check against a Cloud Run revision.
gae-app
Uptime check against an App Engine module.
gce-instance
Uptime check against a Compute Engine instance.
servicedirectory-service
Uptime check against a Service Directory service.
uptime-url
Uptime check against a URL.
OPTIONAL FLAGS
Uptime check protocol settings.
2026-02-11 11:28:25 +00:00
--body=BODY
The request body associated with the HTTP POST request. Can only be set
if --protocol is http or https.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--content-type=CONTENT_TYPE
The content type header to use for the check, defaults to unspecified.
Can only be set if --protocol is http or https.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
CONTENT_TYPE must be one of:
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
unspecified
Not specified
url-encoded
URL encoded
user-provided
User provided
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--custom-content-type=CUSTOM_CONTENT_TYPE
A user-provided content type header to use for the check. Can only be
set if --protocol is http or https.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--headers=[KEY=VALUE,...]
The list of headers to send as part of the uptime check request. Can
only be set if --protocol is http or https.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--mask-headers=MASK_HEADERS
Whether to encrypt the header information, defaults to false. Can only
be set if --protocol is http or https.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--password=PASSWORD
The password to use when authenticating with the HTTP server. Can only
be set if --protocol is http or https.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--path=PATH
The path to the page against which to run the check, defaults to /. Can
only be set if --protocol is http or https.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--pings-count=PINGS_COUNT
Number of ICMP pings to send alongside the request.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--port=PORT
The port on the server against which to run the check. Defaults to 80
when --protocol is http. Defaults to 443 when --protocol is https.
Required if --protocol is tcp.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--protocol=PROTOCOL
The protocol of the request, defaults to http. PROTOCOL must be one of:
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
http
An HTTP check.
https
An HTTPS check.
tcp
A TCP check.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--request-method=REQUEST_METHOD
The HTTP request method to use, defaults to get. Can only be set if
--protocol is http or https.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
REQUEST_METHOD must be one of:
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
get
HTTP GET method
post
HTTP POST method
2024-05-01 09:26:55 +00:00
2026-02-11 11:28:25 +00:00
Uptime check service agent authorization.
2024-05-01 09:26:55 +00:00
2026-02-11 11:28:25 +00:00
--service-agent-auth=SERVICE_AGENT_AUTH
The type of authentication to use for the HTTP request. Can only be set
if --protocol is https.
2024-05-01 09:26:55 +00:00
2026-02-11 11:28:25 +00:00
SERVICE_AGENT_AUTH must be (only one value is supported):
2024-05-01 09:26:55 +00:00
2026-02-11 11:28:25 +00:00
oidc-token
OIDC Token authentication
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--username=USERNAME
The username to use when authenticating with the HTTP server. Can only
be set if --protocol is http or https.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--validate-ssl=VALIDATE_SSL
Whether to include SSL certificate validation as a part of the uptime
check, defaults to false. Can only be set if --protocol is http or
https.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
Uptime check status.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
At most one of these can be specified:
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--status-classes=[status-class,...]
List of HTTP status classes. The uptime check only passes when the
response code is contained in this list. Defaults to 2xx. Can only be
set if --protocol is http or https.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
status-class must be one of:
1xx
Any response code from 100-199 inclusive
2xx
Any response code from 200-299 inclusive
3xx
Any response code from 300-399 inclusive
4xx
Any response code from 400-499 inclusive
5xx
Any response code from 500-599 inclusive
any
Any response code
--status-codes=[status-code,...]
List of HTTP Status Codes. The uptime check will only pass if the
response code is present in this list. Can only be set if --protocol
is http or https.
2024-01-18 10:21:20 +00:00
Uptime check matcher settings.
2026-02-11 11:28:25 +00:00
--matcher-content=MATCHER_CONTENT
String, regex or JSON content to match.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--matcher-type=MATCHER_TYPE
The type of content matcher that is applied to the server output,
defaults to contains-string.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
MATCHER_TYPE must be one of:
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
contains-string
Response contains string
matches-json-path
Response matches at JSONPath
matches-regex
Response matches regex
not-contains-string
Response does not contain string
not-matches-json-path
Response does not match at JSONPath
not-matches-regex
Response does not match regex
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
Uptime check matcher settings for JSON responses.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--json-path=JSON_PATH
JSONPath within the response output pointing to the expected content to
match. Only used if --matcher-type is matches-json-path or
not-matches-json-path.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
--json-path-matcher-type=JSON_PATH_MATCHER_TYPE
The type of JSONPath match that is applied to the JSON output, defaults
to exact-match. Only used if --matcher-type is matches-json-path or
not-matches-json-path.
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
JSON_PATH_MATCHER_TYPE must be one of:
2024-01-18 10:21:20 +00:00
2026-02-11 11:28:25 +00:00
exact-match
Response matches exact string at JSONPath
regex-match
Response matches regex at JSONPath
2024-01-18 10:21:20 +00:00
Settings.
2026-02-11 11:28:25 +00:00
--period=PERIOD
The time between uptime check or synthetic monitor executions in
minutes, defaults to 1. Can be set for synthetic monitors.
PERIOD must be one of:
1
One minute
10
Ten minutes
15
Fifteen minutes
5
Five minutes
--regions=[field,...]
The list of regions from which the check is run. At least 3 regions
must be selected. Defaults to all available regions.
field must be one of:
asia-pacific
asia-southeast1
europe
europe-west1
south-america
southamerica-east1
usa-iowa
us-central1
usa-oregon
us-west1
usa-virginia
us-east4
--timeout=TIMEOUT
The maximum amount of time in seconds to wait for the request to
complete, defaults to 60. Can be set for synthetic monitors.
--user-labels=[KEY=VALUE,...]
List of label KEY=VALUE pairs to add.
Keys must start with a lowercase character and contain only hyphens
(-), underscores (_), lowercase characters, and numbers. Values must
contain only hyphens (-), underscores (_), lowercase characters, and
numbers.
2024-01-18 10:21:20 +00:00
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 monitoring uptime create
$ gcloud beta monitoring uptime create