cloudreactor_api_client 0.1.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +92 -0
  4. data/cloudreactor_api_client.md +226 -0
  5. data/lib/cloudreactor_api_client/api/alert_methods_api.rb +482 -0
  6. data/lib/cloudreactor_api_client/api/email_notification_profiles_api.rb +482 -0
  7. data/lib/cloudreactor_api_client/api/pagerduty_profiles_api.rb +482 -0
  8. data/lib/cloudreactor_api_client/api/run_environments_api.rb +479 -0
  9. data/lib/cloudreactor_api_client/api/task_executions_api.rb +409 -0
  10. data/lib/cloudreactor_api_client/api/tasks_api.rb +412 -0
  11. data/lib/cloudreactor_api_client/api/workflow_executions_api.rb +549 -0
  12. data/lib/cloudreactor_api_client/api/workflow_task_instances_api.rb +424 -0
  13. data/lib/cloudreactor_api_client/api/workflow_transitions_api.rb +406 -0
  14. data/lib/cloudreactor_api_client/api/workflows_api.rb +482 -0
  15. data/lib/cloudreactor_api_client/api_client.rb +390 -0
  16. data/lib/cloudreactor_api_client/api_error.rb +57 -0
  17. data/lib/cloudreactor_api_client/configuration.rb +277 -0
  18. data/lib/cloudreactor_api_client/models/alert_method.rb +449 -0
  19. data/lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb +517 -0
  20. data/lib/cloudreactor_api_client/models/aws_ecs_execution_method_capability.rb +565 -0
  21. data/lib/cloudreactor_api_client/models/aws_ecs_launch_type.rb +37 -0
  22. data/lib/cloudreactor_api_client/models/aws_ecs_run_environment_execution_method_capability.rb +476 -0
  23. data/lib/cloudreactor_api_client/models/aws_ecs_service_load_balancer_details.rb +307 -0
  24. data/lib/cloudreactor_api_client/models/aws_ecs_service_options.rb +308 -0
  25. data/lib/cloudreactor_api_client/models/current_service_info.rb +255 -0
  26. data/lib/cloudreactor_api_client/models/email_notification_profile.rb +454 -0
  27. data/lib/cloudreactor_api_client/models/execution_method_capability.rb +54 -0
  28. data/lib/cloudreactor_api_client/models/failure_behavior_enum.rb +38 -0
  29. data/lib/cloudreactor_api_client/models/group.rb +268 -0
  30. data/lib/cloudreactor_api_client/models/link.rb +301 -0
  31. data/lib/cloudreactor_api_client/models/name_and_uuid.rb +236 -0
  32. data/lib/cloudreactor_api_client/models/notification_severity.rb +39 -0
  33. data/lib/cloudreactor_api_client/models/pager_duty_profile.rb +484 -0
  34. data/lib/cloudreactor_api_client/models/paginated_alert_method_list.rb +247 -0
  35. data/lib/cloudreactor_api_client/models/paginated_email_notification_profile_list.rb +247 -0
  36. data/lib/cloudreactor_api_client/models/paginated_pager_duty_profile_list.rb +247 -0
  37. data/lib/cloudreactor_api_client/models/paginated_run_environment_list.rb +247 -0
  38. data/lib/cloudreactor_api_client/models/paginated_task_execution_list.rb +247 -0
  39. data/lib/cloudreactor_api_client/models/paginated_task_list.rb +247 -0
  40. data/lib/cloudreactor_api_client/models/paginated_workflow_execution_summary_list.rb +247 -0
  41. data/lib/cloudreactor_api_client/models/paginated_workflow_summary_list.rb +247 -0
  42. data/lib/cloudreactor_api_client/models/paginated_workflow_task_instance_list.rb +247 -0
  43. data/lib/cloudreactor_api_client/models/paginated_workflow_transition_list.rb +247 -0
  44. data/lib/cloudreactor_api_client/models/patched_alert_method.rb +405 -0
  45. data/lib/cloudreactor_api_client/models/patched_email_notification_profile.rb +415 -0
  46. data/lib/cloudreactor_api_client/models/patched_pager_duty_profile.rb +436 -0
  47. data/lib/cloudreactor_api_client/models/patched_run_environment.rb +511 -0
  48. data/lib/cloudreactor_api_client/models/patched_task.rb +897 -0
  49. data/lib/cloudreactor_api_client/models/patched_task_execution.rb +1904 -0
  50. data/lib/cloudreactor_api_client/models/patched_workflow.rb +507 -0
  51. data/lib/cloudreactor_api_client/models/patched_workflow_execution.rb +559 -0
  52. data/lib/cloudreactor_api_client/models/patched_workflow_task_instance.rb +676 -0
  53. data/lib/cloudreactor_api_client/models/patched_workflow_transition.rb +432 -0
  54. data/lib/cloudreactor_api_client/models/propagate_tags_enum.rb +37 -0
  55. data/lib/cloudreactor_api_client/models/rule_type_enum.rb +43 -0
  56. data/lib/cloudreactor_api_client/models/run_environment.rb +555 -0
  57. data/lib/cloudreactor_api_client/models/start_transition_condition_enum.rb +39 -0
  58. data/lib/cloudreactor_api_client/models/stop_reason_enum.rb +42 -0
  59. data/lib/cloudreactor_api_client/models/task.rb +941 -0
  60. data/lib/cloudreactor_api_client/models/task_execution.rb +1954 -0
  61. data/lib/cloudreactor_api_client/models/task_execution_status.rb +46 -0
  62. data/lib/cloudreactor_api_client/models/threshold_property_enum.rb +39 -0
  63. data/lib/cloudreactor_api_client/models/timeout_behavior_enum.rb +40 -0
  64. data/lib/cloudreactor_api_client/models/unknown_execution_method_capability.rb +238 -0
  65. data/lib/cloudreactor_api_client/models/workflow.rb +556 -0
  66. data/lib/cloudreactor_api_client/models/workflow_execution.rb +629 -0
  67. data/lib/cloudreactor_api_client/models/workflow_execution_status.rb +42 -0
  68. data/lib/cloudreactor_api_client/models/workflow_execution_summary.rb +523 -0
  69. data/lib/cloudreactor_api_client/models/workflow_summary.rb +513 -0
  70. data/lib/cloudreactor_api_client/models/workflow_task_instance.rb +715 -0
  71. data/lib/cloudreactor_api_client/models/workflow_task_instance_execution.rb +280 -0
  72. data/lib/cloudreactor_api_client/models/workflow_task_instance_execution_base.rb +270 -0
  73. data/lib/cloudreactor_api_client/models/workflow_transition.rb +467 -0
  74. data/lib/cloudreactor_api_client/models/workflow_transition_evaluation.rb +280 -0
  75. data/lib/cloudreactor_api_client/version.rb +15 -0
  76. data/lib/cloudreactor_api_client.rb +121 -0
  77. data/lib/cloudreactor_wrapper_io/status_updater.rb +124 -0
  78. data/lib/cloudreactor_wrapper_io.rb +13 -0
  79. data/spec/api/alert_methods_api_spec.rb +114 -0
  80. data/spec/api/email_notification_profiles_api_spec.rb +114 -0
  81. data/spec/api/pagerduty_profiles_api_spec.rb +114 -0
  82. data/spec/api/run_environments_api_spec.rb +113 -0
  83. data/spec/api/task_executions_api_spec.rb +102 -0
  84. data/spec/api/tasks_api_spec.rb +103 -0
  85. data/spec/api/workflow_executions_api_spec.rb +124 -0
  86. data/spec/api/workflow_task_instances_api_spec.rb +107 -0
  87. data/spec/api/workflow_transitions_api_spec.rb +101 -0
  88. data/spec/api/workflows_api_spec.rb +114 -0
  89. data/spec/api_client_spec.rb +226 -0
  90. data/spec/configuration_spec.rb +42 -0
  91. data/spec/integration/task_execution_integration_spec.rb +51 -0
  92. data/spec/models/alert_method_spec.rb +136 -0
  93. data/spec/models/aws_ecs_execution_method_capability_spec.rb +166 -0
  94. data/spec/models/aws_ecs_execution_method_spec.rb +148 -0
  95. data/spec/models/aws_ecs_launch_type_spec.rb +28 -0
  96. data/spec/models/aws_ecs_run_environment_execution_method_capability_spec.rb +130 -0
  97. data/spec/models/aws_ecs_service_load_balancer_details_spec.rb +46 -0
  98. data/spec/models/aws_ecs_service_options_spec.rb +88 -0
  99. data/spec/models/current_service_info_spec.rb +52 -0
  100. data/spec/models/email_notification_profile_spec.rb +118 -0
  101. data/spec/models/execution_method_capability_spec.rb +43 -0
  102. data/spec/models/failure_behavior_enum_spec.rb +28 -0
  103. data/spec/models/group_spec.rb +46 -0
  104. data/spec/models/link_spec.rb +70 -0
  105. data/spec/models/name_and_uuid_spec.rb +46 -0
  106. data/spec/models/notification_severity_spec.rb +28 -0
  107. data/spec/models/pager_duty_profile_spec.rb +118 -0
  108. data/spec/models/paginated_alert_method_list_spec.rb +52 -0
  109. data/spec/models/paginated_email_notification_profile_list_spec.rb +52 -0
  110. data/spec/models/paginated_pager_duty_profile_list_spec.rb +52 -0
  111. data/spec/models/paginated_run_environment_list_spec.rb +52 -0
  112. data/spec/models/paginated_task_execution_list_spec.rb +52 -0
  113. data/spec/models/paginated_task_list_spec.rb +52 -0
  114. data/spec/models/paginated_workflow_execution_summary_list_spec.rb +52 -0
  115. data/spec/models/paginated_workflow_summary_list_spec.rb +52 -0
  116. data/spec/models/paginated_workflow_task_instance_list_spec.rb +52 -0
  117. data/spec/models/paginated_workflow_transition_list_spec.rb +52 -0
  118. data/spec/models/patched_alert_method_spec.rb +136 -0
  119. data/spec/models/patched_email_notification_profile_spec.rb +118 -0
  120. data/spec/models/patched_pager_duty_profile_spec.rb +118 -0
  121. data/spec/models/patched_run_environment_spec.rb +136 -0
  122. data/spec/models/patched_task_execution_spec.rb +466 -0
  123. data/spec/models/patched_task_spec.rb +244 -0
  124. data/spec/models/patched_workflow_execution_spec.rb +172 -0
  125. data/spec/models/patched_workflow_spec.rb +142 -0
  126. data/spec/models/patched_workflow_task_instance_spec.rb +196 -0
  127. data/spec/models/patched_workflow_transition_spec.rb +118 -0
  128. data/spec/models/propagate_tags_enum_spec.rb +28 -0
  129. data/spec/models/rule_type_enum_spec.rb +28 -0
  130. data/spec/models/run_environment_spec.rb +136 -0
  131. data/spec/models/start_transition_condition_enum_spec.rb +28 -0
  132. data/spec/models/stop_reason_enum_spec.rb +28 -0
  133. data/spec/models/task_execution_spec.rb +466 -0
  134. data/spec/models/task_execution_status_spec.rb +28 -0
  135. data/spec/models/task_spec.rb +244 -0
  136. data/spec/models/threshold_property_enum_spec.rb +28 -0
  137. data/spec/models/timeout_behavior_enum_spec.rb +28 -0
  138. data/spec/models/unknown_execution_method_capability_spec.rb +40 -0
  139. data/spec/models/workflow_execution_spec.rb +172 -0
  140. data/spec/models/workflow_execution_status_spec.rb +28 -0
  141. data/spec/models/workflow_execution_summary_spec.rb +130 -0
  142. data/spec/models/workflow_spec.rb +142 -0
  143. data/spec/models/workflow_summary_spec.rb +124 -0
  144. data/spec/models/workflow_task_instance_execution_base_spec.rb +58 -0
  145. data/spec/models/workflow_task_instance_execution_spec.rb +64 -0
  146. data/spec/models/workflow_task_instance_spec.rb +196 -0
  147. data/spec/models/workflow_transition_evaluation_spec.rb +64 -0
  148. data/spec/models/workflow_transition_spec.rb +118 -0
  149. data/spec/spec_helper.rb +111 -0
  150. data/spec/wrapper_io/status_updater_spec.rb +147 -0
  151. metadata +305 -0
@@ -0,0 +1,118 @@
1
+ =begin
2
+ #CloudReactor API
3
+
4
+ #CloudReactor API Documentation
5
+
6
+ The version of the OpenAPI document: 0.2.0
7
+ Contact: jeff@cloudreactor.io
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudReactorAPIClient::WorkflowTransition
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe CloudReactorAPIClient::WorkflowTransition do
21
+ let(:instance) { CloudReactorAPIClient::WorkflowTransition.new }
22
+
23
+ describe 'test an instance of WorkflowTransition' do
24
+ it 'should create an instance of WorkflowTransition' do
25
+ expect(instance).to be_instance_of(CloudReactorAPIClient::WorkflowTransition)
26
+ end
27
+ end
28
+ describe 'test attribute "url"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ end
32
+ end
33
+
34
+ describe 'test attribute "uuid"' do
35
+ it 'should work' do
36
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ end
38
+ end
39
+
40
+ describe 'test attribute "description"' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "from_workflow_task_instance"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
49
+ end
50
+ end
51
+
52
+ describe 'test attribute "to_workflow_task_instance"' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
58
+ describe 'test attribute "rule_type"' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
+ end
62
+ end
63
+
64
+ describe 'test attribute "exit_codes"' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
67
+ end
68
+ end
69
+
70
+ describe 'test attribute "threshold_property"' do
71
+ it 'should work' do
72
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
73
+ end
74
+ end
75
+
76
+ describe 'test attribute "custom_expression"' do
77
+ it 'should work' do
78
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
79
+ end
80
+ end
81
+
82
+ describe 'test attribute "priority"' do
83
+ it 'should work' do
84
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
85
+ end
86
+ end
87
+
88
+ describe 'test attribute "ui_color"' do
89
+ it 'should work' do
90
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
91
+ end
92
+ end
93
+
94
+ describe 'test attribute "ui_line_style"' do
95
+ it 'should work' do
96
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
97
+ end
98
+ end
99
+
100
+ describe 'test attribute "ui_scale"' do
101
+ it 'should work' do
102
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
103
+ end
104
+ end
105
+
106
+ describe 'test attribute "created_at"' do
107
+ it 'should work' do
108
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
109
+ end
110
+ end
111
+
112
+ describe 'test attribute "updated_at"' do
113
+ it 'should work' do
114
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
115
+ end
116
+ end
117
+
118
+ end
@@ -0,0 +1,111 @@
1
+ =begin
2
+ #CloudReactor API
3
+
4
+ #CloudReactor API Documentation
5
+
6
+ The version of the OpenAPI document: 0.2.0
7
+ Contact: jeff@cloudreactor.io
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ # load the gem
14
+ require 'cloudreactor_api_client'
15
+
16
+ # The following was generated by the `rspec --init` command. Conventionally, all
17
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
18
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
19
+ # this file to always be loaded, without a need to explicitly require it in any
20
+ # files.
21
+ #
22
+ # Given that it is always loaded, you are encouraged to keep this file as
23
+ # light-weight as possible. Requiring heavyweight dependencies from this file
24
+ # will add to the boot time of your test suite on EVERY test run, even for an
25
+ # individual file that may not need all of that loaded. Instead, consider making
26
+ # a separate helper file that requires the additional dependencies and performs
27
+ # the additional setup, and require it from the spec files that actually need
28
+ # it.
29
+ #
30
+ # The `.rspec` file also contains a few flags that are not defaults but that
31
+ # users commonly want.
32
+ #
33
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
34
+ RSpec.configure do |config|
35
+ # rspec-expectations config goes here. You can use an alternate
36
+ # assertion/expectation library such as wrong or the stdlib/minitest
37
+ # assertions if you prefer.
38
+ config.expect_with :rspec do |expectations|
39
+ # This option will default to `true` in RSpec 4. It makes the `description`
40
+ # and `failure_message` of custom matchers include text for helper methods
41
+ # defined using `chain`, e.g.:
42
+ # be_bigger_than(2).and_smaller_than(4).description
43
+ # # => "be bigger than 2 and smaller than 4"
44
+ # ...rather than:
45
+ # # => "be bigger than 2"
46
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
47
+ end
48
+
49
+ # rspec-mocks config goes here. You can use an alternate test double
50
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
51
+ config.mock_with :rspec do |mocks|
52
+ # Prevents you from mocking or stubbing a method that does not exist on
53
+ # a real object. This is generally recommended, and will default to
54
+ # `true` in RSpec 4.
55
+ mocks.verify_partial_doubles = true
56
+ end
57
+
58
+ # The settings below are suggested to provide a good initial experience
59
+ # with RSpec, but feel free to customize to your heart's content.
60
+ =begin
61
+ # These two settings work together to allow you to limit a spec run
62
+ # to individual examples or groups you care about by tagging them with
63
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
64
+ # get run.
65
+ config.filter_run :focus
66
+ config.run_all_when_everything_filtered = true
67
+
68
+ # Allows RSpec to persist some state between runs in order to support
69
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
70
+ # you configure your source control system to ignore this file.
71
+ config.example_status_persistence_file_path = "spec/examples.txt"
72
+
73
+ # Limits the available syntax to the non-monkey patched syntax that is
74
+ # recommended. For more details, see:
75
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
76
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
77
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
78
+ config.disable_monkey_patching!
79
+
80
+ # This setting enables warnings. It's recommended, but in some cases may
81
+ # be too noisy due to issues in dependencies.
82
+ config.warnings = true
83
+
84
+ # Many RSpec users commonly either run the entire suite or an individual
85
+ # file, and it's useful to allow more verbose output when running an
86
+ # individual spec file.
87
+ if config.files_to_run.one?
88
+ # Use the documentation formatter for detailed output,
89
+ # unless a formatter has already been configured
90
+ # (e.g. via a command-line flag).
91
+ config.default_formatter = 'doc'
92
+ end
93
+
94
+ # Print the 10 slowest examples and example groups at the
95
+ # end of the spec run, to help surface which specs are running
96
+ # particularly slow.
97
+ config.profile_examples = 10
98
+
99
+ # Run specs in random order to surface order dependencies. If you find an
100
+ # order dependency and want to debug it, you can fix the order by providing
101
+ # the seed, which is printed after each run.
102
+ # --seed 1234
103
+ config.order = :random
104
+
105
+ # Seed global randomization in this process using the `--seed` CLI option.
106
+ # Setting this allows you to use `--seed` to deterministically reproduce
107
+ # test failures related to randomization by passing the same `--seed` value
108
+ # as the one that triggered the failure.
109
+ Kernel.srand config.seed
110
+ =end
111
+ end
@@ -0,0 +1,147 @@
1
+ require 'socket'
2
+
3
+ require 'spec_helper'
4
+ require 'cloudreactor_wrapper_io'
5
+
6
+ describe CloudReactorWrapperIO::StatusUpdater do
7
+ let(:enabled) { true }
8
+ let(:param_port) { nil }
9
+ let(:port) { param_port || 2373 }
10
+ let(:status_updater) do
11
+ CloudReactorWrapperIO::StatusUpdater.new(enabled: enabled, port: param_port)
12
+ end
13
+
14
+ let(:success_count) { nil }
15
+ let(:error_count) { nil }
16
+ let(:skipped_count) { nil }
17
+ let(:expected_count) { nil }
18
+ let(:last_status_message) { nil }
19
+ let(:extra_props) { nil }
20
+ let(:read_socket) { UDPSocket.new }
21
+
22
+ before do
23
+ read_socket.bind('127.0.01', port)
24
+
25
+ status_updater.send_update(success_count: success_count,
26
+ error_count: error_count, skipped_count: skipped_count,
27
+ expected_count: expected_count,
28
+ last_status_message: last_status_message,
29
+ extra_props: extra_props)
30
+ end
31
+
32
+ after do
33
+ read_socket.close
34
+ end
35
+
36
+ def read_from_socket!
37
+ # recvfrom returns an array of a the message and the address
38
+ read_socket.recvfrom(10000)[0]
39
+ end
40
+
41
+ subject do
42
+ read_from_socket!
43
+ end
44
+
45
+ def check_send(attr: :success_count, count: 1)
46
+ status_updater.send_update(attr => count)
47
+ expect(read_from_socket!).to eq({
48
+ attr => count
49
+ }.to_json + "\n")
50
+ end
51
+
52
+ def check_nothing_sent
53
+ expect(read_socket.read_nonblock(1, exception: false)).to eq(
54
+ :wait_readable)
55
+ end
56
+
57
+ context 'no info' do
58
+ it 'should not send anything' do
59
+ check_nothing_sent()
60
+ end
61
+ end
62
+
63
+ context 'success_count is set' do
64
+ let(:success_count) { 10 }
65
+
66
+ it 'sends the success_count' do
67
+ check_send(count: success_count)
68
+ end
69
+ end
70
+
71
+ context 'error_count is set' do
72
+ let(:error_count) { 45 }
73
+
74
+ it 'sends the error_count' do
75
+ check_send(attr: :error_count, count: error_count)
76
+ end
77
+ end
78
+
79
+ context 'skipped_count is set' do
80
+ let(:skipped_count) { 61 }
81
+
82
+ it 'sends the skipped_count' do
83
+ check_send(attr: :skipped_count, count: skipped_count)
84
+ end
85
+ end
86
+
87
+ context 'expected_count is set' do
88
+ let(:expected_count) { 6113 }
89
+
90
+ it 'sends the expected_count' do
91
+ check_send(attr: :expected_count, count: expected_count)
92
+ end
93
+ end
94
+
95
+ context 'last_status_message is set' do
96
+ let(:last_status_message) { 'Yo Adrian!' }
97
+ it 'should send the last_status_message' do
98
+ expect(subject).to eq({
99
+ 'last_status_message' => last_status_message
100
+ }.to_json + "\n")
101
+ end
102
+
103
+ context 'multiple messages' do
104
+ it 'should send twice' do
105
+ subject
106
+ check_send
107
+ end
108
+ end
109
+ end
110
+
111
+ context 'extra props are set' do
112
+ let(:success_count) { 5 }
113
+ let(:extra_props) do
114
+ {
115
+ a: [1, 2],
116
+ b: true,
117
+ c: {
118
+ d: nil
119
+ }
120
+ }
121
+ end
122
+
123
+ it 'should send merged props' do
124
+ expect(subject).to eq({
125
+ success_count: success_count
126
+ }.merge(extra_props).to_json + "\n")
127
+ end
128
+ end
129
+
130
+ context 'different port' do
131
+ let(:param_port) { 3232 }
132
+
133
+ it 'should use the argument port' do
134
+ expect(status_updater.port).to eq(param_port)
135
+ check_send
136
+ end
137
+ end
138
+
139
+ context 'disabled' do
140
+ let(:enabled) { false }
141
+
142
+ it 'should not send anything' do
143
+ expect(status_updater.enabled).to eq(false)
144
+ check_nothing_sent()
145
+ end
146
+ end
147
+ end
metadata ADDED
@@ -0,0 +1,305 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cloudreactor_api_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0.pre
5
+ platform: ruby
6
+ authors:
7
+ - Jeff Tsay
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-03-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: typhoeus
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.1
33
+ - !ruby/object:Gem::Dependency
34
+ name: rspec
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '3.6'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 3.6.0
43
+ type: :development
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '3.6'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 3.6.0
53
+ description: API client to monitor and manage Tasks and Workflows in CloudReactor,
54
+ and communication with a CloudReactor process wrapper
55
+ email:
56
+ - jeff@cloudreactor.io
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - LICENSE.txt
62
+ - README.md
63
+ - cloudreactor_api_client.md
64
+ - lib/cloudreactor_api_client.rb
65
+ - lib/cloudreactor_api_client/api/alert_methods_api.rb
66
+ - lib/cloudreactor_api_client/api/email_notification_profiles_api.rb
67
+ - lib/cloudreactor_api_client/api/pagerduty_profiles_api.rb
68
+ - lib/cloudreactor_api_client/api/run_environments_api.rb
69
+ - lib/cloudreactor_api_client/api/task_executions_api.rb
70
+ - lib/cloudreactor_api_client/api/tasks_api.rb
71
+ - lib/cloudreactor_api_client/api/workflow_executions_api.rb
72
+ - lib/cloudreactor_api_client/api/workflow_task_instances_api.rb
73
+ - lib/cloudreactor_api_client/api/workflow_transitions_api.rb
74
+ - lib/cloudreactor_api_client/api/workflows_api.rb
75
+ - lib/cloudreactor_api_client/api_client.rb
76
+ - lib/cloudreactor_api_client/api_error.rb
77
+ - lib/cloudreactor_api_client/configuration.rb
78
+ - lib/cloudreactor_api_client/models/alert_method.rb
79
+ - lib/cloudreactor_api_client/models/aws_ecs_execution_method.rb
80
+ - lib/cloudreactor_api_client/models/aws_ecs_execution_method_capability.rb
81
+ - lib/cloudreactor_api_client/models/aws_ecs_launch_type.rb
82
+ - lib/cloudreactor_api_client/models/aws_ecs_run_environment_execution_method_capability.rb
83
+ - lib/cloudreactor_api_client/models/aws_ecs_service_load_balancer_details.rb
84
+ - lib/cloudreactor_api_client/models/aws_ecs_service_options.rb
85
+ - lib/cloudreactor_api_client/models/current_service_info.rb
86
+ - lib/cloudreactor_api_client/models/email_notification_profile.rb
87
+ - lib/cloudreactor_api_client/models/execution_method_capability.rb
88
+ - lib/cloudreactor_api_client/models/failure_behavior_enum.rb
89
+ - lib/cloudreactor_api_client/models/group.rb
90
+ - lib/cloudreactor_api_client/models/link.rb
91
+ - lib/cloudreactor_api_client/models/name_and_uuid.rb
92
+ - lib/cloudreactor_api_client/models/notification_severity.rb
93
+ - lib/cloudreactor_api_client/models/pager_duty_profile.rb
94
+ - lib/cloudreactor_api_client/models/paginated_alert_method_list.rb
95
+ - lib/cloudreactor_api_client/models/paginated_email_notification_profile_list.rb
96
+ - lib/cloudreactor_api_client/models/paginated_pager_duty_profile_list.rb
97
+ - lib/cloudreactor_api_client/models/paginated_run_environment_list.rb
98
+ - lib/cloudreactor_api_client/models/paginated_task_execution_list.rb
99
+ - lib/cloudreactor_api_client/models/paginated_task_list.rb
100
+ - lib/cloudreactor_api_client/models/paginated_workflow_execution_summary_list.rb
101
+ - lib/cloudreactor_api_client/models/paginated_workflow_summary_list.rb
102
+ - lib/cloudreactor_api_client/models/paginated_workflow_task_instance_list.rb
103
+ - lib/cloudreactor_api_client/models/paginated_workflow_transition_list.rb
104
+ - lib/cloudreactor_api_client/models/patched_alert_method.rb
105
+ - lib/cloudreactor_api_client/models/patched_email_notification_profile.rb
106
+ - lib/cloudreactor_api_client/models/patched_pager_duty_profile.rb
107
+ - lib/cloudreactor_api_client/models/patched_run_environment.rb
108
+ - lib/cloudreactor_api_client/models/patched_task.rb
109
+ - lib/cloudreactor_api_client/models/patched_task_execution.rb
110
+ - lib/cloudreactor_api_client/models/patched_workflow.rb
111
+ - lib/cloudreactor_api_client/models/patched_workflow_execution.rb
112
+ - lib/cloudreactor_api_client/models/patched_workflow_task_instance.rb
113
+ - lib/cloudreactor_api_client/models/patched_workflow_transition.rb
114
+ - lib/cloudreactor_api_client/models/propagate_tags_enum.rb
115
+ - lib/cloudreactor_api_client/models/rule_type_enum.rb
116
+ - lib/cloudreactor_api_client/models/run_environment.rb
117
+ - lib/cloudreactor_api_client/models/start_transition_condition_enum.rb
118
+ - lib/cloudreactor_api_client/models/stop_reason_enum.rb
119
+ - lib/cloudreactor_api_client/models/task.rb
120
+ - lib/cloudreactor_api_client/models/task_execution.rb
121
+ - lib/cloudreactor_api_client/models/task_execution_status.rb
122
+ - lib/cloudreactor_api_client/models/threshold_property_enum.rb
123
+ - lib/cloudreactor_api_client/models/timeout_behavior_enum.rb
124
+ - lib/cloudreactor_api_client/models/unknown_execution_method_capability.rb
125
+ - lib/cloudreactor_api_client/models/workflow.rb
126
+ - lib/cloudreactor_api_client/models/workflow_execution.rb
127
+ - lib/cloudreactor_api_client/models/workflow_execution_status.rb
128
+ - lib/cloudreactor_api_client/models/workflow_execution_summary.rb
129
+ - lib/cloudreactor_api_client/models/workflow_summary.rb
130
+ - lib/cloudreactor_api_client/models/workflow_task_instance.rb
131
+ - lib/cloudreactor_api_client/models/workflow_task_instance_execution.rb
132
+ - lib/cloudreactor_api_client/models/workflow_task_instance_execution_base.rb
133
+ - lib/cloudreactor_api_client/models/workflow_transition.rb
134
+ - lib/cloudreactor_api_client/models/workflow_transition_evaluation.rb
135
+ - lib/cloudreactor_api_client/version.rb
136
+ - lib/cloudreactor_wrapper_io.rb
137
+ - lib/cloudreactor_wrapper_io/status_updater.rb
138
+ - spec/api/alert_methods_api_spec.rb
139
+ - spec/api/email_notification_profiles_api_spec.rb
140
+ - spec/api/pagerduty_profiles_api_spec.rb
141
+ - spec/api/run_environments_api_spec.rb
142
+ - spec/api/task_executions_api_spec.rb
143
+ - spec/api/tasks_api_spec.rb
144
+ - spec/api/workflow_executions_api_spec.rb
145
+ - spec/api/workflow_task_instances_api_spec.rb
146
+ - spec/api/workflow_transitions_api_spec.rb
147
+ - spec/api/workflows_api_spec.rb
148
+ - spec/api_client_spec.rb
149
+ - spec/configuration_spec.rb
150
+ - spec/integration/task_execution_integration_spec.rb
151
+ - spec/models/alert_method_spec.rb
152
+ - spec/models/aws_ecs_execution_method_capability_spec.rb
153
+ - spec/models/aws_ecs_execution_method_spec.rb
154
+ - spec/models/aws_ecs_launch_type_spec.rb
155
+ - spec/models/aws_ecs_run_environment_execution_method_capability_spec.rb
156
+ - spec/models/aws_ecs_service_load_balancer_details_spec.rb
157
+ - spec/models/aws_ecs_service_options_spec.rb
158
+ - spec/models/current_service_info_spec.rb
159
+ - spec/models/email_notification_profile_spec.rb
160
+ - spec/models/execution_method_capability_spec.rb
161
+ - spec/models/failure_behavior_enum_spec.rb
162
+ - spec/models/group_spec.rb
163
+ - spec/models/link_spec.rb
164
+ - spec/models/name_and_uuid_spec.rb
165
+ - spec/models/notification_severity_spec.rb
166
+ - spec/models/pager_duty_profile_spec.rb
167
+ - spec/models/paginated_alert_method_list_spec.rb
168
+ - spec/models/paginated_email_notification_profile_list_spec.rb
169
+ - spec/models/paginated_pager_duty_profile_list_spec.rb
170
+ - spec/models/paginated_run_environment_list_spec.rb
171
+ - spec/models/paginated_task_execution_list_spec.rb
172
+ - spec/models/paginated_task_list_spec.rb
173
+ - spec/models/paginated_workflow_execution_summary_list_spec.rb
174
+ - spec/models/paginated_workflow_summary_list_spec.rb
175
+ - spec/models/paginated_workflow_task_instance_list_spec.rb
176
+ - spec/models/paginated_workflow_transition_list_spec.rb
177
+ - spec/models/patched_alert_method_spec.rb
178
+ - spec/models/patched_email_notification_profile_spec.rb
179
+ - spec/models/patched_pager_duty_profile_spec.rb
180
+ - spec/models/patched_run_environment_spec.rb
181
+ - spec/models/patched_task_execution_spec.rb
182
+ - spec/models/patched_task_spec.rb
183
+ - spec/models/patched_workflow_execution_spec.rb
184
+ - spec/models/patched_workflow_spec.rb
185
+ - spec/models/patched_workflow_task_instance_spec.rb
186
+ - spec/models/patched_workflow_transition_spec.rb
187
+ - spec/models/propagate_tags_enum_spec.rb
188
+ - spec/models/rule_type_enum_spec.rb
189
+ - spec/models/run_environment_spec.rb
190
+ - spec/models/start_transition_condition_enum_spec.rb
191
+ - spec/models/stop_reason_enum_spec.rb
192
+ - spec/models/task_execution_spec.rb
193
+ - spec/models/task_execution_status_spec.rb
194
+ - spec/models/task_spec.rb
195
+ - spec/models/threshold_property_enum_spec.rb
196
+ - spec/models/timeout_behavior_enum_spec.rb
197
+ - spec/models/unknown_execution_method_capability_spec.rb
198
+ - spec/models/workflow_execution_spec.rb
199
+ - spec/models/workflow_execution_status_spec.rb
200
+ - spec/models/workflow_execution_summary_spec.rb
201
+ - spec/models/workflow_spec.rb
202
+ - spec/models/workflow_summary_spec.rb
203
+ - spec/models/workflow_task_instance_execution_base_spec.rb
204
+ - spec/models/workflow_task_instance_execution_spec.rb
205
+ - spec/models/workflow_task_instance_spec.rb
206
+ - spec/models/workflow_transition_evaluation_spec.rb
207
+ - spec/models/workflow_transition_spec.rb
208
+ - spec/spec_helper.rb
209
+ - spec/wrapper_io/status_updater_spec.rb
210
+ homepage: https://cloudreactor.io
211
+ licenses:
212
+ - BSD-2-Clause
213
+ metadata: {}
214
+ post_install_message:
215
+ rdoc_options: []
216
+ require_paths:
217
+ - lib
218
+ required_ruby_version: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '2.5'
223
+ required_rubygems_version: !ruby/object:Gem::Requirement
224
+ requirements:
225
+ - - ">"
226
+ - !ruby/object:Gem::Version
227
+ version: 1.3.1
228
+ requirements: []
229
+ rubygems_version: 3.3.7
230
+ signing_key:
231
+ specification_version: 4
232
+ summary: CloudReactor API client and process wrapper communication
233
+ test_files:
234
+ - spec/api/workflow_transitions_api_spec.rb
235
+ - spec/api/tasks_api_spec.rb
236
+ - spec/api/alert_methods_api_spec.rb
237
+ - spec/api/pagerduty_profiles_api_spec.rb
238
+ - spec/api/workflow_task_instances_api_spec.rb
239
+ - spec/api/task_executions_api_spec.rb
240
+ - spec/api/email_notification_profiles_api_spec.rb
241
+ - spec/api/workflow_executions_api_spec.rb
242
+ - spec/api/workflows_api_spec.rb
243
+ - spec/api/run_environments_api_spec.rb
244
+ - spec/api_client_spec.rb
245
+ - spec/configuration_spec.rb
246
+ - spec/integration/task_execution_integration_spec.rb
247
+ - spec/models/paginated_email_notification_profile_list_spec.rb
248
+ - spec/models/aws_ecs_execution_method_capability_spec.rb
249
+ - spec/models/patched_pager_duty_profile_spec.rb
250
+ - spec/models/patched_email_notification_profile_spec.rb
251
+ - spec/models/patched_workflow_task_instance_spec.rb
252
+ - spec/models/workflow_task_instance_spec.rb
253
+ - spec/models/rule_type_enum_spec.rb
254
+ - spec/models/task_execution_spec.rb
255
+ - spec/models/patched_workflow_execution_spec.rb
256
+ - spec/models/workflow_summary_spec.rb
257
+ - spec/models/paginated_task_execution_list_spec.rb
258
+ - spec/models/paginated_workflow_transition_list_spec.rb
259
+ - spec/models/workflow_task_instance_execution_base_spec.rb
260
+ - spec/models/workflow_execution_summary_spec.rb
261
+ - spec/models/workflow_execution_status_spec.rb
262
+ - spec/models/aws_ecs_run_environment_execution_method_capability_spec.rb
263
+ - spec/models/stop_reason_enum_spec.rb
264
+ - spec/models/paginated_alert_method_list_spec.rb
265
+ - spec/models/paginated_run_environment_list_spec.rb
266
+ - spec/models/unknown_execution_method_capability_spec.rb
267
+ - spec/models/aws_ecs_service_load_balancer_details_spec.rb
268
+ - spec/models/email_notification_profile_spec.rb
269
+ - spec/models/link_spec.rb
270
+ - spec/models/patched_workflow_transition_spec.rb
271
+ - spec/models/workflow_transition_spec.rb
272
+ - spec/models/name_and_uuid_spec.rb
273
+ - spec/models/paginated_workflow_execution_summary_list_spec.rb
274
+ - spec/models/current_service_info_spec.rb
275
+ - spec/models/paginated_workflow_task_instance_list_spec.rb
276
+ - spec/models/patched_alert_method_spec.rb
277
+ - spec/models/group_spec.rb
278
+ - spec/models/task_execution_status_spec.rb
279
+ - spec/models/run_environment_spec.rb
280
+ - spec/models/timeout_behavior_enum_spec.rb
281
+ - spec/models/threshold_property_enum_spec.rb
282
+ - spec/models/paginated_pager_duty_profile_list_spec.rb
283
+ - spec/models/patched_workflow_spec.rb
284
+ - spec/models/failure_behavior_enum_spec.rb
285
+ - spec/models/propagate_tags_enum_spec.rb
286
+ - spec/models/paginated_task_list_spec.rb
287
+ - spec/models/pager_duty_profile_spec.rb
288
+ - spec/models/workflow_transition_evaluation_spec.rb
289
+ - spec/models/paginated_workflow_summary_list_spec.rb
290
+ - spec/models/patched_task_spec.rb
291
+ - spec/models/aws_ecs_launch_type_spec.rb
292
+ - spec/models/workflow_task_instance_execution_spec.rb
293
+ - spec/models/start_transition_condition_enum_spec.rb
294
+ - spec/models/notification_severity_spec.rb
295
+ - spec/models/alert_method_spec.rb
296
+ - spec/models/aws_ecs_service_options_spec.rb
297
+ - spec/models/workflow_execution_spec.rb
298
+ - spec/models/patched_run_environment_spec.rb
299
+ - spec/models/aws_ecs_execution_method_spec.rb
300
+ - spec/models/execution_method_capability_spec.rb
301
+ - spec/models/workflow_spec.rb
302
+ - spec/models/patched_task_execution_spec.rb
303
+ - spec/models/task_spec.rb
304
+ - spec/spec_helper.rb
305
+ - spec/wrapper_io/status_updater_spec.rb