Class: Aws::Synthetics::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Synthetics::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb
Overview
An API client for Synthetics. To construct a client, you need to configure a :region
and :credentials
.
client = Aws::Synthetics::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the developer guide.
See #initialize for a full list of supported configuration options.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
API Operations collapse
-
#create_canary(params = {}) ⇒ Types::CreateCanaryResponse
Creates a canary.
-
#delete_canary(params = {}) ⇒ Struct
Permanently deletes the specified canary.
-
#describe_canaries(params = {}) ⇒ Types::DescribeCanariesResponse
This operation returns a list of the canaries in your account, along with full details about each canary.
-
#describe_canaries_last_run(params = {}) ⇒ Types::DescribeCanariesLastRunResponse
Use this operation to see information from the most recent run of each canary that you have created.
-
#describe_runtime_versions(params = {}) ⇒ Types::DescribeRuntimeVersionsResponse
Returns a list of Synthetics canary runtime versions.
-
#get_canary(params = {}) ⇒ Types::GetCanaryResponse
Retrieves complete information about one canary.
-
#get_canary_runs(params = {}) ⇒ Types::GetCanaryRunsResponse
Retrieves a list of runs for a specified canary.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Displays the tags associated with a canary.
-
#start_canary(params = {}) ⇒ Struct
Use this operation to run a canary that has already been created.
-
#stop_canary(params = {}) ⇒ Struct
Stops the canary to prevent all future runs.
-
#tag_resource(params = {}) ⇒ Struct
Assigns one or more tags (key-value pairs) to the specified canary.
-
#untag_resource(params = {}) ⇒ Struct
Removes one or more tags from the specified canary.
-
#update_canary(params = {}) ⇒ Struct
Use this operation to change the settings of a canary that has already been created.
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
Methods included from ClientStubs
#api_requests, #stub_data, #stub_responses
Methods inherited from Seahorse::Client::Base
add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
348 349 350 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 348 def initialize(*args) super end |
Instance Method Details
#create_canary(params = {}) ⇒ Types::CreateCanaryResponse
Creates a canary. Canaries are scripts that monitor your endpoints and APIs from the outside-in. Canaries help you check the availability and latency of your web services and troubleshoot anomalies by investigating load time data, screenshots of the UI, logs, and metrics. You can set up a canary to run continuously or just once.
Do not use CreateCanary
to modify an existing canary. Use
UpdateCanary instead.
To create canaries, you must have the CloudWatchSyntheticsFullAccess
policy. If you are creating a new IAM role for the canary, you also
need the the iam:CreateRole
, iam:CreatePolicy
and
iam:AttachRolePolicy
permissions. For more information, see
Necessary Roles and Permissions.
Do not include secrets or proprietary information in your canary names. The canary name makes up part of the Amazon Resource Name (ARN) for the canary, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries.
563 564 565 566 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 563 def create_canary(params = {}, = {}) req = build_request(:create_canary, params) req.send_request() end |
#delete_canary(params = {}) ⇒ Struct
Permanently deletes the specified canary.
If you specify DeleteLambda
to true
, CloudWatch Synthetics also
deletes the Lambda functions and layers that are used by the canary.
Other esources used and created by the canary are not automatically deleted. After you delete a canary that you do not intend to use again, you should also delete the following:
The CloudWatch alarms created for this canary. These alarms have a name of
Synthetics-SharpDrop-Alarm-MyCanaryName
.Amazon S3 objects and buckets, such as the canary's artifact location.
IAM roles created for the canary. If they were created in the console, these roles have the name
role/service-role/CloudWatchSyntheticsRole-MyCanaryName
.CloudWatch Logs log groups created for the canary. These logs groups have the name
/aws/lambda/cwsyn-MyCanaryName
.
Before you delete a canary, you might want to use GetCanary
to
display the information about this canary. Make note of the
information returned by this operation so that you can delete these
resources after you delete the canary.
622 623 624 625 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 622 def delete_canary(params = {}, = {}) req = build_request(:delete_canary, params) req.send_request() end |
#describe_canaries(params = {}) ⇒ Types::DescribeCanariesResponse
This operation returns a list of the canaries in your account, along with full details about each canary.
This operation supports resource-level authorization using an IAM
policy and the Names
parameter. If you specify the Names
parameter, the operation is successful only if you have authorization
to view all the canaries that you specify in your request. If you do
not have permission to view any of the canaries, the request fails
with a 403 response.
You are required to use the Names
parameter if you are logged on to
a user or role that has an IAM policy that restricts which canaries
that you are allowed to view. For more information, see Limiting a
user to viewing specific canaries.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
734 735 736 737 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 734 def describe_canaries(params = {}, = {}) req = build_request(:describe_canaries, params) req.send_request() end |
#describe_canaries_last_run(params = {}) ⇒ Types::DescribeCanariesLastRunResponse
Use this operation to see information from the most recent run of each canary that you have created.
This operation supports resource-level authorization using an IAM
policy and the Names
parameter. If you specify the Names
parameter, the operation is successful only if you have authorization
to view all the canaries that you specify in your request. If you do
not have permission to view any of the canaries, the request fails
with a 403 response.
You are required to use the Names
parameter if you are logged on to
a user or role that has an IAM policy that restricts which canaries
that you are allowed to view. For more information, see Limiting a
user to viewing specific canaries.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
819 820 821 822 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 819 def describe_canaries_last_run(params = {}, = {}) req = build_request(:describe_canaries_last_run, params) req.send_request() end |
#describe_runtime_versions(params = {}) ⇒ Types::DescribeRuntimeVersionsResponse
Returns a list of Synthetics canary runtime versions. For more information, see Canary Runtime Versions.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
868 869 870 871 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 868 def describe_runtime_versions(params = {}, = {}) req = build_request(:describe_runtime_versions, params) req.send_request() end |
#get_canary(params = {}) ⇒ Types::GetCanaryResponse
Retrieves complete information about one canary. You must specify the name of the canary that you want. To get a list of canaries and their names, use DescribeCanaries.
937 938 939 940 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 937 def get_canary(params = {}, = {}) req = build_request(:get_canary, params) req.send_request() end |
#get_canary_runs(params = {}) ⇒ Types::GetCanaryRunsResponse
Retrieves a list of runs for a specified canary.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
989 990 991 992 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 989 def get_canary_runs(params = {}, = {}) req = build_request(:get_canary_runs, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Displays the tags associated with a canary.
1021 1022 1023 1024 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 1021 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#start_canary(params = {}) ⇒ Struct
Use this operation to run a canary that has already been created. The
frequency of the canary runs is determined by the value of the
canary's Schedule
. To see a canary's schedule, use GetCanary.
1054 1055 1056 1057 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 1054 def start_canary(params = {}, = {}) req = build_request(:start_canary, params) req.send_request() end |
#stop_canary(params = {}) ⇒ Struct
Stops the canary to prevent all future runs. If the canary is currently running, Synthetics stops waiting for the current run of the specified canary to complete. The run that is in progress completes on its own, publishes metrics, and uploads artifacts, but it is not recorded in Synthetics as a completed run.
You can use StartCanary
to start it running again with the canary’s
current schedule at any point in the future.
1088 1089 1090 1091 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 1088 def stop_canary(params = {}, = {}) req = build_request(:stop_canary, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Assigns one or more tags (key-value pairs) to the specified canary.
Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with certain tag values.
Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.
You can use the TagResource
action with a canary that already has
tags. If you specify a new tag key for the alarm, this tag is appended
to the list of tags associated with the alarm. If you specify a tag
key that is already associated with the alarm, the new tag value that
you specify replaces the previous value for that tag.
You can associate as many as 50 tags with a canary.
1134 1135 1136 1137 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 1134 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes one or more tags from the specified canary.
1163 1164 1165 1166 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 1163 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_canary(params = {}) ⇒ Struct
Use this operation to change the settings of a canary that has already been created.
You can't use this operation to update the tags of an existing canary. To change the tags of an existing canary, use TagResource.
1327 1328 1329 1330 |
# File 'gems/aws-sdk-synthetics/lib/aws-sdk-synthetics/client.rb', line 1327 def update_canary(params = {}, = {}) req = build_request(:update_canary, params) req.send_request() end |