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,280 @@
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 'date'
14
+ require 'time'
15
+
16
+ module CloudReactorAPIClient
17
+ # A WorkflowTransitionEvaluation is a saved evaluation of the conditions in a WorkflowTransition during a WorkflowExecution.
18
+ class WorkflowTransitionEvaluation
19
+ attr_accessor :uuid
20
+
21
+ attr_accessor :result
22
+
23
+ attr_accessor :workflow_transition
24
+
25
+ attr_accessor :workflow_execution
26
+
27
+ attr_accessor :from_workflow_task_instance_execution
28
+
29
+ attr_accessor :evaluated_at
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'uuid' => :'uuid',
35
+ :'result' => :'result',
36
+ :'workflow_transition' => :'workflow_transition',
37
+ :'workflow_execution' => :'workflow_execution',
38
+ :'from_workflow_task_instance_execution' => :'from_workflow_task_instance_execution',
39
+ :'evaluated_at' => :'evaluated_at'
40
+ }
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'uuid' => :'String',
52
+ :'result' => :'Boolean',
53
+ :'workflow_transition' => :'NameAndUuid',
54
+ :'workflow_execution' => :'NameAndUuid',
55
+ :'from_workflow_task_instance_execution' => :'String',
56
+ :'evaluated_at' => :'Time'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'workflow_transition',
64
+ :'workflow_execution',
65
+ :'from_workflow_task_instance_execution',
66
+ ])
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ if (!attributes.is_a?(Hash))
73
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CloudReactorAPIClient::WorkflowTransitionEvaluation` initialize method"
74
+ end
75
+
76
+ # check to see if the attribute exists and convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!self.class.attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CloudReactorAPIClient::WorkflowTransitionEvaluation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'uuid')
85
+ self.uuid = attributes[:'uuid']
86
+ end
87
+
88
+ if attributes.key?(:'result')
89
+ self.result = attributes[:'result']
90
+ end
91
+
92
+ if attributes.key?(:'workflow_transition')
93
+ self.workflow_transition = attributes[:'workflow_transition']
94
+ end
95
+
96
+ if attributes.key?(:'workflow_execution')
97
+ self.workflow_execution = attributes[:'workflow_execution']
98
+ end
99
+
100
+ if attributes.key?(:'from_workflow_task_instance_execution')
101
+ self.from_workflow_task_instance_execution = attributes[:'from_workflow_task_instance_execution']
102
+ end
103
+
104
+ if attributes.key?(:'evaluated_at')
105
+ self.evaluated_at = attributes[:'evaluated_at']
106
+ end
107
+ end
108
+
109
+ # Show invalid properties with the reasons. Usually used together with valid?
110
+ # @return Array for valid properties with the reasons
111
+ def list_invalid_properties
112
+ invalid_properties = Array.new
113
+ if @uuid.nil?
114
+ invalid_properties.push('invalid value for "uuid", uuid cannot be nil.')
115
+ end
116
+
117
+ if @result.nil?
118
+ invalid_properties.push('invalid value for "result", result cannot be nil.')
119
+ end
120
+
121
+ if @evaluated_at.nil?
122
+ invalid_properties.push('invalid value for "evaluated_at", evaluated_at cannot be nil.')
123
+ end
124
+
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ return false if @uuid.nil?
132
+ return false if @result.nil?
133
+ return false if @evaluated_at.nil?
134
+ true
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ uuid == o.uuid &&
143
+ result == o.result &&
144
+ workflow_transition == o.workflow_transition &&
145
+ workflow_execution == o.workflow_execution &&
146
+ from_workflow_task_instance_execution == o.from_workflow_task_instance_execution &&
147
+ evaluated_at == o.evaluated_at
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [uuid, result, workflow_transition, workflow_execution, from_workflow_task_instance_execution, evaluated_at].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ new.build_from_hash(attributes)
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ self.class.openapi_types.each_pair do |key, type|
175
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
176
+ self.send("#{key}=", nil)
177
+ elsif type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
181
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
182
+ end
183
+ elsif !attributes[self.class.attribute_map[key]].nil?
184
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
185
+ end
186
+ end
187
+
188
+ self
189
+ end
190
+
191
+ # Deserializes the data based on type
192
+ # @param string type Data type
193
+ # @param string value Value to be deserialized
194
+ # @return [Object] Deserialized data
195
+ def _deserialize(type, value)
196
+ case type.to_sym
197
+ when :Time
198
+ Time.parse(value)
199
+ when :Date
200
+ Date.parse(value)
201
+ when :String
202
+ value.to_s
203
+ when :Integer
204
+ value.to_i
205
+ when :Float
206
+ value.to_f
207
+ when :Boolean
208
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
209
+ true
210
+ else
211
+ false
212
+ end
213
+ when :Object
214
+ # generic object (usually a Hash), return directly
215
+ value
216
+ when /\AArray<(?<inner_type>.+)>\z/
217
+ inner_type = Regexp.last_match[:inner_type]
218
+ value.map { |v| _deserialize(inner_type, v) }
219
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
220
+ k_type = Regexp.last_match[:k_type]
221
+ v_type = Regexp.last_match[:v_type]
222
+ {}.tap do |hash|
223
+ value.each do |k, v|
224
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
225
+ end
226
+ end
227
+ else # model
228
+ # models (e.g. Pet) or oneOf
229
+ klass = CloudReactorAPIClient.const_get(type)
230
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
231
+ end
232
+ end
233
+
234
+ # Returns the string representation of the object
235
+ # @return [String] String presentation of the object
236
+ def to_s
237
+ to_hash.to_s
238
+ end
239
+
240
+ # to_body is an alias to to_hash (backward compatibility)
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_body
243
+ to_hash
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ if value.nil?
253
+ is_nullable = self.class.openapi_nullable.include?(attr)
254
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
+ end
256
+
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map { |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+ end
280
+ end
@@ -0,0 +1,15 @@
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
+ module CloudReactorAPIClient
14
+ VERSION = '0.1.0.pre'
15
+ end
@@ -0,0 +1,121 @@
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
+ # Common files
14
+ require 'cloudreactor_api_client/api_client'
15
+ require 'cloudreactor_api_client/api_error'
16
+ require 'cloudreactor_api_client/version'
17
+ require 'cloudreactor_api_client/configuration'
18
+
19
+ # Models
20
+ require 'cloudreactor_api_client/models/alert_method'
21
+ require 'cloudreactor_api_client/models/aws_ecs_execution_method'
22
+ require 'cloudreactor_api_client/models/aws_ecs_execution_method_capability'
23
+ require 'cloudreactor_api_client/models/aws_ecs_launch_type'
24
+ require 'cloudreactor_api_client/models/aws_ecs_run_environment_execution_method_capability'
25
+ require 'cloudreactor_api_client/models/aws_ecs_service_load_balancer_details'
26
+ require 'cloudreactor_api_client/models/aws_ecs_service_options'
27
+ require 'cloudreactor_api_client/models/current_service_info'
28
+ require 'cloudreactor_api_client/models/email_notification_profile'
29
+ require 'cloudreactor_api_client/models/execution_method_capability'
30
+ require 'cloudreactor_api_client/models/failure_behavior_enum'
31
+ require 'cloudreactor_api_client/models/group'
32
+ require 'cloudreactor_api_client/models/link'
33
+ require 'cloudreactor_api_client/models/name_and_uuid'
34
+ require 'cloudreactor_api_client/models/notification_severity'
35
+ require 'cloudreactor_api_client/models/pager_duty_profile'
36
+ require 'cloudreactor_api_client/models/paginated_alert_method_list'
37
+ require 'cloudreactor_api_client/models/paginated_email_notification_profile_list'
38
+ require 'cloudreactor_api_client/models/paginated_pager_duty_profile_list'
39
+ require 'cloudreactor_api_client/models/paginated_run_environment_list'
40
+ require 'cloudreactor_api_client/models/paginated_task_execution_list'
41
+ require 'cloudreactor_api_client/models/paginated_task_list'
42
+ require 'cloudreactor_api_client/models/paginated_workflow_execution_summary_list'
43
+ require 'cloudreactor_api_client/models/paginated_workflow_summary_list'
44
+ require 'cloudreactor_api_client/models/paginated_workflow_task_instance_list'
45
+ require 'cloudreactor_api_client/models/paginated_workflow_transition_list'
46
+ require 'cloudreactor_api_client/models/patched_alert_method'
47
+ require 'cloudreactor_api_client/models/patched_email_notification_profile'
48
+ require 'cloudreactor_api_client/models/patched_pager_duty_profile'
49
+ require 'cloudreactor_api_client/models/patched_run_environment'
50
+ require 'cloudreactor_api_client/models/patched_task'
51
+ require 'cloudreactor_api_client/models/patched_task_execution'
52
+ require 'cloudreactor_api_client/models/patched_workflow'
53
+ require 'cloudreactor_api_client/models/patched_workflow_execution'
54
+ require 'cloudreactor_api_client/models/patched_workflow_task_instance'
55
+ require 'cloudreactor_api_client/models/patched_workflow_transition'
56
+ require 'cloudreactor_api_client/models/propagate_tags_enum'
57
+ require 'cloudreactor_api_client/models/rule_type_enum'
58
+ require 'cloudreactor_api_client/models/run_environment'
59
+ require 'cloudreactor_api_client/models/start_transition_condition_enum'
60
+ require 'cloudreactor_api_client/models/stop_reason_enum'
61
+ require 'cloudreactor_api_client/models/task'
62
+ require 'cloudreactor_api_client/models/task_execution'
63
+ require 'cloudreactor_api_client/models/task_execution_status'
64
+ require 'cloudreactor_api_client/models/threshold_property_enum'
65
+ require 'cloudreactor_api_client/models/timeout_behavior_enum'
66
+ require 'cloudreactor_api_client/models/unknown_execution_method_capability'
67
+ require 'cloudreactor_api_client/models/workflow'
68
+ require 'cloudreactor_api_client/models/workflow_execution'
69
+ require 'cloudreactor_api_client/models/workflow_execution_status'
70
+ require 'cloudreactor_api_client/models/workflow_execution_summary'
71
+ require 'cloudreactor_api_client/models/workflow_summary'
72
+ require 'cloudreactor_api_client/models/workflow_task_instance'
73
+ require 'cloudreactor_api_client/models/workflow_task_instance_execution'
74
+ require 'cloudreactor_api_client/models/workflow_task_instance_execution_base'
75
+ require 'cloudreactor_api_client/models/workflow_transition'
76
+ require 'cloudreactor_api_client/models/workflow_transition_evaluation'
77
+
78
+ # APIs
79
+ require 'cloudreactor_api_client/api/alert_methods_api'
80
+ require 'cloudreactor_api_client/api/email_notification_profiles_api'
81
+ require 'cloudreactor_api_client/api/pagerduty_profiles_api'
82
+ require 'cloudreactor_api_client/api/run_environments_api'
83
+ require 'cloudreactor_api_client/api/task_executions_api'
84
+ require 'cloudreactor_api_client/api/tasks_api'
85
+ require 'cloudreactor_api_client/api/workflow_executions_api'
86
+ require 'cloudreactor_api_client/api/workflow_task_instances_api'
87
+ require 'cloudreactor_api_client/api/workflow_transitions_api'
88
+ require 'cloudreactor_api_client/api/workflows_api'
89
+
90
+ module CloudReactorAPIClient
91
+ class << self
92
+ # Customize default settings for the SDK using block.
93
+ # CloudReactorAPIClient.configure do |config|
94
+ # config.username = "xxx"
95
+ # config.password = "xxx"
96
+ # end
97
+ # If no block given, return the default Configuration object.
98
+ def configure
99
+ if block_given?
100
+ yield(Configuration.default)
101
+ else
102
+ Configuration.default
103
+ end
104
+ end
105
+ end
106
+ end
107
+
108
+ # Patches below
109
+ module CloudReactorAPIClient
110
+ module ConfigurationPatches
111
+ # Override configuration to set the Token prefix required for the
112
+ # CloudReactor API Server
113
+ def initialize
114
+ super
115
+ @api_key_prefix = { 'tokenAuth' => 'Token' }
116
+ end
117
+ end
118
+ end
119
+
120
+ CloudReactorAPIClient::Configuration.prepend(
121
+ CloudReactorAPIClient::ConfigurationPatches)
@@ -0,0 +1,124 @@
1
+ require 'json'
2
+ require 'logger'
3
+ require 'socket'
4
+
5
+ module CloudReactorWrapperIO
6
+ class StatusUpdater
7
+ DEFAULT_STATUS_UPDATE_PORT = 2373
8
+
9
+ attr_reader :enabled
10
+ attr_reader :port
11
+
12
+ def initialize(enabled: nil, port: nil, logger: nil)
13
+ @logger = logger
14
+
15
+ unless @logger
16
+ if defined?(Rails)
17
+ @logger = Rails.logger
18
+ else
19
+ @logger = Logger.new(STDOUT)
20
+ end
21
+ end
22
+
23
+ @socket = nil
24
+ @port = nil
25
+
26
+ if enabled.nil?
27
+ @enabled = (ENV['PROC_WRAPPER_ENABLE_STATUS_UPDATE_LISTENER'] ||
28
+ 'FALSE').upcase == 'TRUE'
29
+ else
30
+ @enabled = enabled
31
+ end
32
+
33
+ if @enabled
34
+ @logger.info('ProcessStatusUpdater is enabled')
35
+ else
36
+ @logger.info('ProcessStatusUpdater is disabled')
37
+ return
38
+ end
39
+
40
+ if port.nil?
41
+ @port = (ENV['PROC_WRAPPER_STATUS_UPDATE_SOCKET_PORT'] ||
42
+ DEFAULT_STATUS_UPDATE_PORT).to_i
43
+ else
44
+ @port = port
45
+ end
46
+
47
+ at_exit do
48
+ @logger.info('Shutting down status update socket ...')
49
+ begin
50
+ if @socket
51
+ @socket.shutdown
52
+ @socket = nil
53
+ @logger.info('Done shutting down status update socket.')
54
+ else
55
+ @logger.info('No socket to close.')
56
+ end
57
+ rescue => ex
58
+ @logger.info('Error shutting down status update socket.')
59
+ end
60
+ end
61
+ end
62
+
63
+ def send_update(success_count: nil, error_count: nil, skipped_count: nil,
64
+ expected_count: nil, last_status_message: nil, extra_props: nil)
65
+ unless @enabled
66
+ return false
67
+ end
68
+
69
+ status_hash = {}
70
+
71
+ unless success_count.nil?
72
+ status_hash[:success_count] = success_count
73
+ end
74
+
75
+ unless error_count.nil?
76
+ status_hash[:error_count] = error_count
77
+ end
78
+
79
+ unless skipped_count.nil?
80
+ status_hash[:skipped_count] = skipped_count
81
+ end
82
+
83
+ unless expected_count.nil?
84
+ status_hash[:expected_count] = expected_count
85
+ end
86
+
87
+ unless last_status_message.nil?
88
+ status_hash[:last_status_message] = last_status_message
89
+ end
90
+
91
+ if extra_props
92
+ status_hash.merge!(extra_props)
93
+ end
94
+
95
+ if status_hash.empty?
96
+ return false
97
+ end
98
+
99
+ message = status_hash.to_json + "\n"
100
+
101
+ begin
102
+ socket.send(message, 0, '127.0.0.1', @port)
103
+ true
104
+ rescue => ex
105
+ @logger.debug("Can't send status update, resetting socket")
106
+ @socket = nil
107
+ false
108
+ end
109
+ end
110
+
111
+ def close
112
+ if @socket
113
+ @socket.shutdown
114
+ @socket = nil
115
+ end
116
+ end
117
+
118
+ private
119
+
120
+ def socket
121
+ @socket || UDPSocket.new
122
+ end
123
+ end
124
+ end
@@ -0,0 +1,13 @@
1
+ =begin
2
+ #CloudReactor Wrapper I/O
3
+
4
+ #CloudReactor Wrapper I/O 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.3.0
10
+
11
+ =end
12
+
13
+ require 'cloudreactor_wrapper_io/status_updater'
@@ -0,0 +1,114 @@
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
+
16
+ # Unit tests for CloudReactorAPIClient::AlertMethodsApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'AlertMethodsApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = CloudReactorAPIClient::AlertMethodsApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of AlertMethodsApi' do
30
+ it 'should create an instance of AlertMethodsApi' do
31
+ expect(@api_instance).to be_instance_of(CloudReactorAPIClient::AlertMethodsApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for alert_methods_clone_create
36
+ # @param uuid
37
+ # @param alert_method
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [AlertMethod]
40
+ describe 'alert_methods_clone_create test' 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
+ # unit tests for alert_methods_create
47
+ # @param alert_method
48
+ # @param [Hash] opts the optional parameters
49
+ # @return [AlertMethod]
50
+ describe 'alert_methods_create test' do
51
+ it 'should work' do
52
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
53
+ end
54
+ end
55
+
56
+ # unit tests for alert_methods_destroy
57
+ # @param uuid
58
+ # @param [Hash] opts the optional parameters
59
+ # @return [nil]
60
+ describe 'alert_methods_destroy test' do
61
+ it 'should work' do
62
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
63
+ end
64
+ end
65
+
66
+ # unit tests for alert_methods_list
67
+ # @param [Hash] opts the optional parameters
68
+ # @option opts [Integer] :created_by_group__id
69
+ # @option opts [Integer] :limit Number of results to return per page.
70
+ # @option opts [String] :name
71
+ # @option opts [Integer] :offset The initial index from which to return the results.
72
+ # @option opts [String] :ordering Which field to use when ordering the results.
73
+ # @option opts [String] :run_environment__uuid
74
+ # @option opts [String] :search A search term.
75
+ # @return [PaginatedAlertMethodList]
76
+ describe 'alert_methods_list test' 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
+ # unit tests for alert_methods_partial_update
83
+ # @param uuid
84
+ # @param [Hash] opts the optional parameters
85
+ # @option opts [PatchedAlertMethod] :patched_alert_method
86
+ # @return [AlertMethod]
87
+ describe 'alert_methods_partial_update test' do
88
+ it 'should work' do
89
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
90
+ end
91
+ end
92
+
93
+ # unit tests for alert_methods_retrieve
94
+ # @param uuid
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [AlertMethod]
97
+ describe 'alert_methods_retrieve test' do
98
+ it 'should work' do
99
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
100
+ end
101
+ end
102
+
103
+ # unit tests for alert_methods_update
104
+ # @param uuid
105
+ # @param alert_method
106
+ # @param [Hash] opts the optional parameters
107
+ # @return [AlertMethod]
108
+ describe 'alert_methods_update test' do
109
+ it 'should work' do
110
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
111
+ end
112
+ end
113
+
114
+ end