Class: Aws::Synthetics::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Synthetics::Client
- Includes:
- ClientStubs
- Defined in:
- 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](/sdk-for-ruby/v3/developer-guide/setup-config.html).
See #initialize for a full list of supported configuration options.
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#associate_resource(params = {}) ⇒ Struct
Associates a canary with a group.
-
#create_canary(params = {}) ⇒ Types::CreateCanaryResponse
Creates a canary.
-
#create_group(params = {}) ⇒ Types::CreateGroupResponse
Creates a group which you can use to associate canaries with each other, including cross-Region canaries.
-
#delete_canary(params = {}) ⇒ Struct
Permanently deletes the specified canary.
-
#delete_group(params = {}) ⇒ Struct
Deletes a group.
-
#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.
-
#disassociate_resource(params = {}) ⇒ Struct
Removes a canary from a group.
-
#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.
-
#get_group(params = {}) ⇒ Types::GetGroupResponse
Returns information about one group.
-
#list_associated_groups(params = {}) ⇒ Types::ListAssociatedGroupsResponse
Returns a list of the groups that the specified canary is associated with.
-
#list_group_resources(params = {}) ⇒ Types::ListGroupResourcesResponse
This operation returns a list of the ARNs of the canaries that are associated with the specified group.
-
#list_groups(params = {}) ⇒ Types::ListGroupsResponse
Returns a list of all groups in the account, displaying their names, unique IDs, and ARNs.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Displays the tags associated with a canary or group.
-
#start_canary(params = {}) ⇒ Struct
Use this operation to run a canary that has already been created.
-
#start_canary_dry_run(params = {}) ⇒ Types::StartCanaryDryRunResponse
Use this operation to start a dry run for 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 or group.
-
#untag_resource(params = {}) ⇒ Struct
Removes one or more tags from the specified resource.
-
#update_canary(params = {}) ⇒ Struct
Updates the configuration of a canary that has already been created.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
467 468 469 |
# File 'lib/aws-sdk-synthetics/client.rb', line 467 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2190 2191 2192 |
# File 'lib/aws-sdk-synthetics/client.rb', line 2190 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2193 2194 2195 |
# File 'lib/aws-sdk-synthetics/client.rb', line 2193 def errors_module Errors end |
Instance Method Details
#associate_resource(params = {}) ⇒ Struct
Associates a canary with a group. Using groups can help you with managing and automating your canaries, and you can also view aggregated run results and statistics for all canaries in a group.
You must run this operation in the Region where the canary exists.
500 501 502 503 |
# File 'lib/aws-sdk-synthetics/client.rb', line 500 def associate_resource(params = {}, = {}) req = build_request(:associate_resource, params) req.send_request() end |
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 |
# File 'lib/aws-sdk-synthetics/client.rb', line 2163 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) tracer = config.telemetry_provider.tracer_provider.tracer( Aws::Telemetry.module_to_tracer_name('Aws::Synthetics') ) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config, tracer: tracer ) context[:gem_name] = 'aws-sdk-synthetics' context[:gem_version] = '1.64.0' Seahorse::Client::Request.new(handlers, context) end |
#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][1
-
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 `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].
[1]: docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_UpdateCanary.html [2]: docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Roles [3]: docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html
772 773 774 775 |
# File 'lib/aws-sdk-synthetics/client.rb', line 772 def create_canary(params = {}, = {}) req = build_request(:create_canary, params) req.send_request() end |
#create_group(params = {}) ⇒ Types::CreateGroupResponse
Creates a group which you can use to associate canaries with each other, including cross-Region canaries. Using groups can help you with managing and automating your canaries, and you can also view aggregated run results and statistics for all canaries in a group.
Groups are global resources. When you create a group, it is replicated across Amazon Web Services Regions, and you can view it and add canaries to it from any Region. Although the group ARN format reflects the Region name where it was created, a group is not constrained to any Region. This means that you can put canaries from multiple Regions into the same group, and then use that group to view and manage all of those canaries in a single view.
Groups are supported in all Regions except the Regions that are disabled by default. For more information about these Regions, see [Enabling a Region].
Each group can contain as many as 10 canaries. You can have as many as 20 groups in your account. Any single canary can be a member of up to 10 groups.
[1]: docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable
843 844 845 846 |
# File 'lib/aws-sdk-synthetics/client.rb', line 843 def create_group(params = {}, = {}) req = build_request(:create_group, params) req.send_request() end |
#delete_canary(params = {}) ⇒ Struct
Permanently deletes the specified canary.
If the canary’s ‘ProvisionedResourceCleanup` field is set to `AUTOMATIC` or you specify `DeleteLambda` in this operation as `true`, CloudWatch Synthetics also deletes the Lambda functions and layers that are used by the canary.
Other resources used and created by the canary are not automatically deleted. After you delete a canary, you should also delete the following:
-
The CloudWatch alarms created for this canary. These alarms have a name of ‘Synthetics-Alarm-first-198-characters-of-canary-name-canaryId-alarm number `
-
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-First-21-Characters-of-CanaryName `
-
CloudWatch Logs log groups created for the canary. These logs groups have the name ‘/aws/lambda/cwsyn-First-21-Characters-of-CanaryName `
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.
912 913 914 915 |
# File 'lib/aws-sdk-synthetics/client.rb', line 912 def delete_canary(params = {}, = {}) req = build_request(:delete_canary, params) req.send_request() end |
#delete_group(params = {}) ⇒ Struct
Deletes a group. The group doesn’t need to be empty to be deleted. If there are canaries in the group, they are not deleted when you delete the group.
Groups are a global resource that appear in all Regions, but the request to delete a group must be made from its home Region. You can find the home Region of a group within its ARN.
941 942 943 944 |
# File 'lib/aws-sdk-synthetics/client.rb', line 941 def delete_group(params = {}, = {}) req = build_request(:delete_group, 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.
1058 1059 1060 1061 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1058 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.
1147 1148 1149 1150 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1147 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].
[1]: docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1196 1197 1198 1199 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1196 def describe_runtime_versions(params = {}, = {}) req = build_request(:describe_runtime_versions, params) req.send_request() end |
#disassociate_resource(params = {}) ⇒ Struct
Removes a canary from a group. You must run this operation in the Region where the canary exists.
1225 1226 1227 1228 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1225 def disassociate_resource(params = {}, = {}) req = build_request(:disassociate_resource, 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].
[1]: docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DescribeCanaries.html
1304 1305 1306 1307 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1304 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.
1385 1386 1387 1388 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1385 def get_canary_runs(params = {}, = {}) req = build_request(:get_canary_runs, params) req.send_request() end |
#get_group(params = {}) ⇒ Types::GetGroupResponse
Returns information about one group. Groups are a global resource, so you can use this operation from any Region.
1421 1422 1423 1424 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1421 def get_group(params = {}, = {}) req = build_request(:get_group, params) req.send_request() end |
#list_associated_groups(params = {}) ⇒ Types::ListAssociatedGroupsResponse
Returns a list of the groups that the specified canary is associated with. The canary that you specify must be in the current Region.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1469 1470 1471 1472 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1469 def list_associated_groups(params = {}, = {}) req = build_request(:list_associated_groups, params) req.send_request() end |
#list_group_resources(params = {}) ⇒ Types::ListGroupResourcesResponse
This operation returns a list of the ARNs of the canaries that are associated with the specified group.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1516 1517 1518 1519 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1516 def list_group_resources(params = {}, = {}) req = build_request(:list_group_resources, params) req.send_request() end |
#list_groups(params = {}) ⇒ Types::ListGroupsResponse
Returns a list of all groups in the account, displaying their names, unique IDs, and ARNs. The groups from all Regions are returned.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1560 1561 1562 1563 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1560 def list_groups(params = {}, = {}) req = build_request(:list_groups, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Displays the tags associated with a canary or group.
1595 1596 1597 1598 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1595 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].
[1]: docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_GetCanary.html
1628 1629 1630 1631 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1628 def start_canary(params = {}, = {}) req = build_request(:start_canary, params) req.send_request() end |
#start_canary_dry_run(params = {}) ⇒ Types::StartCanaryDryRunResponse
Use this operation to start a dry run for a canary that has already been created
1820 1821 1822 1823 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1820 def start_canary_dry_run(params = {}, = {}) req = build_request(:start_canary_dry_run, params) req.send_request() end |
#stop_canary(params = {}) ⇒ Struct
Stops the canary to prevent all future runs. If the canary is currently running,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.
1853 1854 1855 1856 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1853 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 or group.
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 resource that already has tags. If you specify a new tag key for the resource, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, 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 or group.
1904 1905 1906 1907 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1904 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 resource.
1936 1937 1938 1939 |
# File 'lib/aws-sdk-synthetics/client.rb', line 1936 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_canary(params = {}) ⇒ Struct
Updates the configuration 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].
<note markdown=“1”> When you use the ‘dryRunId` field when updating a canary, the only other field you can provide is the `Schedule`. Adding any other field will thrown an exception.
</note>
[1]: docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_TagResource.html
2154 2155 2156 2157 |
# File 'lib/aws-sdk-synthetics/client.rb', line 2154 def update_canary(params = {}, = {}) req = build_request(:update_canary, params) req.send_request() end |
#waiter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
2183 2184 2185 |
# File 'lib/aws-sdk-synthetics/client.rb', line 2183 def waiter_names [] end |