Class: Aws::PrometheusService::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::PrometheusService::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb
Overview
An API client for PrometheusService. To construct a client, you need to configure a :region
and :credentials
.
client = Aws::PrometheusService::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_alert_manager_definition(params = {}) ⇒ Types::CreateAlertManagerDefinitionResponse
Create an alert manager definition.
-
#create_logging_configuration(params = {}) ⇒ Types::CreateLoggingConfigurationResponse
Create logging configuration.
-
#create_rule_groups_namespace(params = {}) ⇒ Types::CreateRuleGroupsNamespaceResponse
Create a rule group namespace.
-
#create_workspace(params = {}) ⇒ Types::CreateWorkspaceResponse
Creates a new AMP workspace.
-
#delete_alert_manager_definition(params = {}) ⇒ Struct
Deletes an alert manager definition.
-
#delete_logging_configuration(params = {}) ⇒ Struct
Delete logging configuration.
-
#delete_rule_groups_namespace(params = {}) ⇒ Struct
Delete a rule groups namespace.
-
#delete_workspace(params = {}) ⇒ Struct
Deletes an AMP workspace.
-
#describe_alert_manager_definition(params = {}) ⇒ Types::DescribeAlertManagerDefinitionResponse
Describes an alert manager definition.
-
#describe_logging_configuration(params = {}) ⇒ Types::DescribeLoggingConfigurationResponse
Describes logging configuration.
-
#describe_rule_groups_namespace(params = {}) ⇒ Types::DescribeRuleGroupsNamespaceResponse
Describe a rule groups namespace.
-
#describe_workspace(params = {}) ⇒ Types::DescribeWorkspaceResponse
Describes an existing AMP workspace.
-
#list_rule_groups_namespaces(params = {}) ⇒ Types::ListRuleGroupsNamespacesResponse
Lists rule groups namespaces.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags you have assigned to the resource.
-
#list_workspaces(params = {}) ⇒ Types::ListWorkspacesResponse
Lists all AMP workspaces, including workspaces being created or deleted.
-
#put_alert_manager_definition(params = {}) ⇒ Types::PutAlertManagerDefinitionResponse
Update an alert manager definition.
-
#put_rule_groups_namespace(params = {}) ⇒ Types::PutRuleGroupsNamespaceResponse
Update a rule groups namespace.
-
#tag_resource(params = {}) ⇒ Struct
Creates tags for the specified resource.
-
#untag_resource(params = {}) ⇒ Struct
Deletes tags from the specified resource.
-
#update_logging_configuration(params = {}) ⇒ Types::UpdateLoggingConfigurationResponse
Update logging configuration.
-
#update_workspace_alias(params = {}) ⇒ Struct
Updates an AMP workspace alias.
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
-
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
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.
365 366 367 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 365 def initialize(*args) super end |
Instance Method Details
#create_alert_manager_definition(params = {}) ⇒ Types::CreateAlertManagerDefinitionResponse
Create an alert manager definition.
408 409 410 411 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 408 def create_alert_manager_definition(params = {}, = {}) req = build_request(:create_alert_manager_definition, params) req.send_request() end |
#create_logging_configuration(params = {}) ⇒ Types::CreateLoggingConfigurationResponse
Create logging configuration.
450 451 452 453 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 450 def create_logging_configuration(params = {}, = {}) req = build_request(:create_logging_configuration, params) req.send_request() end |
#create_rule_groups_namespace(params = {}) ⇒ Types::CreateRuleGroupsNamespaceResponse
Create a rule group namespace.
508 509 510 511 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 508 def create_rule_groups_namespace(params = {}, = {}) req = build_request(:create_rule_groups_namespace, params) req.send_request() end |
#create_workspace(params = {}) ⇒ Types::CreateWorkspaceResponse
Creates a new AMP workspace.
558 559 560 561 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 558 def create_workspace(params = {}, = {}) req = build_request(:create_workspace, params) req.send_request() end |
#delete_alert_manager_definition(params = {}) ⇒ Struct
Deletes an alert manager definition.
589 590 591 592 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 589 def delete_alert_manager_definition(params = {}, = {}) req = build_request(:delete_alert_manager_definition, params) req.send_request() end |
#delete_logging_configuration(params = {}) ⇒ Struct
Delete logging configuration.
619 620 621 622 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 619 def delete_logging_configuration(params = {}, = {}) req = build_request(:delete_logging_configuration, params) req.send_request() end |
#delete_rule_groups_namespace(params = {}) ⇒ Struct
Delete a rule groups namespace.
653 654 655 656 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 653 def delete_rule_groups_namespace(params = {}, = {}) req = build_request(:delete_rule_groups_namespace, params) req.send_request() end |
#delete_workspace(params = {}) ⇒ Struct
Deletes an AMP workspace.
683 684 685 686 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 683 def delete_workspace(params = {}, = {}) req = build_request(:delete_workspace, params) req.send_request() end |
#describe_alert_manager_definition(params = {}) ⇒ Types::DescribeAlertManagerDefinitionResponse
Describes an alert manager definition.
715 716 717 718 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 715 def describe_alert_manager_definition(params = {}, = {}) req = build_request(:describe_alert_manager_definition, params) req.send_request() end |
#describe_logging_configuration(params = {}) ⇒ Types::DescribeLoggingConfigurationResponse
Describes logging configuration.
748 749 750 751 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 748 def describe_logging_configuration(params = {}, = {}) req = build_request(:describe_logging_configuration, params) req.send_request() end |
#describe_rule_groups_namespace(params = {}) ⇒ Types::DescribeRuleGroupsNamespaceResponse
Describe a rule groups namespace.
788 789 790 791 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 788 def describe_rule_groups_namespace(params = {}, = {}) req = build_request(:describe_rule_groups_namespace, params) req.send_request() end |
#describe_workspace(params = {}) ⇒ Types::DescribeWorkspaceResponse
Describes an existing AMP workspace.
The following waiters are defined for this operation (see #wait_until for detailed usage):
- workspace_active
- workspace_deleted
829 830 831 832 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 829 def describe_workspace(params = {}, = {}) req = build_request(:describe_workspace, params) req.send_request() end |
#list_rule_groups_namespaces(params = {}) ⇒ Types::ListRuleGroupsNamespacesResponse
Lists rule groups namespaces.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
884 885 886 887 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 884 def list_rule_groups_namespaces(params = {}, = {}) req = build_request(:list_rule_groups_namespaces, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags you have assigned to the resource.
913 914 915 916 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 913 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#list_workspaces(params = {}) ⇒ Types::ListWorkspacesResponse
Lists all AMP workspaces, including workspaces being created or deleted.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
964 965 966 967 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 964 def list_workspaces(params = {}, = {}) req = build_request(:list_workspaces, params) req.send_request() end |
#put_alert_manager_definition(params = {}) ⇒ Types::PutAlertManagerDefinitionResponse
Update an alert manager definition.
1006 1007 1008 1009 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 1006 def put_alert_manager_definition(params = {}, = {}) req = build_request(:put_alert_manager_definition, params) req.send_request() end |
#put_rule_groups_namespace(params = {}) ⇒ Types::PutRuleGroupsNamespaceResponse
Update a rule groups namespace.
1058 1059 1060 1061 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 1058 def put_rule_groups_namespace(params = {}, = {}) req = build_request(:put_rule_groups_namespace, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Creates tags for the specified resource.
1086 1087 1088 1089 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 1086 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Deletes tags from the specified resource.
1112 1113 1114 1115 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 1112 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_logging_configuration(params = {}) ⇒ Types::UpdateLoggingConfigurationResponse
Update logging configuration.
1154 1155 1156 1157 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 1154 def update_logging_configuration(params = {}, = {}) req = build_request(:update_logging_configuration, params) req.send_request() end |
#update_workspace_alias(params = {}) ⇒ Struct
Updates an AMP workspace alias.
1188 1189 1190 1191 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 1188 def update_workspace_alias(params = {}, = {}) req = build_request(:update_workspace_alias, params) req.send_request() end |
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
Basic Usage
A waiter will call an API operation until:
- It is successful
- It enters a terminal state
- It makes the maximum number of attempts
In between attempts, the waiter will sleep.
# polls in a loop, sleeping between attempts
client.wait_until(waiter_name, params)
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.
# poll for ~25 seconds
client.wait_until(waiter_name, params, {
max_attempts: 5,
delay: 5,
})
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success
or :failure
from these callbacks,
it will terminate the waiter.
started_at = Time.now
client.wait_until(waiter_name, params, {
# disable max attempts
max_attempts: nil,
# poll for 1 hour, instead of a number of attempts
before_wait: -> (attempts, response) do
throw :failure if Time.now - started_at > 3600
end
})
Handling Errors
When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
Valid Waiters
The following table lists the valid waiter names, the operations they call,
and the default :delay
and :max_attempts
values.
waiter_name | params | :delay | :max_attempts |
---|---|---|---|
workspace_active | #describe_workspace | 2 | 60 |
workspace_deleted | #describe_workspace | 2 | 60 |
1299 1300 1301 1302 1303 |
# File 'gems/aws-sdk-prometheusservice/lib/aws-sdk-prometheusservice/client.rb', line 1299 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |