petstroepack 1.0.0

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 (141) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +86 -0
  4. data/lib/ctd_documentation/api_helper.rb +10 -0
  5. data/lib/ctd_documentation/client.rb +140 -0
  6. data/lib/ctd_documentation/configuration.rb +103 -0
  7. data/lib/ctd_documentation/controllers/activities_controller.rb +69 -0
  8. data/lib/ctd_documentation/controllers/alerts_controller.rb +170 -0
  9. data/lib/ctd_documentation/controllers/assets_controller.rb +409 -0
  10. data/lib/ctd_documentation/controllers/base_controller.rb +65 -0
  11. data/lib/ctd_documentation/controllers/custom_attributes_categories_controller.rb +50 -0
  12. data/lib/ctd_documentation/controllers/events_controller.rb +67 -0
  13. data/lib/ctd_documentation/controllers/groups_controller.rb +28 -0
  14. data/lib/ctd_documentation/controllers/insights_controller.rb +111 -0
  15. data/lib/ctd_documentation/controllers/license_controller.rb +73 -0
  16. data/lib/ctd_documentation/controllers/login_controller.rb +31 -0
  17. data/lib/ctd_documentation/controllers/queries_controller.rb +128 -0
  18. data/lib/ctd_documentation/controllers/sensors_controller.rb +26 -0
  19. data/lib/ctd_documentation/controllers/sites_controller.rb +39 -0
  20. data/lib/ctd_documentation/controllers/tasks_controller.rb +148 -0
  21. data/lib/ctd_documentation/controllers/tasks_queries_controller.rb +29 -0
  22. data/lib/ctd_documentation/controllers/users_controller.rb +28 -0
  23. data/lib/ctd_documentation/exceptions/api_exception.rb +10 -0
  24. data/lib/ctd_documentation/exceptions/auth_authenticate401_error_exception.rb +48 -0
  25. data/lib/ctd_documentation/http/auth/custom_header_auth.rb +25 -0
  26. data/lib/ctd_documentation/http/http_call_back.rb +10 -0
  27. data/lib/ctd_documentation/http/http_method_enum.rb +10 -0
  28. data/lib/ctd_documentation/http/http_request.rb +10 -0
  29. data/lib/ctd_documentation/http/http_response.rb +10 -0
  30. data/lib/ctd_documentation/models/actionable.rb +70 -0
  31. data/lib/ctd_documentation/models/actionable_asset.rb +80 -0
  32. data/lib/ctd_documentation/models/actionable_cap.rb +80 -0
  33. data/lib/ctd_documentation/models/actionable_information.rb +80 -0
  34. data/lib/ctd_documentation/models/actionable_policy.rb +361 -0
  35. data/lib/ctd_documentation/models/actionable_related_asset.rb +142 -0
  36. data/lib/ctd_documentation/models/active_history.rb +311 -0
  37. data/lib/ctd_documentation/models/activities_object.rb +150 -0
  38. data/lib/ctd_documentation/models/activities_response.rb +100 -0
  39. data/lib/ctd_documentation/models/activity.rb +150 -0
  40. data/lib/ctd_documentation/models/add_license_response.rb +79 -0
  41. data/lib/ctd_documentation/models/alert.rb +455 -0
  42. data/lib/ctd_documentation/models/alert_severity_enum.rb +23 -0
  43. data/lib/ctd_documentation/models/asset.rb +527 -0
  44. data/lib/ctd_documentation/models/assets_with_insights.rb +252 -0
  45. data/lib/ctd_documentation/models/assets_with_insights_response.rb +90 -0
  46. data/lib/ctd_documentation/models/authenticate.rb +57 -0
  47. data/lib/ctd_documentation/models/base_model.rb +58 -0
  48. data/lib/ctd_documentation/models/base_task.rb +198 -0
  49. data/lib/ctd_documentation/models/cap.rb +90 -0
  50. data/lib/ctd_documentation/models/code_sections.rb +70 -0
  51. data/lib/ctd_documentation/models/content_type_enum.rb +14 -0
  52. data/lib/ctd_documentation/models/create_a_new_query.rb +57 -0
  53. data/lib/ctd_documentation/models/create_a_new_query_response.rb +57 -0
  54. data/lib/ctd_documentation/models/create_group_response.rb +48 -0
  55. data/lib/ctd_documentation/models/create_user_response.rb +48 -0
  56. data/lib/ctd_documentation/models/createanewtask.rb +57 -0
  57. data/lib/ctd_documentation/models/createanewtask_response.rb +57 -0
  58. data/lib/ctd_documentation/models/ctd_login_exception.rb +81 -0
  59. data/lib/ctd_documentation/models/ctd_login_response.rb +101 -0
  60. data/lib/ctd_documentation/models/custom_attribute_category.rb +90 -0
  61. data/lib/ctd_documentation/models/db_statistics.rb +50 -0
  62. data/lib/ctd_documentation/models/delete_a_query_response.rb +48 -0
  63. data/lib/ctd_documentation/models/delete_a_task_response.rb +48 -0
  64. data/lib/ctd_documentation/models/destination_virtual_zone.rb +60 -0
  65. data/lib/ctd_documentation/models/detail.rb +60 -0
  66. data/lib/ctd_documentation/models/discovery_params.rb +82 -0
  67. data/lib/ctd_documentation/models/entity.rb +70 -0
  68. data/lib/ctd_documentation/models/event.rb +175 -0
  69. data/lib/ctd_documentation/models/find_asset_by_id_response.rb +547 -0
  70. data/lib/ctd_documentation/models/format1_enum.rb +22 -0
  71. data/lib/ctd_documentation/models/format_enum.rb +20 -0
  72. data/lib/ctd_documentation/models/get_active_detection_history_response.rb +90 -0
  73. data/lib/ctd_documentation/models/get_alerts_response.rb +90 -0
  74. data/lib/ctd_documentation/models/get_all_sites_response.rb +90 -0
  75. data/lib/ctd_documentation/models/get_assets_response.rb +90 -0
  76. data/lib/ctd_documentation/models/get_custom_attribute_categories_response.rb +90 -0
  77. data/lib/ctd_documentation/models/get_events_response.rb +90 -0
  78. data/lib/ctd_documentation/models/get_license_details_response.rb +81 -0
  79. data/lib/ctd_documentation/models/get_queries_ids_and_assigned_task_response.rb +70 -0
  80. data/lib/ctd_documentation/models/get_queries_response.rb +90 -0
  81. data/lib/ctd_documentation/models/get_tasks_response.rb +90 -0
  82. data/lib/ctd_documentation/models/get_types_response.rb +57 -0
  83. data/lib/ctd_documentation/models/group.rb +73 -0
  84. data/lib/ctd_documentation/models/identifiable.rb +70 -0
  85. data/lib/ctd_documentation/models/indicator_info.rb +90 -0
  86. data/lib/ctd_documentation/models/indicators.rb +122 -0
  87. data/lib/ctd_documentation/models/information.rb +183 -0
  88. data/lib/ctd_documentation/models/insight_status_enum.rb +20 -0
  89. data/lib/ctd_documentation/models/insight_status_exact1_enum.rb +21 -0
  90. data/lib/ctd_documentation/models/insight_status_exact_enum.rb +20 -0
  91. data/lib/ctd_documentation/models/license_request.rb +48 -0
  92. data/lib/ctd_documentation/models/network.rb +80 -0
  93. data/lib/ctd_documentation/models/new_queryobject.rb +199 -0
  94. data/lib/ctd_documentation/models/new_taskobject.rb +199 -0
  95. data/lib/ctd_documentation/models/object.rb +70 -0
  96. data/lib/ctd_documentation/models/paginated_response.rb +71 -0
  97. data/lib/ctd_documentation/models/policy.rb +331 -0
  98. data/lib/ctd_documentation/models/queryextraparams.rb +60 -0
  99. data/lib/ctd_documentation/models/ranger_system_check_response.rb +57 -0
  100. data/lib/ctd_documentation/models/risk_vector.rb +89 -0
  101. data/lib/ctd_documentation/models/selection_params.rb +58 -0
  102. data/lib/ctd_documentation/models/selection_params1.rb +80 -0
  103. data/lib/ctd_documentation/models/site.rb +256 -0
  104. data/lib/ctd_documentation/models/site_list_slim_enum.rb +14 -0
  105. data/lib/ctd_documentation/models/slim_insight.rb +139 -0
  106. data/lib/ctd_documentation/models/sort1_enum.rb +65 -0
  107. data/lib/ctd_documentation/models/sort31_enum.rb +59 -0
  108. data/lib/ctd_documentation/models/sort3_enum.rb +59 -0
  109. data/lib/ctd_documentation/models/sort41_enum.rb +41 -0
  110. data/lib/ctd_documentation/models/sort4_enum.rb +41 -0
  111. data/lib/ctd_documentation/models/sort5_enum.rb +35 -0
  112. data/lib/ctd_documentation/models/sort6_enum.rb +41 -0
  113. data/lib/ctd_documentation/models/sort_enum.rb +125 -0
  114. data/lib/ctd_documentation/models/source_virtual_zone.rb +60 -0
  115. data/lib/ctd_documentation/models/special_hint_enum.rb +26 -0
  116. data/lib/ctd_documentation/models/special_hint_exact_enum.rb +26 -0
  117. data/lib/ctd_documentation/models/status_enum.rb +17 -0
  118. data/lib/ctd_documentation/models/status_exact_enum.rb +23 -0
  119. data/lib/ctd_documentation/models/subnet.rb +50 -0
  120. data/lib/ctd_documentation/models/task.rb +281 -0
  121. data/lib/ctd_documentation/models/taskextraparams.rb +71 -0
  122. data/lib/ctd_documentation/models/update_a_single_query_response.rb +57 -0
  123. data/lib/ctd_documentation/models/update_a_single_task_response.rb +57 -0
  124. data/lib/ctd_documentation/models/update_license_response.rb +79 -0
  125. data/lib/ctd_documentation/models/user.rb +88 -0
  126. data/lib/ctd_documentation/models/virtual_zones.rb +118 -0
  127. data/lib/ctd_documentation/utilities/date_time_helper.rb +11 -0
  128. data/lib/ctd_documentation/utilities/file_wrapper.rb +16 -0
  129. data/lib/ctd_documentation.rb +155 -0
  130. data/test/controllers/controller_test_base.rb +29 -0
  131. data/test/controllers/test_activities_controller.rb +64 -0
  132. data/test/controllers/test_alerts_controller.rb +16 -0
  133. data/test/controllers/test_assets_controller.rb +79 -0
  134. data/test/controllers/test_custom_attributes_categories_controller.rb +52 -0
  135. data/test/controllers/test_events_controller.rb +55 -0
  136. data/test/controllers/test_login_controller.rb +45 -0
  137. data/test/controllers/test_queries_controller.rb +292 -0
  138. data/test/controllers/test_sites_controller.rb +53 -0
  139. data/test/controllers/test_tasks_controller.rb +250 -0
  140. data/test/http_response_catcher.rb +19 -0
  141. metadata +259 -0
@@ -0,0 +1,409 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # AssetsController
8
+ class AssetsController < BaseController
9
+ # Retrieves a list of assets in CTD, with optional filters.
10
+ # Note: All filters are optional.
11
+ # @param [Format1Enum] format Optional parameter: Specifies the type of
12
+ # response (list of fields) returned by the query. If not provided, all
13
+ # asset properties are returned and could affect performance.
14
+ # @param [Integer] page Optional parameter: The page number to be viewed
15
+ # @param [Integer] per_page Optional parameter: Number of Assets to pull per
16
+ # page
17
+ # @param [String] ipv4__exact Optional parameter: IP address of the asset in
18
+ # IPv4 format
19
+ # @param [String] ipv6__exact Optional parameter: IP address of the asset in
20
+ # IPv6 format
21
+ # @param [String] mac__icontains Optional parameter: The MAC address of the
22
+ # device (free text)
23
+ # @param [String] vlan__exact Optional parameter: The VLAN/s of the device
24
+ # @param [String] address__exact Optional parameter: The IP address of this
25
+ # device in the network
26
+ # @param [String] gateway__exact Optional parameter: IP of the Gateway of
27
+ # the Asset's network
28
+ # @param [String] asset_type__exact Optional parameter: CTD Asset type, for
29
+ # example SCADA client, PLC, etc.
30
+ # @param [String] host_name__exact Optional parameter: The host name of this
31
+ # Asset
32
+ # @param [String] os__exact Optional parameter: The name of the operating
33
+ # system
34
+ # @param [String] model__icontains Optional parameter: The Model of this
35
+ # asset (free text)
36
+ # @param [String] vendor__icontains Optional parameter: The Vendor of this
37
+ # asset (free text)
38
+ # @param [String] state__exact Optional parameter: Asset state as selected
39
+ # in the dropdown: 0 = Training 1 = Maintenance 2 = Guest
40
+ # @param [String] domain_names__exact Optional parameter: The exact domain
41
+ # name(s) of the Asset
42
+ # @param [String] firmware__exact Optional parameter: The exact firmware
43
+ # name of the Asset
44
+ # @param [String] serial__exact Optional parameter: The exact serial number
45
+ # of the Asset
46
+ # @param [String] generic__icontains Optional parameter: Custom information
47
+ # (free text)
48
+ # @param [String] display_name__icontains Optional parameter: The name of
49
+ # the Asset (free text)
50
+ # @param [String] criticality__exact Optional parameter: Low, Medium, or
51
+ # High. These CTD values represent how critical the asset itself is to the
52
+ # operation. CTD assigns criticality automatically to certain types of
53
+ # assets but enables you to edit the value.
54
+ # @param [String] old_ip__exact Optional parameter: Previous IPs used by
55
+ # this Asset
56
+ # @param [String] protocol__exact Optional parameter: List of protocols used
57
+ # by this Asset when communicating
58
+ # @param [String] last_seen__exact Optional parameter: The timestamp of the
59
+ # last instance when this device was seen in the network
60
+ # @param [String] q__icontains Optional parameter: Free text for the
61
+ # following Asset info: Name, IP, Version, Model and MAC
62
+ # @param [String] alert_id__exact Optional parameter: The IDs of the alerts
63
+ # triggered by this Asset
64
+ # @param [String] last_updated__gt Optional parameter: The timestamp when
65
+ # the latest change to the Asset was made in the EMC. **Format:**
66
+ # YYYY-MM-DD**T**HH:MM:SS (in UTC) **Example:** 2022-11-01T16:22:05
67
+ # @param [String] baseline__exact Optional parameter: Names of Baselines in
68
+ # which the Asset appears
69
+ # @param [String] arp_baselines__exact Optional parameter: Whether this
70
+ # asset has ARP baselines: True = ARP
71
+ # @param [InsightStatusExact1Enum] insight_status__exact Optional parameter:
72
+ # The status of the Insight associated with this Asset – this is a dropdown
73
+ # for choosing the integer type: 0 = Open 1 = Hidden 2 = Completed
74
+ # @param [String] insights_insight_name__exact Optional parameter: The name
75
+ # of the Insight associated with this Asset
76
+ # @param [String] insight_timestamp__gte Optional parameter: When this
77
+ # Insight was detected; greater (later) than or equal to a specific
78
+ # timestamp
79
+ # @param [String] insight_timestamp__lte Optional parameter: When this
80
+ # Insight was detected; less (earlier) than or equal to a specific
81
+ # timestamp
82
+ # @param [String] baseline_category__exact Optional parameter: The category
83
+ # of the Baseline of this Asset
84
+ # @param [String] baseline_access_type__exact Optional parameter: The access
85
+ # type of the Baseline of this asset
86
+ # @param [String] insight_name__exact Optional parameter: The name of the
87
+ # Insight associated with this Asset
88
+ # @param [String] insight_row_key__exact Optional parameter: The row key of
89
+ # the related Insight
90
+ # @param [TrueClass|FalseClass] ghost__exact Optional parameter: Whether or
91
+ # not this is a ghost asset: TRUE = Ghost
92
+ # @param [String] tasks__exact Optional parameter: Resource ID of the Active
93
+ # Tasks running on this Asset
94
+ # @param [String] active_queries__exact Optional parameter: Resource ID of
95
+ # the Active Queries running on this Asset
96
+ # @param [String] subnet_tag__exact Optional parameter: The device’s network
97
+ # location
98
+ # @param [String] custom_attributes__exact Optional parameter: The values of
99
+ # the (user-defined) Custom Attributes for this Asset
100
+ # @param [String] class_type__exact Optional parameter: The class type of
101
+ # this Asset (IT, OT, IoT)
102
+ # @param [String] domain_name__exact Optional parameter: The domain name of
103
+ # the Asset
104
+ # @param [String] involved_in_tags__exact Optional parameter: Example:
105
+ # @param [String] hosted_tags__icontains Optional parameter: Artifact name
106
+ # (free text)
107
+ # @param [Integer] id__exact Optional parameter: The device’s unique
108
+ # identifier in the system
109
+ # @param [Integer] site_id__exact Optional parameter: The identifier of the
110
+ # Site in which the device resides
111
+ # @param [String] timestamp__exact Optional parameter: The timestamp of when
112
+ # this Asset was detected
113
+ # @param [TrueClass|FalseClass] approved__exact Optional parameter: If the
114
+ # Asset was approved
115
+ # @param [TrueClass|FalseClass] valid__exact Optional parameter: If the
116
+ # Asset is valid: TRUE=valid
117
+ # @param [TrueClass|FalseClass] parsed__exact Optional parameter: Whether or
118
+ # not parsed information (numerical or textual value from the protocols) was
119
+ # incorporated by CTD into the Asset’s baseline
120
+ # @param [SpecialHintExactEnum] special_hint__exact Optional parameter:
121
+ # Example:
122
+ # @param [Integer] risk_level__exact Optional parameter: The CTD level of
123
+ # risk for this device, based on its vulnerabilities, insights, alerts,
124
+ # policies, asset criticality, and network location
125
+ # @param [Integer] network_id__exact Optional parameter: The ID of the
126
+ # network in which this device is located
127
+ # @param [Integer] virtual_zone_id__exact Optional parameter: The group of
128
+ # related assets this device belongs to (e.g. PLC Modbus)
129
+ # @param [Integer] subnet_id__exact Optional parameter: The device’s network
130
+ # location
131
+ # @param [String] purdue_level__exact Optional parameter: The Purdue model
132
+ # level of this specific device (0-6). This value is automatically
133
+ # determined based on the various characteristics of the asset and its
134
+ # purpose. Can be adjusted to reflect the true asset behavior. Also note
135
+ # that interim Purdue levels can also be used, e.g. 1.5, 2.5, 3.5
136
+ # @return [GetAssetsResponse] response from the API call
137
+ def get_assets(format: nil,
138
+ page: nil,
139
+ per_page: nil,
140
+ ipv4__exact: nil,
141
+ ipv6__exact: nil,
142
+ mac__icontains: nil,
143
+ vlan__exact: nil,
144
+ address__exact: nil,
145
+ gateway__exact: nil,
146
+ asset_type__exact: nil,
147
+ host_name__exact: nil,
148
+ os__exact: nil,
149
+ model__icontains: nil,
150
+ vendor__icontains: nil,
151
+ state__exact: nil,
152
+ domain_names__exact: nil,
153
+ firmware__exact: nil,
154
+ serial__exact: nil,
155
+ generic__icontains: nil,
156
+ display_name__icontains: nil,
157
+ criticality__exact: nil,
158
+ old_ip__exact: nil,
159
+ protocol__exact: nil,
160
+ last_seen__exact: nil,
161
+ q__icontains: nil,
162
+ alert_id__exact: nil,
163
+ last_updated__gt: nil,
164
+ baseline__exact: nil,
165
+ arp_baselines__exact: nil,
166
+ insight_status__exact: nil,
167
+ insights_insight_name__exact: nil,
168
+ insight_timestamp__gte: nil,
169
+ insight_timestamp__lte: nil,
170
+ baseline_category__exact: nil,
171
+ baseline_access_type__exact: nil,
172
+ insight_name__exact: nil,
173
+ insight_row_key__exact: nil,
174
+ ghost__exact: nil,
175
+ tasks__exact: nil,
176
+ active_queries__exact: nil,
177
+ subnet_tag__exact: nil,
178
+ custom_attributes__exact: nil,
179
+ class_type__exact: nil,
180
+ domain_name__exact: nil,
181
+ involved_in_tags__exact: nil,
182
+ hosted_tags__icontains: nil,
183
+ id__exact: nil,
184
+ site_id__exact: nil,
185
+ timestamp__exact: nil,
186
+ approved__exact: nil,
187
+ valid__exact: nil,
188
+ parsed__exact: nil,
189
+ special_hint__exact: nil,
190
+ risk_level__exact: nil,
191
+ network_id__exact: nil,
192
+ virtual_zone_id__exact: nil,
193
+ subnet_id__exact: nil,
194
+ purdue_level__exact: nil)
195
+ new_api_call_builder
196
+ .request(new_request_builder(HttpMethodEnum::GET,
197
+ '/ranger/assets',
198
+ Server::DEFAULT)
199
+ .query_param(new_parameter(format, key: 'format'))
200
+ .query_param(new_parameter(page, key: 'page'))
201
+ .query_param(new_parameter(per_page, key: 'per_page'))
202
+ .query_param(new_parameter(ipv4__exact, key: 'ipv4__exact'))
203
+ .query_param(new_parameter(ipv6__exact, key: 'ipv6__exact'))
204
+ .query_param(new_parameter(mac__icontains, key: 'mac__icontains'))
205
+ .query_param(new_parameter(vlan__exact, key: 'vlan__exact'))
206
+ .query_param(new_parameter(address__exact, key: 'address__exact'))
207
+ .query_param(new_parameter(gateway__exact, key: 'gateway__exact'))
208
+ .query_param(new_parameter(asset_type__exact, key: 'asset_type__exact'))
209
+ .query_param(new_parameter(host_name__exact, key: 'host_name__exact'))
210
+ .query_param(new_parameter(os__exact, key: 'os__exact'))
211
+ .query_param(new_parameter(model__icontains, key: 'model__icontains'))
212
+ .query_param(new_parameter(vendor__icontains, key: 'vendor__icontains'))
213
+ .query_param(new_parameter(state__exact, key: 'state__exact'))
214
+ .query_param(new_parameter(domain_names__exact, key: 'domain_names__exact'))
215
+ .query_param(new_parameter(firmware__exact, key: 'firmware__exact'))
216
+ .query_param(new_parameter(serial__exact, key: 'serial__exact'))
217
+ .query_param(new_parameter(generic__icontains, key: 'generic__icontains'))
218
+ .query_param(new_parameter(display_name__icontains, key: 'display_name__icontains'))
219
+ .query_param(new_parameter(criticality__exact, key: 'criticality__exact'))
220
+ .query_param(new_parameter(old_ip__exact, key: 'old_ip__exact'))
221
+ .query_param(new_parameter(protocol__exact, key: 'protocol__exact'))
222
+ .query_param(new_parameter(last_seen__exact, key: 'last_seen__exact'))
223
+ .query_param(new_parameter(q__icontains, key: 'q__icontains'))
224
+ .query_param(new_parameter(alert_id__exact, key: 'alert_id__exact'))
225
+ .query_param(new_parameter(last_updated__gt, key: 'last_updated__gt'))
226
+ .query_param(new_parameter(baseline__exact, key: 'baseline__exact'))
227
+ .query_param(new_parameter(arp_baselines__exact, key: 'arp_baselines__exact'))
228
+ .query_param(new_parameter(insight_status__exact, key: 'insight_status__exact'))
229
+ .query_param(new_parameter(insights_insight_name__exact, key: 'insights_insight_name__exact'))
230
+ .query_param(new_parameter(insight_timestamp__gte, key: 'insight_timestamp__gte'))
231
+ .query_param(new_parameter(insight_timestamp__lte, key: 'insight_timestamp__lte'))
232
+ .query_param(new_parameter(baseline_category__exact, key: 'baseline_category__exact'))
233
+ .query_param(new_parameter(baseline_access_type__exact, key: 'baseline_access_type__exact'))
234
+ .query_param(new_parameter(insight_name__exact, key: 'insight_name__exact'))
235
+ .query_param(new_parameter(insight_row_key__exact, key: 'insight_row_key__exact'))
236
+ .query_param(new_parameter(ghost__exact, key: 'ghost__exact'))
237
+ .query_param(new_parameter(tasks__exact, key: 'tasks__exact'))
238
+ .query_param(new_parameter(active_queries__exact, key: 'active_queries__exact'))
239
+ .query_param(new_parameter(subnet_tag__exact, key: 'subnet_tag__exact'))
240
+ .query_param(new_parameter(custom_attributes__exact, key: 'custom_attributes__exact'))
241
+ .query_param(new_parameter(class_type__exact, key: 'class_type__exact'))
242
+ .query_param(new_parameter(domain_name__exact, key: 'domain_name__exact'))
243
+ .query_param(new_parameter(involved_in_tags__exact, key: 'involved_in_tags__exact'))
244
+ .query_param(new_parameter(hosted_tags__icontains, key: 'hosted_tags__icontains'))
245
+ .query_param(new_parameter(id__exact, key: 'id__exact'))
246
+ .query_param(new_parameter(site_id__exact, key: 'site_id__exact'))
247
+ .query_param(new_parameter(timestamp__exact, key: 'timestamp__exact'))
248
+ .query_param(new_parameter(approved__exact, key: 'approved__exact'))
249
+ .query_param(new_parameter(valid__exact, key: 'valid__exact'))
250
+ .query_param(new_parameter(parsed__exact, key: 'parsed__exact'))
251
+ .query_param(new_parameter(special_hint__exact, key: 'special_hint__exact'))
252
+ .query_param(new_parameter(risk_level__exact, key: 'risk_level__exact'))
253
+ .query_param(new_parameter(network_id__exact, key: 'network_id__exact'))
254
+ .query_param(new_parameter(virtual_zone_id__exact, key: 'virtual_zone_id__exact'))
255
+ .query_param(new_parameter(subnet_id__exact, key: 'subnet_id__exact'))
256
+ .query_param(new_parameter(purdue_level__exact, key: 'purdue_level__exact'))
257
+ .header_param(new_parameter('application/json', key: 'accept'))
258
+ .auth(Single.new('global')))
259
+ .response(new_response_handler
260
+ .deserializer(APIHelper.method(:custom_type_deserializer))
261
+ .deserialize_into(GetAssetsResponse.method(:from_hash)))
262
+ .execute
263
+ end
264
+
265
+ # Find Asset By ID
266
+ # @param [String] resource_id Required parameter: Resource ID of the asset
267
+ # to return
268
+ # @return [FindAssetByIDResponse] response from the API call
269
+ def find_asset_by_id(resource_id)
270
+ new_api_call_builder
271
+ .request(new_request_builder(HttpMethodEnum::GET,
272
+ '/ranger/assets/{resource_id}',
273
+ Server::DEFAULT)
274
+ .template_param(new_parameter(resource_id, key: 'resource_id')
275
+ .should_encode(true))
276
+ .header_param(new_parameter('application/json', key: 'accept'))
277
+ .auth(Single.new('global')))
278
+ .response(new_response_handler
279
+ .deserializer(APIHelper.method(:custom_type_deserializer))
280
+ .deserialize_into(FindAssetByIDResponse.method(:from_hash))
281
+ .local_error('400',
282
+ 'Invalid ID supplied',
283
+ APIException)
284
+ .local_error('404',
285
+ 'Asset not found',
286
+ APIException))
287
+ .execute
288
+ end
289
+
290
+ # Returns Assets with the top 10 highest score Insights.
291
+ # **Note:** The used lookups are optional
292
+ # @param [Integer] page Optional parameter: The actual page offset
293
+ # @param [Integer] per_page Optional parameter: The max number of items to
294
+ # be included in the results
295
+ # @param [String] name__exact Optional parameter: Name of the Asset
296
+ # @param [TrueClass|FalseClass] ghost__exact Optional parameter: Indicates
297
+ # if the asset has only incoming communication, that is, an asset that has
298
+ # never replied
299
+ # @param [Integer] risk_level__exact Optional parameter: Calculation of how
300
+ # vulnerable this Asset is to attacks
301
+ # @param [String] site_name__exact Optional parameter: Name of the Site to
302
+ # which the Asset belongs
303
+ # @param [Integer] network_id__exact Optional parameter: ID of the network
304
+ # to which the Asset belongs
305
+ # @param [String] ipv4__exact Optional parameter: An IPv4 address that
306
+ # related to the Asset
307
+ # @param [String] ipv6__exact Optional parameter: An IPv6 address that
308
+ # related to the Asset
309
+ # @param [String] mac__icontains Optional parameter: The MAC address of the
310
+ # device (free text)
311
+ # @param [String] asset_type__exact Optional parameter: CTD Asset type, for
312
+ # example SCADA client, PLC, etc.
313
+ # @param [String] os__exact Optional parameter: The name of the operating
314
+ # system that runs on the Asset
315
+ # @param [String] model__icontains Optional parameter: The name of the
316
+ # Asset's model
317
+ # @param [String] vendor__icontains Optional parameter: The Asset's vendor
318
+ # name
319
+ # @param [String] firmware__exact Optional parameter: The Asset's firmware
320
+ # @param [Integer] criticality__exact Optional parameter: How critical the
321
+ # Asset is to the overall operation. **Options:** 1 - Low 2 - Medium 3 -
322
+ # High
323
+ # @param [String] insight_cve_id__exact Optional parameter: The ID number of
324
+ # the CVE connected to the Insight
325
+ # @param [Float] insight_cvss__exact Optional parameter: The CVE's score
326
+ # @param [String] insight_title__contains Optional parameter: The CVE's
327
+ # title
328
+ # @param [String] insight_published__exact Optional parameter: The full date
329
+ # when the CVE's was published: **Format:** YYYY-MM-DD HH:MM:SS **Example:**
330
+ # 2016-11-15 06:20:05
331
+ # @param [String] insight_modified__exact Optional parameter: The full date
332
+ # of the latest modification made to the CVE by the global provider.
333
+ # **Format:** YYYY-MM-DD HH:MM:SS **Example:** 2016-11-15 06:20:05
334
+ # @param [Integer] insight_status__exact Optional parameter: A number that
335
+ # represents the CVE's status. **Options:** 0 - Open 1- Hidden 2 -
336
+ # Completed
337
+ # @param [String] insight_identified_on__exact Optional parameter: Timestamp
338
+ # when the CVE was identified. **Format:** YYYY-MM-DD**T**HH:MM:SS (in UTC)
339
+ # **Example:** 2022-11-01T16:22:05
340
+ # @param [String] insight_last_updated__exact Optional parameter: Timestamp
341
+ # when the latest change to the CVE was made in the EMC. **Format:**
342
+ # YYYY-MM-DD**T**HH:MM:SS+00:00 (in UTC) **Example:**
343
+ # 2022-11-01T16:22:05+00:00
344
+ # @param [String] insight_comment__contains Optional parameter: Last comment
345
+ # provided by a user
346
+ # @return [AssetsWithInsightsResponse] response from the API call
347
+ def get_assetswith_insights(page: nil,
348
+ per_page: nil,
349
+ name__exact: nil,
350
+ ghost__exact: nil,
351
+ risk_level__exact: nil,
352
+ site_name__exact: nil,
353
+ network_id__exact: nil,
354
+ ipv4__exact: nil,
355
+ ipv6__exact: nil,
356
+ mac__icontains: nil,
357
+ asset_type__exact: nil,
358
+ os__exact: nil,
359
+ model__icontains: nil,
360
+ vendor__icontains: nil,
361
+ firmware__exact: nil,
362
+ criticality__exact: nil,
363
+ insight_cve_id__exact: nil,
364
+ insight_cvss__exact: nil,
365
+ insight_title__contains: nil,
366
+ insight_published__exact: nil,
367
+ insight_modified__exact: nil,
368
+ insight_status__exact: nil,
369
+ insight_identified_on__exact: nil,
370
+ insight_last_updated__exact: nil,
371
+ insight_comment__contains: nil)
372
+ new_api_call_builder
373
+ .request(new_request_builder(HttpMethodEnum::GET,
374
+ '/ranger/assets_with_insights',
375
+ Server::DEFAULT)
376
+ .query_param(new_parameter(page, key: 'page'))
377
+ .query_param(new_parameter(per_page, key: 'per_page'))
378
+ .query_param(new_parameter(name__exact, key: 'name__exact'))
379
+ .query_param(new_parameter(ghost__exact, key: 'ghost__exact'))
380
+ .query_param(new_parameter(risk_level__exact, key: 'risk_level__exact'))
381
+ .query_param(new_parameter(site_name__exact, key: 'site_name__exact'))
382
+ .query_param(new_parameter(network_id__exact, key: 'network_id__exact'))
383
+ .query_param(new_parameter(ipv4__exact, key: 'ipv4__exact'))
384
+ .query_param(new_parameter(ipv6__exact, key: 'ipv6__exact'))
385
+ .query_param(new_parameter(mac__icontains, key: 'mac__icontains'))
386
+ .query_param(new_parameter(asset_type__exact, key: 'asset_type__exact'))
387
+ .query_param(new_parameter(os__exact, key: 'os__exact'))
388
+ .query_param(new_parameter(model__icontains, key: 'model__icontains'))
389
+ .query_param(new_parameter(vendor__icontains, key: 'vendor__icontains'))
390
+ .query_param(new_parameter(firmware__exact, key: 'firmware__exact'))
391
+ .query_param(new_parameter(criticality__exact, key: 'criticality__exact'))
392
+ .query_param(new_parameter(insight_cve_id__exact, key: 'insight_cve_id__exact'))
393
+ .query_param(new_parameter(insight_cvss__exact, key: 'insight_cvss__exact'))
394
+ .query_param(new_parameter(insight_title__contains, key: 'insight_title__contains'))
395
+ .query_param(new_parameter(insight_published__exact, key: 'insight_published__exact'))
396
+ .query_param(new_parameter(insight_modified__exact, key: 'insight_modified__exact'))
397
+ .query_param(new_parameter(insight_status__exact, key: 'insight_status__exact'))
398
+ .query_param(new_parameter(insight_identified_on__exact, key: 'insight_identified_on__exact'))
399
+ .query_param(new_parameter(insight_last_updated__exact, key: 'insight_last_updated__exact'))
400
+ .query_param(new_parameter(insight_comment__contains, key: 'insight_comment__contains'))
401
+ .header_param(new_parameter('application/json', key: 'accept'))
402
+ .auth(Single.new('global')))
403
+ .response(new_response_handler
404
+ .deserializer(APIHelper.method(:custom_type_deserializer))
405
+ .deserialize_into(AssetsWithInsightsResponse.method(:from_hash)))
406
+ .execute
407
+ end
408
+ end
409
+ end
@@ -0,0 +1,65 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # BaseController.
8
+ class BaseController
9
+ attr_accessor :config, :http_call_back
10
+
11
+ def self.user_agent
12
+ 'APIMATIC 3.0'
13
+ end
14
+
15
+
16
+ GLOBAL_ERRORS = {
17
+ 'default' => ErrorCase.new
18
+ .error_message('HTTP response not OK.')
19
+ .exception_type(APIException)
20
+ }.freeze
21
+
22
+ # Initialization constructor.
23
+ # @param [GlobalConfiguration] global_configuration The instance of GlobalConfiguration.
24
+ def initialize(global_configuration)
25
+ @global_configuration = global_configuration
26
+ @config = @global_configuration.client_configuration
27
+ @http_call_back = @config.http_callback
28
+ @api_call = ApiCall.new(@global_configuration)
29
+ end
30
+
31
+ # Creates a new builder for the Api Call instance.
32
+ # @return [ApiCall] The instance of ApiCall.
33
+ def new_api_call_builder
34
+ @api_call.new_builder
35
+ end
36
+
37
+ # Creates a new instance of the request builder.
38
+ # @param [HttpMethodEnum] http_method The HTTP method to use in the request.
39
+ # @param [String] path The endpoint path to use in the request.
40
+ # @param [String] server The server to extract the base uri for the request.
41
+ # @return [RequestBuilder] The instance of RequestBuilder.
42
+ def new_request_builder(http_method, path, server)
43
+ RequestBuilder.new
44
+ .http_method(http_method)
45
+ .path(path)
46
+ .server(server)
47
+ end
48
+
49
+ # Creates a new instance of the response handler.
50
+ # @return [ResponseHandler] The instance of ResponseHandler.
51
+ def new_response_handler
52
+ ResponseHandler.new
53
+ end
54
+
55
+ # Creates a new instance of the parameter.
56
+ # @param [String|optional] key The key of the parameter.
57
+ # @param [Object] value The value of the parameter.
58
+ # @return [Parameter] The instance of Parameter.
59
+ def new_parameter(value, key: nil)
60
+ Parameter.new
61
+ .key(key)
62
+ .value(value)
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,50 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # CustomAttributesCategoriesController
8
+ class CustomAttributesCategoriesController < BaseController
9
+ # Get Custom Attribute Categories
10
+ # @param [Integer] page Optional parameter: Example:
11
+ # @param [Integer] per_page Optional parameter: Example:
12
+ # @param [Integer] id__exact Optional parameter: Example:
13
+ # @param [Integer] site_id__exact Optional parameter: Example:
14
+ # @param [String] name__contains Optional parameter: Example:
15
+ # @param [String] name__icontains Optional parameter: Example:
16
+ # @param [String] description__icontains Optional parameter: Example:
17
+ # @param [String] description__contains Optional parameter: Example:
18
+ # @param [Sort5Enum] sort Optional parameter: Example:
19
+ # @return [GetCustomAttributeCategoriesResponse] response from the API call
20
+ def get_custom_attribute_categories(page: nil,
21
+ per_page: nil,
22
+ id__exact: nil,
23
+ site_id__exact: nil,
24
+ name__contains: nil,
25
+ name__icontains: nil,
26
+ description__icontains: nil,
27
+ description__contains: nil,
28
+ sort: nil)
29
+ new_api_call_builder
30
+ .request(new_request_builder(HttpMethodEnum::GET,
31
+ '/ranger/custom_attribute_categories',
32
+ Server::DEFAULT)
33
+ .query_param(new_parameter(page, key: 'page'))
34
+ .query_param(new_parameter(per_page, key: 'per_page'))
35
+ .query_param(new_parameter(id__exact, key: 'id__exact'))
36
+ .query_param(new_parameter(site_id__exact, key: 'site_id__exact'))
37
+ .query_param(new_parameter(name__contains, key: 'name__contains'))
38
+ .query_param(new_parameter(name__icontains, key: 'name__icontains'))
39
+ .query_param(new_parameter(description__icontains, key: 'description__icontains'))
40
+ .query_param(new_parameter(description__contains, key: 'description__contains'))
41
+ .query_param(new_parameter(sort, key: 'sort'))
42
+ .header_param(new_parameter('application/json', key: 'accept'))
43
+ .auth(Single.new('global')))
44
+ .response(new_response_handler
45
+ .deserializer(APIHelper.method(:custom_type_deserializer))
46
+ .deserialize_into(GetCustomAttributeCategoriesResponse.method(:from_hash)))
47
+ .execute
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,67 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # EventsController
8
+ class EventsController < BaseController
9
+ # Get Events
10
+ # @param [Integer] page Optional parameter: Example:
11
+ # @param [Integer] per_page Optional parameter: Example:
12
+ # @param [Integer] site_id Optional parameter: Example:
13
+ # @param [String] id__exact Optional parameter: Example:3-1
14
+ # @param [String] alert_id__exact Optional parameter: Example:56-1
15
+ # @param [String] timestamp__exact Optional parameter: Example:
16
+ # @param [String] last_updated__exact Optional parameter: The timestamp when
17
+ # the latest change on the Event was made in the EMC. **Format:**
18
+ # YYYY-MM-DD**T**HH:MM:SS (in UTC) **Example:** 2022-11-01T16:22:05
19
+ # @param [String] description__contains Optional parameter: Example:
20
+ # @param [String] description__icontains Optional parameter: Example:
21
+ # @param [Integer] type__exact Optional parameter: 0: eNewAsset | 1:
22
+ # eAssetConflict | 2: eBaselineDeviation | 3: eThreat | 4:
23
+ # eAssetInformationChange | 5: eProtocolSpecific 6: eBaselineDown | 8:
24
+ # eBaselineVolumeDeviationHigh | 9: eBaselineVolumeDeviationLow | 10:
25
+ # eFTPData 11: eBaselineRule | 12: eHighArpActivity | 13: eKnownThreatEvent
26
+ # | 14: eFalseMac | 15: eSuspiciousFileTransfer 16: ePolicyViolation | 17:
27
+ # ePolicyRuleMatch | 18: eHostScan | 19: ePortScan | 20: eDenialOfService
28
+ # @param [StatusExactEnum] status__exact Optional parameter: Example:
29
+ # @param [Sort6Enum] sort Optional parameter: Example:
30
+ # @return [GetEventsResponse] response from the API call
31
+ def get_events(page: nil,
32
+ per_page: nil,
33
+ site_id: nil,
34
+ id__exact: '3-1',
35
+ alert_id__exact: '56-1',
36
+ timestamp__exact: nil,
37
+ last_updated__exact: nil,
38
+ description__contains: nil,
39
+ description__icontains: nil,
40
+ type__exact: nil,
41
+ status__exact: nil,
42
+ sort: nil)
43
+ new_api_call_builder
44
+ .request(new_request_builder(HttpMethodEnum::GET,
45
+ '/ranger/events',
46
+ Server::DEFAULT)
47
+ .query_param(new_parameter(page, key: 'page'))
48
+ .query_param(new_parameter(per_page, key: 'per_page'))
49
+ .query_param(new_parameter(site_id, key: 'site_id'))
50
+ .query_param(new_parameter(id__exact, key: 'id__exact'))
51
+ .query_param(new_parameter(alert_id__exact, key: 'alert_id__exact'))
52
+ .query_param(new_parameter(timestamp__exact, key: 'timestamp__exact'))
53
+ .query_param(new_parameter(last_updated__exact, key: 'last_updated__exact'))
54
+ .query_param(new_parameter(description__contains, key: 'description__contains'))
55
+ .query_param(new_parameter(description__icontains, key: 'description__icontains'))
56
+ .query_param(new_parameter(type__exact, key: 'type__exact'))
57
+ .query_param(new_parameter(status__exact, key: 'status__exact'))
58
+ .query_param(new_parameter(sort, key: 'sort'))
59
+ .header_param(new_parameter('application/json', key: 'accept'))
60
+ .auth(Single.new('global')))
61
+ .response(new_response_handler
62
+ .deserializer(APIHelper.method(:custom_type_deserializer))
63
+ .deserialize_into(GetEventsResponse.method(:from_hash)))
64
+ .execute
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,28 @@
1
+ # ctd_documentation
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module CtdDocumentation
7
+ # GroupsController
8
+ class GroupsController < BaseController
9
+ # This can only be done by the logged in user.
10
+ # @param [Group] body Required parameter: Created group object
11
+ # @return [CreateGroupResponse] response from the API call
12
+ def create_group(body)
13
+ new_api_call_builder
14
+ .request(new_request_builder(HttpMethodEnum::POST,
15
+ '/auth/groups',
16
+ Server::DEFAULT)
17
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
18
+ .body_param(new_parameter(body))
19
+ .header_param(new_parameter('application/json', key: 'accept'))
20
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
21
+ .auth(Single.new('global')))
22
+ .response(new_response_handler
23
+ .deserializer(APIHelper.method(:custom_type_deserializer))
24
+ .deserialize_into(CreateGroupResponse.method(:from_hash)))
25
+ .execute
26
+ end
27
+ end
28
+ end