aws-sdk-prometheusservice 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e47eca1fe90ed00f254f6cafbd2c08108c57bc81c3712671b3a299169f12f229
4
- data.tar.gz: 5c72ca098375811d5b5a96904707de39e1c7df1b7e09544b4a5ff5262ff422a3
3
+ metadata.gz: 793cac01d5b4c57df8ae8d7a4886a066529076291c3e6808f03adba4109b6319
4
+ data.tar.gz: 1471ea8a91c2273416385e101c3c3a8c47923f5d370491084c12fc72a8b4640e
5
5
  SHA512:
6
- metadata.gz: 365b1348bfd864cb259e6db989ebdb770ce0a98c2fc94b675ed4cd5d38d57bacca768f865ebccae25ba2988b7accaa0c48039b8e9084235efa02ea7c27b03a50
7
- data.tar.gz: 95a08bc05f9de681076c56cf3bfe4c7ee2c231c98232c00ae080644518e4f4a92e8ea72be2b8ba4af4658e2e3b0c580647ee5e9a176363518b60182e41b7f24d
6
+ metadata.gz: ceb3a7b035b422c00c5fb35b9a042c7a924eed7de6e654fe653f4c51931f88ef3360645d3f8d7b9edb97d89ac6b416c16ee9c2e2976f12327c064764e9097252
7
+ data.tar.gz: b5e4a1945af9824aa8ceb5dd58998a175c4c471b3d3af3eb3164a137d3769ee6afb698393d1b435104a555faf1c9eaeafc1ed7f6a8b472f120b372aec7fdc544
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.8.0 (2021-09-29)
5
+ ------------------
6
+
7
+ * Feature - This release adds alert manager and rule group namespace APIs
8
+
4
9
  1.7.0 (2021-09-07)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.0
1
+ 1.8.0
@@ -327,6 +327,106 @@ module Aws::PrometheusService
327
327
 
328
328
  # @!group API Operations
329
329
 
330
+ # Create an alert manager definition.
331
+ #
332
+ # @option params [String] :client_token
333
+ # Optional, unique, case-sensitive, user-provided identifier to ensure
334
+ # the idempotency of the request.
335
+ #
336
+ # **A suitable default value is auto-generated.** You should normally
337
+ # not need to pass this option.**
338
+ #
339
+ # @option params [required, String, StringIO, File] :data
340
+ # The alert manager definition data.
341
+ #
342
+ # @option params [required, String] :workspace_id
343
+ # The ID of the workspace in which to create the alert manager
344
+ # definition.
345
+ #
346
+ # @return [Types::CreateAlertManagerDefinitionResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
347
+ #
348
+ # * {Types::CreateAlertManagerDefinitionResponse#status #status} => Types::AlertManagerDefinitionStatus
349
+ #
350
+ # @example Request syntax with placeholder values
351
+ #
352
+ # resp = client.create_alert_manager_definition({
353
+ # client_token: "IdempotencyToken",
354
+ # data: "data", # required
355
+ # workspace_id: "WorkspaceId", # required
356
+ # })
357
+ #
358
+ # @example Response structure
359
+ #
360
+ # resp.status.status_code #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "CREATION_FAILED", "UPDATE_FAILED"
361
+ # resp.status.status_reason #=> String
362
+ #
363
+ # @see http://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/CreateAlertManagerDefinition AWS API Documentation
364
+ #
365
+ # @overload create_alert_manager_definition(params = {})
366
+ # @param [Hash] params ({})
367
+ def create_alert_manager_definition(params = {}, options = {})
368
+ req = build_request(:create_alert_manager_definition, params)
369
+ req.send_request(options)
370
+ end
371
+
372
+ # Create a rule group namespace.
373
+ #
374
+ # @option params [String] :client_token
375
+ # Optional, unique, case-sensitive, user-provided identifier to ensure
376
+ # the idempotency of the request.
377
+ #
378
+ # **A suitable default value is auto-generated.** You should normally
379
+ # not need to pass this option.**
380
+ #
381
+ # @option params [required, String, StringIO, File] :data
382
+ # The namespace data that define the rule groups.
383
+ #
384
+ # @option params [required, String] :name
385
+ # The rule groups namespace name.
386
+ #
387
+ # @option params [Hash<String,String>] :tags
388
+ # Optional, user-provided tags for this rule groups namespace.
389
+ #
390
+ # @option params [required, String] :workspace_id
391
+ # The ID of the workspace in which to create the rule group namespace.
392
+ #
393
+ # @return [Types::CreateRuleGroupsNamespaceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
394
+ #
395
+ # * {Types::CreateRuleGroupsNamespaceResponse#arn #arn} => String
396
+ # * {Types::CreateRuleGroupsNamespaceResponse#name #name} => String
397
+ # * {Types::CreateRuleGroupsNamespaceResponse#status #status} => Types::RuleGroupsNamespaceStatus
398
+ # * {Types::CreateRuleGroupsNamespaceResponse#tags #tags} => Hash&lt;String,String&gt;
399
+ #
400
+ # @example Request syntax with placeholder values
401
+ #
402
+ # resp = client.create_rule_groups_namespace({
403
+ # client_token: "IdempotencyToken",
404
+ # data: "data", # required
405
+ # name: "RuleGroupsNamespaceName", # required
406
+ # tags: {
407
+ # "TagKey" => "TagValue",
408
+ # },
409
+ # workspace_id: "WorkspaceId", # required
410
+ # })
411
+ #
412
+ # @example Response structure
413
+ #
414
+ # resp.arn #=> String
415
+ # resp.name #=> String
416
+ # resp.status.status_code #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "CREATION_FAILED", "UPDATE_FAILED"
417
+ # resp.status.status_reason #=> String
418
+ # resp.tags #=> Hash
419
+ # resp.tags["TagKey"] #=> String
420
+ #
421
+ # @see http://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/CreateRuleGroupsNamespace AWS API Documentation
422
+ #
423
+ # @overload create_rule_groups_namespace(params = {})
424
+ # @param [Hash] params ({})
425
+ def create_rule_groups_namespace(params = {}, options = {})
426
+ req = build_request(:create_rule_groups_namespace, params)
427
+ req.send_request(options)
428
+ end
429
+
330
430
  # Creates a new AMP workspace.
331
431
  #
332
432
  # @option params [String] :alias
@@ -377,6 +477,71 @@ module Aws::PrometheusService
377
477
  req.send_request(options)
378
478
  end
379
479
 
480
+ # Deletes an alert manager definition.
481
+ #
482
+ # @option params [String] :client_token
483
+ # Optional, unique, case-sensitive, user-provided identifier to ensure
484
+ # the idempotency of the request.
485
+ #
486
+ # **A suitable default value is auto-generated.** You should normally
487
+ # not need to pass this option.**
488
+ #
489
+ # @option params [required, String] :workspace_id
490
+ # The ID of the workspace in which to delete the alert manager
491
+ # definition.
492
+ #
493
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
494
+ #
495
+ # @example Request syntax with placeholder values
496
+ #
497
+ # resp = client.delete_alert_manager_definition({
498
+ # client_token: "IdempotencyToken",
499
+ # workspace_id: "WorkspaceId", # required
500
+ # })
501
+ #
502
+ # @see http://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/DeleteAlertManagerDefinition AWS API Documentation
503
+ #
504
+ # @overload delete_alert_manager_definition(params = {})
505
+ # @param [Hash] params ({})
506
+ def delete_alert_manager_definition(params = {}, options = {})
507
+ req = build_request(:delete_alert_manager_definition, params)
508
+ req.send_request(options)
509
+ end
510
+
511
+ # Delete a rule groups namespace.
512
+ #
513
+ # @option params [String] :client_token
514
+ # Optional, unique, case-sensitive, user-provided identifier to ensure
515
+ # the idempotency of the request.
516
+ #
517
+ # **A suitable default value is auto-generated.** You should normally
518
+ # not need to pass this option.**
519
+ #
520
+ # @option params [required, String] :name
521
+ # The rule groups namespace name.
522
+ #
523
+ # @option params [required, String] :workspace_id
524
+ # The ID of the workspace to delete rule group definition.
525
+ #
526
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
527
+ #
528
+ # @example Request syntax with placeholder values
529
+ #
530
+ # resp = client.delete_rule_groups_namespace({
531
+ # client_token: "IdempotencyToken",
532
+ # name: "RuleGroupsNamespaceName", # required
533
+ # workspace_id: "WorkspaceId", # required
534
+ # })
535
+ #
536
+ # @see http://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/DeleteRuleGroupsNamespace AWS API Documentation
537
+ #
538
+ # @overload delete_rule_groups_namespace(params = {})
539
+ # @param [Hash] params ({})
540
+ def delete_rule_groups_namespace(params = {}, options = {})
541
+ req = build_request(:delete_rule_groups_namespace, params)
542
+ req.send_request(options)
543
+ end
544
+
380
545
  # Deletes an AMP workspace.
381
546
  #
382
547
  # @option params [String] :client_token
@@ -407,6 +572,78 @@ module Aws::PrometheusService
407
572
  req.send_request(options)
408
573
  end
409
574
 
575
+ # Describes an alert manager definition.
576
+ #
577
+ # @option params [required, String] :workspace_id
578
+ # The ID of the workspace to describe.
579
+ #
580
+ # @return [Types::DescribeAlertManagerDefinitionResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
581
+ #
582
+ # * {Types::DescribeAlertManagerDefinitionResponse#alert_manager_definition #alert_manager_definition} => Types::AlertManagerDefinitionDescription
583
+ #
584
+ # @example Request syntax with placeholder values
585
+ #
586
+ # resp = client.describe_alert_manager_definition({
587
+ # workspace_id: "WorkspaceId", # required
588
+ # })
589
+ #
590
+ # @example Response structure
591
+ #
592
+ # resp.alert_manager_definition.created_at #=> Time
593
+ # resp.alert_manager_definition.data #=> String
594
+ # resp.alert_manager_definition.modified_at #=> Time
595
+ # resp.alert_manager_definition.status.status_code #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "CREATION_FAILED", "UPDATE_FAILED"
596
+ # resp.alert_manager_definition.status.status_reason #=> String
597
+ #
598
+ # @see http://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/DescribeAlertManagerDefinition AWS API Documentation
599
+ #
600
+ # @overload describe_alert_manager_definition(params = {})
601
+ # @param [Hash] params ({})
602
+ def describe_alert_manager_definition(params = {}, options = {})
603
+ req = build_request(:describe_alert_manager_definition, params)
604
+ req.send_request(options)
605
+ end
606
+
607
+ # Describe a rule groups namespace.
608
+ #
609
+ # @option params [required, String] :name
610
+ # The rule groups namespace.
611
+ #
612
+ # @option params [required, String] :workspace_id
613
+ # The ID of the workspace to describe.
614
+ #
615
+ # @return [Types::DescribeRuleGroupsNamespaceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
616
+ #
617
+ # * {Types::DescribeRuleGroupsNamespaceResponse#rule_groups_namespace #rule_groups_namespace} => Types::RuleGroupsNamespaceDescription
618
+ #
619
+ # @example Request syntax with placeholder values
620
+ #
621
+ # resp = client.describe_rule_groups_namespace({
622
+ # name: "RuleGroupsNamespaceName", # required
623
+ # workspace_id: "WorkspaceId", # required
624
+ # })
625
+ #
626
+ # @example Response structure
627
+ #
628
+ # resp.rule_groups_namespace.arn #=> String
629
+ # resp.rule_groups_namespace.created_at #=> Time
630
+ # resp.rule_groups_namespace.data #=> String
631
+ # resp.rule_groups_namespace.modified_at #=> Time
632
+ # resp.rule_groups_namespace.name #=> String
633
+ # resp.rule_groups_namespace.status.status_code #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "CREATION_FAILED", "UPDATE_FAILED"
634
+ # resp.rule_groups_namespace.status.status_reason #=> String
635
+ # resp.rule_groups_namespace.tags #=> Hash
636
+ # resp.rule_groups_namespace.tags["TagKey"] #=> String
637
+ #
638
+ # @see http://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/DescribeRuleGroupsNamespace AWS API Documentation
639
+ #
640
+ # @overload describe_rule_groups_namespace(params = {})
641
+ # @param [Hash] params ({})
642
+ def describe_rule_groups_namespace(params = {}, options = {})
643
+ req = build_request(:describe_rule_groups_namespace, params)
644
+ req.send_request(options)
645
+ end
646
+
410
647
  # Describes an existing AMP workspace.
411
648
  #
412
649
  # @option params [required, String] :workspace_id
@@ -433,6 +670,12 @@ module Aws::PrometheusService
433
670
  # resp.workspace.tags["TagKey"] #=> String
434
671
  # resp.workspace.workspace_id #=> String
435
672
  #
673
+ #
674
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
675
+ #
676
+ # * workspace_active
677
+ # * workspace_deleted
678
+ #
436
679
  # @see http://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/DescribeWorkspace AWS API Documentation
437
680
  #
438
681
  # @overload describe_workspace(params = {})
@@ -442,6 +685,61 @@ module Aws::PrometheusService
442
685
  req.send_request(options)
443
686
  end
444
687
 
688
+ # Lists rule groups namespaces.
689
+ #
690
+ # @option params [Integer] :max_results
691
+ # Maximum results to return in response (default=100, maximum=1000).
692
+ #
693
+ # @option params [String] :name
694
+ # Optional filter for rule groups namespace name. Only the rule groups
695
+ # namespace that begin with this value will be returned.
696
+ #
697
+ # @option params [String] :next_token
698
+ # Pagination token to request the next page in a paginated list. This
699
+ # token is obtained from the output of the previous
700
+ # ListRuleGroupsNamespaces request.
701
+ #
702
+ # @option params [required, String] :workspace_id
703
+ # The ID of the workspace.
704
+ #
705
+ # @return [Types::ListRuleGroupsNamespacesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
706
+ #
707
+ # * {Types::ListRuleGroupsNamespacesResponse#next_token #next_token} => String
708
+ # * {Types::ListRuleGroupsNamespacesResponse#rule_groups_namespaces #rule_groups_namespaces} => Array&lt;Types::RuleGroupsNamespaceSummary&gt;
709
+ #
710
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
711
+ #
712
+ # @example Request syntax with placeholder values
713
+ #
714
+ # resp = client.list_rule_groups_namespaces({
715
+ # max_results: 1,
716
+ # name: "RuleGroupsNamespaceName",
717
+ # next_token: "PaginationToken",
718
+ # workspace_id: "WorkspaceId", # required
719
+ # })
720
+ #
721
+ # @example Response structure
722
+ #
723
+ # resp.next_token #=> String
724
+ # resp.rule_groups_namespaces #=> Array
725
+ # resp.rule_groups_namespaces[0].arn #=> String
726
+ # resp.rule_groups_namespaces[0].created_at #=> Time
727
+ # resp.rule_groups_namespaces[0].modified_at #=> Time
728
+ # resp.rule_groups_namespaces[0].name #=> String
729
+ # resp.rule_groups_namespaces[0].status.status_code #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "CREATION_FAILED", "UPDATE_FAILED"
730
+ # resp.rule_groups_namespaces[0].status.status_reason #=> String
731
+ # resp.rule_groups_namespaces[0].tags #=> Hash
732
+ # resp.rule_groups_namespaces[0].tags["TagKey"] #=> String
733
+ #
734
+ # @see http://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/ListRuleGroupsNamespaces AWS API Documentation
735
+ #
736
+ # @overload list_rule_groups_namespaces(params = {})
737
+ # @param [Hash] params ({})
738
+ def list_rule_groups_namespaces(params = {}, options = {})
739
+ req = build_request(:list_rule_groups_namespaces, params)
740
+ req.send_request(options)
741
+ end
742
+
445
743
  # Lists the tags you have assigned to the resource.
446
744
  #
447
745
  # @option params [required, String] :resource_arn
@@ -522,6 +820,100 @@ module Aws::PrometheusService
522
820
  req.send_request(options)
523
821
  end
524
822
 
823
+ # Update an alert manager definition.
824
+ #
825
+ # @option params [String] :client_token
826
+ # Optional, unique, case-sensitive, user-provided identifier to ensure
827
+ # the idempotency of the request.
828
+ #
829
+ # **A suitable default value is auto-generated.** You should normally
830
+ # not need to pass this option.**
831
+ #
832
+ # @option params [required, String, StringIO, File] :data
833
+ # The alert manager definition data.
834
+ #
835
+ # @option params [required, String] :workspace_id
836
+ # The ID of the workspace in which to update the alert manager
837
+ # definition.
838
+ #
839
+ # @return [Types::PutAlertManagerDefinitionResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
840
+ #
841
+ # * {Types::PutAlertManagerDefinitionResponse#status #status} => Types::AlertManagerDefinitionStatus
842
+ #
843
+ # @example Request syntax with placeholder values
844
+ #
845
+ # resp = client.put_alert_manager_definition({
846
+ # client_token: "IdempotencyToken",
847
+ # data: "data", # required
848
+ # workspace_id: "WorkspaceId", # required
849
+ # })
850
+ #
851
+ # @example Response structure
852
+ #
853
+ # resp.status.status_code #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "CREATION_FAILED", "UPDATE_FAILED"
854
+ # resp.status.status_reason #=> String
855
+ #
856
+ # @see http://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/PutAlertManagerDefinition AWS API Documentation
857
+ #
858
+ # @overload put_alert_manager_definition(params = {})
859
+ # @param [Hash] params ({})
860
+ def put_alert_manager_definition(params = {}, options = {})
861
+ req = build_request(:put_alert_manager_definition, params)
862
+ req.send_request(options)
863
+ end
864
+
865
+ # Update a rule groups namespace.
866
+ #
867
+ # @option params [String] :client_token
868
+ # Optional, unique, case-sensitive, user-provided identifier to ensure
869
+ # the idempotency of the request.
870
+ #
871
+ # **A suitable default value is auto-generated.** You should normally
872
+ # not need to pass this option.**
873
+ #
874
+ # @option params [required, String, StringIO, File] :data
875
+ # The namespace data that define the rule groups.
876
+ #
877
+ # @option params [required, String] :name
878
+ # The rule groups namespace name.
879
+ #
880
+ # @option params [required, String] :workspace_id
881
+ # The ID of the workspace in which to update the rule group namespace.
882
+ #
883
+ # @return [Types::PutRuleGroupsNamespaceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
884
+ #
885
+ # * {Types::PutRuleGroupsNamespaceResponse#arn #arn} => String
886
+ # * {Types::PutRuleGroupsNamespaceResponse#name #name} => String
887
+ # * {Types::PutRuleGroupsNamespaceResponse#status #status} => Types::RuleGroupsNamespaceStatus
888
+ # * {Types::PutRuleGroupsNamespaceResponse#tags #tags} => Hash&lt;String,String&gt;
889
+ #
890
+ # @example Request syntax with placeholder values
891
+ #
892
+ # resp = client.put_rule_groups_namespace({
893
+ # client_token: "IdempotencyToken",
894
+ # data: "data", # required
895
+ # name: "RuleGroupsNamespaceName", # required
896
+ # workspace_id: "WorkspaceId", # required
897
+ # })
898
+ #
899
+ # @example Response structure
900
+ #
901
+ # resp.arn #=> String
902
+ # resp.name #=> String
903
+ # resp.status.status_code #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "CREATION_FAILED", "UPDATE_FAILED"
904
+ # resp.status.status_reason #=> String
905
+ # resp.tags #=> Hash
906
+ # resp.tags["TagKey"] #=> String
907
+ #
908
+ # @see http://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/PutRuleGroupsNamespace AWS API Documentation
909
+ #
910
+ # @overload put_rule_groups_namespace(params = {})
911
+ # @param [Hash] params ({})
912
+ def put_rule_groups_namespace(params = {}, options = {})
913
+ req = build_request(:put_rule_groups_namespace, params)
914
+ req.send_request(options)
915
+ end
916
+
525
917
  # Creates tags for the specified resource.
526
918
  #
527
919
  # @option params [required, String] :resource_arn
@@ -623,14 +1015,129 @@ module Aws::PrometheusService
623
1015
  params: params,
624
1016
  config: config)
625
1017
  context[:gem_name] = 'aws-sdk-prometheusservice'
626
- context[:gem_version] = '1.7.0'
1018
+ context[:gem_version] = '1.8.0'
627
1019
  Seahorse::Client::Request.new(handlers, context)
628
1020
  end
629
1021
 
1022
+ # Polls an API operation until a resource enters a desired state.
1023
+ #
1024
+ # ## Basic Usage
1025
+ #
1026
+ # A waiter will call an API operation until:
1027
+ #
1028
+ # * It is successful
1029
+ # * It enters a terminal state
1030
+ # * It makes the maximum number of attempts
1031
+ #
1032
+ # In between attempts, the waiter will sleep.
1033
+ #
1034
+ # # polls in a loop, sleeping between attempts
1035
+ # client.wait_until(waiter_name, params)
1036
+ #
1037
+ # ## Configuration
1038
+ #
1039
+ # You can configure the maximum number of polling attempts, and the
1040
+ # delay (in seconds) between each polling attempt. You can pass
1041
+ # configuration as the final arguments hash.
1042
+ #
1043
+ # # poll for ~25 seconds
1044
+ # client.wait_until(waiter_name, params, {
1045
+ # max_attempts: 5,
1046
+ # delay: 5,
1047
+ # })
1048
+ #
1049
+ # ## Callbacks
1050
+ #
1051
+ # You can be notified before each polling attempt and before each
1052
+ # delay. If you throw `:success` or `:failure` from these callbacks,
1053
+ # it will terminate the waiter.
1054
+ #
1055
+ # started_at = Time.now
1056
+ # client.wait_until(waiter_name, params, {
1057
+ #
1058
+ # # disable max attempts
1059
+ # max_attempts: nil,
1060
+ #
1061
+ # # poll for 1 hour, instead of a number of attempts
1062
+ # before_wait: -> (attempts, response) do
1063
+ # throw :failure if Time.now - started_at > 3600
1064
+ # end
1065
+ # })
1066
+ #
1067
+ # ## Handling Errors
1068
+ #
1069
+ # When a waiter is unsuccessful, it will raise an error.
1070
+ # All of the failure errors extend from
1071
+ # {Aws::Waiters::Errors::WaiterFailed}.
1072
+ #
1073
+ # begin
1074
+ # client.wait_until(...)
1075
+ # rescue Aws::Waiters::Errors::WaiterFailed
1076
+ # # resource did not enter the desired state in time
1077
+ # end
1078
+ #
1079
+ # ## Valid Waiters
1080
+ #
1081
+ # The following table lists the valid waiter names, the operations they call,
1082
+ # and the default `:delay` and `:max_attempts` values.
1083
+ #
1084
+ # | waiter_name | params | :delay | :max_attempts |
1085
+ # | ----------------- | --------------------------- | -------- | ------------- |
1086
+ # | workspace_active | {Client#describe_workspace} | 2 | 60 |
1087
+ # | workspace_deleted | {Client#describe_workspace} | 2 | 60 |
1088
+ #
1089
+ # @raise [Errors::FailureStateError] Raised when the waiter terminates
1090
+ # because the waiter has entered a state that it will not transition
1091
+ # out of, preventing success.
1092
+ #
1093
+ # @raise [Errors::TooManyAttemptsError] Raised when the configured
1094
+ # maximum number of attempts have been made, and the waiter is not
1095
+ # yet successful.
1096
+ #
1097
+ # @raise [Errors::UnexpectedError] Raised when an error is encounted
1098
+ # while polling for a resource that is not expected.
1099
+ #
1100
+ # @raise [Errors::NoSuchWaiterError] Raised when you request to wait
1101
+ # for an unknown state.
1102
+ #
1103
+ # @return [Boolean] Returns `true` if the waiter was successful.
1104
+ # @param [Symbol] waiter_name
1105
+ # @param [Hash] params ({})
1106
+ # @param [Hash] options ({})
1107
+ # @option options [Integer] :max_attempts
1108
+ # @option options [Integer] :delay
1109
+ # @option options [Proc] :before_attempt
1110
+ # @option options [Proc] :before_wait
1111
+ def wait_until(waiter_name, params = {}, options = {})
1112
+ w = waiter(waiter_name, options)
1113
+ yield(w.waiter) if block_given? # deprecated
1114
+ w.wait(params)
1115
+ end
1116
+
630
1117
  # @api private
631
1118
  # @deprecated
632
1119
  def waiter_names
633
- []
1120
+ waiters.keys
1121
+ end
1122
+
1123
+ private
1124
+
1125
+ # @param [Symbol] waiter_name
1126
+ # @param [Hash] options ({})
1127
+ def waiter(waiter_name, options = {})
1128
+ waiter_class = waiters[waiter_name]
1129
+ if waiter_class
1130
+ waiter_class.new(options.merge(client: self))
1131
+ else
1132
+ raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys)
1133
+ end
1134
+ end
1135
+
1136
+ def waiters
1137
+ {
1138
+ workspace_active: Waiters::WorkspaceActive,
1139
+ workspace_deleted: Waiters::WorkspaceDeleted
1140
+ }
634
1141
  end
635
1142
 
636
1143
  class << self