instana-client 1.0.0__py3-none-any.whl

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 (515) hide show
  1. instana_client/__init__.py +534 -0
  2. instana_client/api/__init__.py +58 -0
  3. instana_client/api/action_catalog_api.py +1380 -0
  4. instana_client/api/action_history_api.py +1793 -0
  5. instana_client/api/apdex_report_api.py +338 -0
  6. instana_client/api/apdex_settings_api.py +1353 -0
  7. instana_client/api/api_token_api.py +1370 -0
  8. instana_client/api/application_alert_configuration_api.py +2865 -0
  9. instana_client/api/application_analyze_api.py +2017 -0
  10. instana_client/api/application_catalog_api.py +885 -0
  11. instana_client/api/application_metrics_api.py +1211 -0
  12. instana_client/api/application_resources_api.py +1487 -0
  13. instana_client/api/application_settings_api.py +7261 -0
  14. instana_client/api/application_topology_api.py +354 -0
  15. instana_client/api/audit_log_api.py +635 -0
  16. instana_client/api/authentication_api.py +1008 -0
  17. instana_client/api/business_monitoring_api.py +2177 -0
  18. instana_client/api/custom_dashboards_api.py +1930 -0
  19. instana_client/api/event_settings_api.py +14613 -0
  20. instana_client/api/events_api.py +1654 -0
  21. instana_client/api/global_application_alert_configuration_api.py +2606 -0
  22. instana_client/api/groups_api.py +4078 -0
  23. instana_client/api/health_api.py +527 -0
  24. instana_client/api/host_agent_api.py +2120 -0
  25. instana_client/api/infrastructure_alert_configuration_api.py +2524 -0
  26. instana_client/api/infrastructure_analyze_api.py +1141 -0
  27. instana_client/api/infrastructure_catalog_api.py +1822 -0
  28. instana_client/api/infrastructure_metrics_api.py +331 -0
  29. instana_client/api/infrastructure_resources_api.py +1880 -0
  30. instana_client/api/infrastructure_topology_api.py +595 -0
  31. instana_client/api/log_alert_configuration_api.py +2524 -0
  32. instana_client/api/maintenance_configuration_api.py +2683 -0
  33. instana_client/api/mobile_app_analyze_api.py +613 -0
  34. instana_client/api/mobile_app_catalog_api.py +825 -0
  35. instana_client/api/mobile_app_configuration_api.py +2847 -0
  36. instana_client/api/mobile_app_metrics_api.py +892 -0
  37. instana_client/api/policies_api.py +1755 -0
  38. instana_client/api/releases_api.py +1408 -0
  39. instana_client/api/service_levels_alert_configuration_api.py +2577 -0
  40. instana_client/api/service_levels_objective_slo_configurations_api.py +1825 -0
  41. instana_client/api/service_levels_objective_slo_report_api.py +335 -0
  42. instana_client/api/session_settings_api.py +801 -0
  43. instana_client/api/sli_report_api.py +352 -0
  44. instana_client/api/sli_settings_api.py +2677 -0
  45. instana_client/api/synthetic_alert_configuration_api.py +2606 -0
  46. instana_client/api/synthetic_calls_api.py +789 -0
  47. instana_client/api/synthetic_catalog_api.py +543 -0
  48. instana_client/api/synthetic_metrics_api.py +322 -0
  49. instana_client/api/synthetic_settings_api.py +5144 -0
  50. instana_client/api/synthetic_test_playback_results_api.py +2142 -0
  51. instana_client/api/usage_api.py +1404 -0
  52. instana_client/api/user_api.py +2404 -0
  53. instana_client/api/website_analyze_api.py +619 -0
  54. instana_client/api/website_catalog_api.py +832 -0
  55. instana_client/api/website_configuration_api.py +3745 -0
  56. instana_client/api/website_metrics_api.py +889 -0
  57. instana_client/api_client.py +798 -0
  58. instana_client/api_response.py +21 -0
  59. instana_client/configuration.py +616 -0
  60. instana_client/exceptions.py +217 -0
  61. instana_client/models/__init__.py +464 -0
  62. instana_client/models/abstract_integration.py +155 -0
  63. instana_client/models/abstract_rule.py +124 -0
  64. instana_client/models/access_log_entry.py +105 -0
  65. instana_client/models/access_log_response.py +98 -0
  66. instana_client/models/access_rule.py +107 -0
  67. instana_client/models/action.py +135 -0
  68. instana_client/models/action_configuration.py +104 -0
  69. instana_client/models/action_instance.py +185 -0
  70. instana_client/models/action_instance_metadata_entry.py +90 -0
  71. instana_client/models/action_instance_parameter.py +94 -0
  72. instana_client/models/action_instance_request.py +108 -0
  73. instana_client/models/action_instance_request_parameters.py +92 -0
  74. instana_client/models/action_match.py +98 -0
  75. instana_client/models/action_search_space.py +94 -0
  76. instana_client/models/adaptive_baseline.py +92 -0
  77. instana_client/models/adaptive_threshold_rule.py +91 -0
  78. instana_client/models/adjusted_timeframe.py +91 -0
  79. instana_client/models/agent_configuration_update.py +93 -0
  80. instana_client/models/alerting_configuration.py +113 -0
  81. instana_client/models/alerting_configuration_with_last_updated.py +115 -0
  82. instana_client/models/alerting_time_window.py +109 -0
  83. instana_client/models/apdex_configuration.py +99 -0
  84. instana_client/models/apdex_configuration_input.py +95 -0
  85. instana_client/models/apdex_entity.py +119 -0
  86. instana_client/models/apdex_report.py +94 -0
  87. instana_client/models/api_create_group.py +104 -0
  88. instana_client/models/api_group.py +107 -0
  89. instana_client/models/api_member.py +90 -0
  90. instana_client/models/api_permission_set.py +178 -0
  91. instana_client/models/api_restricted_application_filter.py +108 -0
  92. instana_client/models/api_token.py +250 -0
  93. instana_client/models/app_data_metric_configuration.py +105 -0
  94. instana_client/models/application.py +104 -0
  95. instana_client/models/application_alert_config.py +203 -0
  96. instana_client/models/application_alert_config_with_metadata.py +213 -0
  97. instana_client/models/application_alert_rule.py +135 -0
  98. instana_client/models/application_apdex_entity.py +111 -0
  99. instana_client/models/application_config.py +131 -0
  100. instana_client/models/application_event_result.py +108 -0
  101. instana_client/models/application_item.py +94 -0
  102. instana_client/models/application_metric_result.py +109 -0
  103. instana_client/models/application_node.py +106 -0
  104. instana_client/models/application_result.py +102 -0
  105. instana_client/models/application_scope.py +89 -0
  106. instana_client/models/application_scope_with_metadata.py +90 -0
  107. instana_client/models/application_sli_entity.py +103 -0
  108. instana_client/models/application_slo_entity.py +112 -0
  109. instana_client/models/application_time_threshold.py +115 -0
  110. instana_client/models/audit_log_entry.py +102 -0
  111. instana_client/models/audit_log_ui_response.py +98 -0
  112. instana_client/models/author.py +100 -0
  113. instana_client/models/availability_blueprint_indicator.py +106 -0
  114. instana_client/models/availability_sli_entity.py +138 -0
  115. instana_client/models/available_metrics.py +96 -0
  116. instana_client/models/available_plugins.py +88 -0
  117. instana_client/models/backend_trace_reference.py +88 -0
  118. instana_client/models/binary_operator_dto.py +107 -0
  119. instana_client/models/browser_script_configuration.py +127 -0
  120. instana_client/models/built_in_event_specification.py +123 -0
  121. instana_client/models/built_in_event_specification_with_last_updated.py +125 -0
  122. instana_client/models/business_activity.py +132 -0
  123. instana_client/models/business_perspective_config.py +99 -0
  124. instana_client/models/call_groups_item.py +95 -0
  125. instana_client/models/call_groups_result.py +111 -0
  126. instana_client/models/call_relation.py +100 -0
  127. instana_client/models/change_summary.py +101 -0
  128. instana_client/models/cloudfoundry_physical_context.py +104 -0
  129. instana_client/models/condition.py +88 -0
  130. instana_client/models/config_version.py +101 -0
  131. instana_client/models/crash_mobile_app_alert_rule.py +90 -0
  132. instana_client/models/cursor_paginated_business_activity_item.py +96 -0
  133. instana_client/models/cursor_pagination.py +93 -0
  134. instana_client/models/cursor_pagination_infra_explore_cursor.py +90 -0
  135. instana_client/models/custom_blueprint_indicator.py +104 -0
  136. instana_client/models/custom_dashboard.py +111 -0
  137. instana_client/models/custom_dashboard_preview.py +103 -0
  138. instana_client/models/custom_email_subject_prefix.py +94 -0
  139. instana_client/models/custom_event_mobile_app_alert_rule.py +92 -0
  140. instana_client/models/custom_event_specification.py +133 -0
  141. instana_client/models/custom_event_specification_with_last_updated.py +143 -0
  142. instana_client/models/custom_event_website_alert_rule.py +92 -0
  143. instana_client/models/custom_payload_configuration.py +97 -0
  144. instana_client/models/custom_payload_field.py +112 -0
  145. instana_client/models/custom_payload_with_last_updated.py +99 -0
  146. instana_client/models/dashboard_api_token.py +90 -0
  147. instana_client/models/database_integration.py +90 -0
  148. instana_client/models/deprecated_tag_filter.py +111 -0
  149. instana_client/models/dns_action_configuration.py +134 -0
  150. instana_client/models/dns_action_filter_query_time.py +99 -0
  151. instana_client/models/dns_action_filter_target_value.py +106 -0
  152. instana_client/models/duration.py +98 -0
  153. instana_client/models/dynamic_field.py +95 -0
  154. instana_client/models/dynamic_field_value.py +90 -0
  155. instana_client/models/dynamic_parameter.py +94 -0
  156. instana_client/models/edit_user.py +88 -0
  157. instana_client/models/email_integration.py +98 -0
  158. instana_client/models/empty_configuration.py +92 -0
  159. instana_client/models/endpoint.py +131 -0
  160. instana_client/models/endpoint_config.py +112 -0
  161. instana_client/models/endpoint_event_result.py +112 -0
  162. instana_client/models/endpoint_item.py +94 -0
  163. instana_client/models/endpoint_metric_result.py +109 -0
  164. instana_client/models/endpoint_node.py +91 -0
  165. instana_client/models/endpoint_result.py +102 -0
  166. instana_client/models/endpoint_simple.py +102 -0
  167. instana_client/models/entity_count_rule.py +100 -0
  168. instana_client/models/entity_count_verification_rule.py +114 -0
  169. instana_client/models/entity_health_info.py +99 -0
  170. instana_client/models/entity_id.py +92 -0
  171. instana_client/models/entity_verification_rule.py +105 -0
  172. instana_client/models/error_budget_alert_rule.py +97 -0
  173. instana_client/models/errors_application_alert_rule.py +90 -0
  174. instana_client/models/event.py +127 -0
  175. instana_client/models/event_filtering_configuration.py +106 -0
  176. instana_client/models/event_result.py +145 -0
  177. instana_client/models/event_specification_info.py +114 -0
  178. instana_client/models/extended_service.py +123 -0
  179. instana_client/models/failure_synthetic_alert_rule.py +90 -0
  180. instana_client/models/fixed_http_path_segment_matching_rule.py +90 -0
  181. instana_client/models/fixed_time_window.py +93 -0
  182. instana_client/models/full_trace.py +97 -0
  183. instana_client/models/generic_infra_alert_rule.py +93 -0
  184. instana_client/models/geo_location_configuration.py +106 -0
  185. instana_client/models/geo_mapping_rule.py +120 -0
  186. instana_client/models/geo_subdivision.py +91 -0
  187. instana_client/models/get_activities.py +115 -0
  188. instana_client/models/get_application_metrics.py +112 -0
  189. instana_client/models/get_applications.py +150 -0
  190. instana_client/models/get_available_metrics_query.py +103 -0
  191. instana_client/models/get_available_plugins_query.py +98 -0
  192. instana_client/models/get_call_groups.py +141 -0
  193. instana_client/models/get_combined_metrics.py +103 -0
  194. instana_client/models/get_dynamic_parameter_values.py +100 -0
  195. instana_client/models/get_endpoints.py +150 -0
  196. instana_client/models/get_infrastructure_groups_query.py +127 -0
  197. instana_client/models/get_infrastructure_query.py +127 -0
  198. instana_client/models/get_metrics_result.py +128 -0
  199. instana_client/models/get_mobile_app_beacon_groups.py +146 -0
  200. instana_client/models/get_mobile_app_beacons.py +118 -0
  201. instana_client/models/get_mobile_app_metrics.py +122 -0
  202. instana_client/models/get_mobile_app_metrics_v2.py +118 -0
  203. instana_client/models/get_payload_keys_result.py +88 -0
  204. instana_client/models/get_services.py +147 -0
  205. instana_client/models/get_snapshots_query.py +95 -0
  206. instana_client/models/get_test_result.py +139 -0
  207. instana_client/models/get_test_result_base.py +120 -0
  208. instana_client/models/get_test_result_list.py +125 -0
  209. instana_client/models/get_test_summary_result.py +130 -0
  210. instana_client/models/get_trace_download_result_item.py +114 -0
  211. instana_client/models/get_trace_groups.py +141 -0
  212. instana_client/models/get_traces.py +125 -0
  213. instana_client/models/get_website_beacon_groups.py +146 -0
  214. instana_client/models/get_website_beacons.py +118 -0
  215. instana_client/models/get_website_metrics.py +122 -0
  216. instana_client/models/get_website_metrics_v2.py +118 -0
  217. instana_client/models/global_application_alert_config_with_metadata.py +205 -0
  218. instana_client/models/global_applications_alert_config.py +191 -0
  219. instana_client/models/google_chat_integration.py +92 -0
  220. instana_client/models/graph_edge.py +102 -0
  221. instana_client/models/graph_node.py +100 -0
  222. instana_client/models/group.py +100 -0
  223. instana_client/models/group_by_tag.py +90 -0
  224. instana_client/models/group_mapping.py +95 -0
  225. instana_client/models/health_state.py +100 -0
  226. instana_client/models/historic_baseline.py +105 -0
  227. instana_client/models/host_availability_rule.py +100 -0
  228. instana_client/models/http_action_configuration.py +127 -0
  229. instana_client/models/http_endpoint_config.py +103 -0
  230. instana_client/models/http_endpoint_rule.py +101 -0
  231. instana_client/models/http_path_segment_matching_rule.py +124 -0
  232. instana_client/models/http_script_configuration.py +113 -0
  233. instana_client/models/hyper_param.py +111 -0
  234. instana_client/models/identity_provider_patch.py +88 -0
  235. instana_client/models/infra_alert_config.py +166 -0
  236. instana_client/models/infra_alert_config_with_metadata.py +176 -0
  237. instana_client/models/infra_alert_rule.py +133 -0
  238. instana_client/models/infra_event_result.py +109 -0
  239. instana_client/models/infra_metric_configuration.py +115 -0
  240. instana_client/models/infra_time_threshold.py +109 -0
  241. instana_client/models/infrastructure_entities_result.py +109 -0
  242. instana_client/models/infrastructure_group.py +92 -0
  243. instana_client/models/infrastructure_groups_result.py +109 -0
  244. instana_client/models/infrastructure_item.py +104 -0
  245. instana_client/models/infrastructure_metric_result.py +96 -0
  246. instana_client/models/instana_version_info.py +92 -0
  247. instana_client/models/integration_overview.py +94 -0
  248. instana_client/models/invitation.py +94 -0
  249. instana_client/models/invitation_response.py +96 -0
  250. instana_client/models/invitation_result.py +100 -0
  251. instana_client/models/ip_masking_configuration.py +95 -0
  252. instana_client/models/js_stack_trace_line.py +99 -0
  253. instana_client/models/kubernetes_physical_context.py +107 -0
  254. instana_client/models/latency_blueprint_indicator.py +106 -0
  255. instana_client/models/location_status.py +96 -0
  256. instana_client/models/log_alert_config.py +154 -0
  257. instana_client/models/log_alert_config_with_metadata.py +164 -0
  258. instana_client/models/log_alert_rule.py +120 -0
  259. instana_client/models/log_count_alert_rule.py +90 -0
  260. instana_client/models/log_entry_actor.py +101 -0
  261. instana_client/models/log_event_result.py +107 -0
  262. instana_client/models/log_time_threshold.py +109 -0
  263. instana_client/models/logs_application_alert_rule.py +122 -0
  264. instana_client/models/maintenance_config.py +103 -0
  265. instana_client/models/maintenance_config_scheduling.py +118 -0
  266. instana_client/models/maintenance_config_v2.py +111 -0
  267. instana_client/models/maintenance_config_v2_with_state_and_occurrence.py +131 -0
  268. instana_client/models/maintenance_config_with_last_updated.py +105 -0
  269. instana_client/models/maintenance_window.py +93 -0
  270. instana_client/models/manual_alerting_channel_configuration.py +99 -0
  271. instana_client/models/manual_close_info.py +99 -0
  272. instana_client/models/manual_service_config.py +103 -0
  273. instana_client/models/match_all_http_path_segment_matching_rule.py +88 -0
  274. instana_client/models/match_expression_dto.py +111 -0
  275. instana_client/models/meta_data.py +96 -0
  276. instana_client/models/metric_api_result.py +94 -0
  277. instana_client/models/metric_config.py +99 -0
  278. instana_client/models/metric_configuration.py +103 -0
  279. instana_client/models/metric_description.py +116 -0
  280. instana_client/models/metric_instance.py +105 -0
  281. instana_client/models/metric_item.py +102 -0
  282. instana_client/models/metric_metadata.py +132 -0
  283. instana_client/models/metric_pattern.py +101 -0
  284. instana_client/models/metrics_result.py +96 -0
  285. instana_client/models/metrics_result_item.py +100 -0
  286. instana_client/models/metrics_test_result_item.py +102 -0
  287. instana_client/models/mobile_app.py +91 -0
  288. instana_client/models/mobile_app_alert_config.py +162 -0
  289. instana_client/models/mobile_app_alert_rule.py +129 -0
  290. instana_client/models/mobile_app_beacon_groups_item.py +95 -0
  291. instana_client/models/mobile_app_beacon_groups_result.py +111 -0
  292. instana_client/models/mobile_app_beacon_result.py +111 -0
  293. instana_client/models/mobile_app_beacon_tag_group.py +100 -0
  294. instana_client/models/mobile_app_beacons_item.py +94 -0
  295. instana_client/models/mobile_app_event_result.py +108 -0
  296. instana_client/models/mobile_app_metric_result.py +88 -0
  297. instana_client/models/mobile_app_monitoring_beacon.py +259 -0
  298. instana_client/models/mobile_app_monitoring_metric_description.py +123 -0
  299. instana_client/models/mobile_app_monitoring_metrics_configuration.py +105 -0
  300. instana_client/models/mobile_app_time_threshold.py +115 -0
  301. instana_client/models/model_field.py +96 -0
  302. instana_client/models/monitoring_state.py +92 -0
  303. instana_client/models/multiple_scripts_configuration.py +90 -0
  304. instana_client/models/new_application_config.py +129 -0
  305. instana_client/models/new_business_perspective_config.py +97 -0
  306. instana_client/models/new_manual_service_config.py +100 -0
  307. instana_client/models/occurrence.py +91 -0
  308. instana_client/models/office365_integration.py +92 -0
  309. instana_client/models/one_time_maintenance_window.py +94 -0
  310. instana_client/models/opsgenie_integration.py +105 -0
  311. instana_client/models/order.py +99 -0
  312. instana_client/models/pagerduty_integration.py +92 -0
  313. instana_client/models/paginated_result.py +95 -0
  314. instana_client/models/pagination.py +91 -0
  315. instana_client/models/parameter.py +102 -0
  316. instana_client/models/parameter_value.py +90 -0
  317. instana_client/models/path_parameter_http_path_segment_matching_rule.py +90 -0
  318. instana_client/models/physical_context.py +119 -0
  319. instana_client/models/plugin_result.py +90 -0
  320. instana_client/models/policy.py +113 -0
  321. instana_client/models/policy_runnable.py +103 -0
  322. instana_client/models/post_snapshots_result.py +98 -0
  323. instana_client/models/problem.py +95 -0
  324. instana_client/models/prometheus_webhook_integration.py +94 -0
  325. instana_client/models/recurrent_maintenance_window.py +98 -0
  326. instana_client/models/release.py +111 -0
  327. instana_client/models/release_scope.py +94 -0
  328. instana_client/models/release_with_metadata.py +125 -0
  329. instana_client/models/rolling_time_window.py +90 -0
  330. instana_client/models/rule_input.py +98 -0
  331. instana_client/models/rule_with_threshold_application_alert_rule.py +116 -0
  332. instana_client/models/rule_with_threshold_infra_alert_rule.py +116 -0
  333. instana_client/models/rule_with_threshold_log_alert_rule.py +116 -0
  334. instana_client/models/rule_with_threshold_mobile_app_alert_rule.py +116 -0
  335. instana_client/models/rule_with_threshold_website_alert_rule.py +116 -0
  336. instana_client/models/run_configuration.py +96 -0
  337. instana_client/models/salesforce_integration.py +98 -0
  338. instana_client/models/scope_binding.py +91 -0
  339. instana_client/models/search_field_result.py +116 -0
  340. instana_client/models/service.py +116 -0
  341. instana_client/models/service_config.py +107 -0
  342. instana_client/models/service_event_result.py +110 -0
  343. instana_client/models/service_item.py +94 -0
  344. instana_client/models/service_level_indicator.py +172 -0
  345. instana_client/models/service_level_objective_alert_rule.py +100 -0
  346. instana_client/models/service_level_objective_configuration.py +118 -0
  347. instana_client/models/service_levels_alert_config.py +133 -0
  348. instana_client/models/service_levels_alert_rule.py +111 -0
  349. instana_client/models/service_levels_burn_rate_time_windows.py +97 -0
  350. instana_client/models/service_levels_time_threshold.py +90 -0
  351. instana_client/models/service_levelse_alert_config_with_metadata.py +143 -0
  352. instana_client/models/service_map.py +106 -0
  353. instana_client/models/service_map_connection.py +97 -0
  354. instana_client/models/service_matching_rule.py +90 -0
  355. instana_client/models/service_metric_result.py +109 -0
  356. instana_client/models/service_node.py +106 -0
  357. instana_client/models/service_now_enhanced_integration.py +116 -0
  358. instana_client/models/service_now_integration.py +98 -0
  359. instana_client/models/service_result.py +102 -0
  360. instana_client/models/service_scope.py +95 -0
  361. instana_client/models/service_scope_with_metadata.py +96 -0
  362. instana_client/models/service_scoped_to.py +97 -0
  363. instana_client/models/service_scoped_to_with_metadata.py +97 -0
  364. instana_client/models/service_simple.py +90 -0
  365. instana_client/models/session_settings.py +91 -0
  366. instana_client/models/slack_integration.py +98 -0
  367. instana_client/models/sli_configuration.py +105 -0
  368. instana_client/models/sli_configuration_with_last_updated.py +107 -0
  369. instana_client/models/sli_entity.py +117 -0
  370. instana_client/models/sli_report.py +100 -0
  371. instana_client/models/slo_entity.py +119 -0
  372. instana_client/models/slo_report.py +112 -0
  373. instana_client/models/slowness_application_alert_rule.py +90 -0
  374. instana_client/models/slowness_website_alert_rule.py +90 -0
  375. instana_client/models/snapshot_item.py +102 -0
  376. instana_client/models/snapshot_preview.py +97 -0
  377. instana_client/models/snapshot_result.py +96 -0
  378. instana_client/models/software_user.py +94 -0
  379. instana_client/models/software_version.py +124 -0
  380. instana_client/models/source_map_file_blob.py +92 -0
  381. instana_client/models/source_map_file_meta.py +115 -0
  382. instana_client/models/source_map_upload_config.py +106 -0
  383. instana_client/models/span.py +156 -0
  384. instana_client/models/span_excerpt.py +132 -0
  385. instana_client/models/span_relation.py +114 -0
  386. instana_client/models/specific_js_errors_website_alert_rule.py +101 -0
  387. instana_client/models/splunk_integration.py +94 -0
  388. instana_client/models/ssl_certificate_configuration.py +99 -0
  389. instana_client/models/stack_trace_item.py +92 -0
  390. instana_client/models/stack_trace_line.py +99 -0
  391. instana_client/models/static_baseline_threshold_rule.py +102 -0
  392. instana_client/models/static_string_field.py +91 -0
  393. instana_client/models/static_threshold.py +94 -0
  394. instana_client/models/static_threshold_rule.py +91 -0
  395. instana_client/models/status_code_application_alert_rule.py +95 -0
  396. instana_client/models/status_code_mobile_app_alert_rule.py +101 -0
  397. instana_client/models/status_code_website_alert_rule.py +101 -0
  398. instana_client/models/synthetic_alert_config.py +127 -0
  399. instana_client/models/synthetic_alert_config_with_metadata.py +137 -0
  400. instana_client/models/synthetic_alert_rule.py +120 -0
  401. instana_client/models/synthetic_call_config.py +99 -0
  402. instana_client/models/synthetic_call_rule.py +99 -0
  403. instana_client/models/synthetic_call_with_defaults_config.py +108 -0
  404. instana_client/models/synthetic_credential.py +111 -0
  405. instana_client/models/synthetic_datacenter.py +117 -0
  406. instana_client/models/synthetic_datacenter_configuration.py +88 -0
  407. instana_client/models/synthetic_geo_point.py +94 -0
  408. instana_client/models/synthetic_location.py +129 -0
  409. instana_client/models/synthetic_location_configuration.py +102 -0
  410. instana_client/models/synthetic_metric_configuration.py +99 -0
  411. instana_client/models/synthetic_metric_tag_group.py +100 -0
  412. instana_client/models/synthetic_playback_capabilities.py +98 -0
  413. instana_client/models/synthetic_slo_entity.py +95 -0
  414. instana_client/models/synthetic_test.py +149 -0
  415. instana_client/models/synthetic_time_threshold.py +110 -0
  416. instana_client/models/synthetic_type_configuration.py +141 -0
  417. instana_client/models/synthetics_event_result.py +110 -0
  418. instana_client/models/system_rule.py +91 -0
  419. instana_client/models/system_rule_label.py +90 -0
  420. instana_client/models/tag.py +123 -0
  421. instana_client/models/tag_catalog.py +106 -0
  422. instana_client/models/tag_filter.py +113 -0
  423. instana_client/models/tag_filter_expression.py +106 -0
  424. instana_client/models/tag_filter_expression_element.py +111 -0
  425. instana_client/models/tag_matcher_dto.py +110 -0
  426. instana_client/models/tag_tree_level.py +109 -0
  427. instana_client/models/tag_tree_node.py +113 -0
  428. instana_client/models/tag_tree_tag.py +103 -0
  429. instana_client/models/test_common_properties.py +136 -0
  430. instana_client/models/test_result.py +105 -0
  431. instana_client/models/test_result_common_properties.py +108 -0
  432. instana_client/models/test_result_detail_data.py +112 -0
  433. instana_client/models/test_result_item.py +106 -0
  434. instana_client/models/test_result_list_item.py +94 -0
  435. instana_client/models/test_result_list_result.py +103 -0
  436. instana_client/models/test_result_metadata.py +94 -0
  437. instana_client/models/test_result_subtransaction.py +90 -0
  438. instana_client/models/threshold.py +122 -0
  439. instana_client/models/threshold_config_rule.py +114 -0
  440. instana_client/models/threshold_rule.py +125 -0
  441. instana_client/models/throughput_application_alert_rule.py +90 -0
  442. instana_client/models/throughput_mobile_app_alert_rule.py +90 -0
  443. instana_client/models/throughput_website_alert_rule.py +90 -0
  444. instana_client/models/time_frame.py +91 -0
  445. instana_client/models/time_window.py +120 -0
  446. instana_client/models/topology.py +106 -0
  447. instana_client/models/trace.py +109 -0
  448. instana_client/models/trace_activity_tree_node_details.py +139 -0
  449. instana_client/models/trace_download_result.py +111 -0
  450. instana_client/models/trace_groups_item.py +95 -0
  451. instana_client/models/trace_groups_result.py +111 -0
  452. instana_client/models/trace_impact_application_time_threshold.py +92 -0
  453. instana_client/models/trace_item.py +94 -0
  454. instana_client/models/trace_result.py +111 -0
  455. instana_client/models/traffic_blueprint_indicator.py +104 -0
  456. instana_client/models/trigger.py +99 -0
  457. instana_client/models/type_configuration.py +107 -0
  458. instana_client/models/unsupported_http_path_segment_matching_rule.py +90 -0
  459. instana_client/models/updated_business_perspective_config.py +97 -0
  460. instana_client/models/usage_result.py +98 -0
  461. instana_client/models/usage_result_items.py +90 -0
  462. instana_client/models/user_basic_result.py +92 -0
  463. instana_client/models/user_impact_mobile_app_time_threshold.py +103 -0
  464. instana_client/models/user_impact_website_time_threshold.py +103 -0
  465. instana_client/models/user_result.py +98 -0
  466. instana_client/models/users_result.py +106 -0
  467. instana_client/models/validated_alerting_channel_input_info.py +123 -0
  468. instana_client/models/validated_alerting_configuration.py +121 -0
  469. instana_client/models/validated_maintenance_config_v2_with_state_and_occurrence.py +135 -0
  470. instana_client/models/validated_maintenance_config_with_status.py +116 -0
  471. instana_client/models/victor_ops_integration.py +94 -0
  472. instana_client/models/violations_in_period_application_time_threshold.py +92 -0
  473. instana_client/models/violations_in_period_mobile_app_time_threshold.py +92 -0
  474. instana_client/models/violations_in_period_website_time_threshold.py +92 -0
  475. instana_client/models/violations_in_sequence_application_time_threshold.py +89 -0
  476. instana_client/models/violations_in_sequence_infra_time_threshold.py +89 -0
  477. instana_client/models/violations_in_sequence_log_time_threshold.py +89 -0
  478. instana_client/models/violations_in_sequence_mobile_app_time_threshold.py +89 -0
  479. instana_client/models/violations_in_sequence_synthetic_time_threshold.py +89 -0
  480. instana_client/models/violations_in_sequence_website_time_threshold.py +89 -0
  481. instana_client/models/watson_ai_ops_webhook_integration.py +94 -0
  482. instana_client/models/webex_teams_webhook_integration.py +92 -0
  483. instana_client/models/webhook_integration.py +94 -0
  484. instana_client/models/webpage_action_configuration.py +109 -0
  485. instana_client/models/webpage_script_configuration.py +109 -0
  486. instana_client/models/website.py +92 -0
  487. instana_client/models/website_alert_config.py +166 -0
  488. instana_client/models/website_alert_config_with_metadata.py +176 -0
  489. instana_client/models/website_alert_rule.py +132 -0
  490. instana_client/models/website_apdex_entity.py +107 -0
  491. instana_client/models/website_beacon_groups_item.py +95 -0
  492. instana_client/models/website_beacon_groups_result.py +111 -0
  493. instana_client/models/website_beacon_result.py +111 -0
  494. instana_client/models/website_beacon_tag_group.py +100 -0
  495. instana_client/models/website_beacons_item.py +94 -0
  496. instana_client/models/website_event_based_sli_entity.py +110 -0
  497. instana_client/models/website_event_result.py +108 -0
  498. instana_client/models/website_metric_result.py +88 -0
  499. instana_client/models/website_monitoring_beacon.py +301 -0
  500. instana_client/models/website_monitoring_metric_description.py +123 -0
  501. instana_client/models/website_monitoring_metrics_configuration.py +99 -0
  502. instana_client/models/website_slo_entity.py +104 -0
  503. instana_client/models/website_time_based_sli_entity.py +105 -0
  504. instana_client/models/website_time_threshold.py +115 -0
  505. instana_client/models/widget.py +103 -0
  506. instana_client/models/with_metadata.py +172 -0
  507. instana_client/models/with_resolved_name.py +102 -0
  508. instana_client/models/z_chat_ops_integration.py +97 -0
  509. instana_client/py.typed +0 -0
  510. instana_client/rest.py +258 -0
  511. instana_client-1.0.0.dist-info/METADATA +25 -0
  512. instana_client-1.0.0.dist-info/RECORD +515 -0
  513. instana_client-1.0.0.dist-info/WHEEL +5 -0
  514. instana_client-1.0.0.dist-info/licenses/LICENSE +202 -0
  515. instana_client-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1755 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Instana REST API documentation
5
+
6
+ Searching for answers and best pratices? Check our [IBM Instana Community](https://community.ibm.com/community/user/aiops/communities/community-home?CommunityKey=58f324a3-3104-41be-9510-5b7c413cc48f). ## Overview The Instana REST API provides programmatic access to the Instana platform. It can be used to retrieve data available through the Instana UI Dashboard -- metrics, events, traces, etc -- and also to automate configuration tasks such as user management. ### Navigating the API documentation The API endpoints are grouped by product area and functionality. This generally maps to how our UI Dashboard is organized, hopefully making it easier to locate which endpoints you'd use to fetch the data you see visualized in our UI. The [UI sections](https://www.ibm.com/docs/en/instana-observability/current?topic=working-user-interface#navigation-menu) include: - Websites & Mobile Apps - Applications - Infrastructure - Synthetic Monitoring - Events - Automation - Service Levels - Settings - etc ### Rate Limiting A rate limit is applied to API usage. Up to 5,000 calls per hour can be made. How many remaining calls can be made and when this call limit resets, can inspected via three headers that are part of the responses of the API server. - **X-RateLimit-Limit:** Shows the maximum number of calls that may be executed per hour. - **X-RateLimit-Remaining:** How many calls may still be executed within the current hour. - **X-RateLimit-Reset:** Time when the remaining calls will be reset to the limit. For compatibility reasons with other rate limited APIs, this date is not the date in milliseconds, but instead in seconds since 1970-01-01T00:00:00+00:00. ### Further Reading We provide additional documentation for our REST API in our [product documentation](https://www.ibm.com/docs/en/instana-observability/current?topic=apis-web-rest-api). Here you'll also find some common queries for retrieving data and configuring Instana. ## Getting Started with the REST API ### API base URL The base URL for an specific instance of Instana can be determined using the tenant and unit information. - `base`: This is the base URL of a tenant unit, e.g. `https://test-example.instana.io`. This is the same URL that is used to access the Instana user interface. - `apiToken`: Requests against the Instana API require valid API tokens. An initial API token can be generated via the Instana user interface. Any additional API tokens can be generated via the API itself. ### Curl Example Here is an Example to use the REST API with Curl. First lets get all the available metrics with possible aggregations with a GET call. ```bash curl --request GET \\ --url https://test-instana.instana.io/api/application-monitoring/catalog/metrics \\ --header 'authorization: apiToken xxxxxxxxxxxxxxxx' ``` Next we can get every call grouped by the endpoint name that has an error count greater then zero. As a metric we could get the mean error rate for example. ```bash curl --request POST \\ --url https://test-instana.instana.io/api/application-monitoring/analyze/call-groups \\ --header 'authorization: apiToken xxxxxxxxxxxxxxxx' \\ --header 'content-type: application/json' \\ --data '{ \"group\":{ \"groupbyTag\":\"endpoint.name\" }, \"tagFilters\":[ { \"name\":\"call.error.count\", \"value\":\"0\", \"operator\":\"GREATER_THAN\" } ], \"metrics\":[ { \"metric\":\"errors\", \"aggregation\":\"MEAN\" } ] }' ``` ### Generating REST API clients The API is specified using the [OpenAPI v3](https://github.com/OAI/OpenAPI-Specification) (previously known as Swagger) format. You can download the current specification at our [GitHub API documentation](https://instana.github.io/openapi/openapi.yaml). OpenAPI tries to solve the issue of ever-evolving APIs and clients lagging behind. Please make sure that you always use the latest version of the generator, as a number of improvements are regularly made. To generate a client library for your language, you can use the [OpenAPI client generators](https://github.com/OpenAPITools/openapi-generator). #### Go For example, to generate a client library for Go to interact with our backend, you can use the following script; mind replacing the values of the `UNIT_NAME` and `TENANT_NAME` environment variables using those for your tenant unit: ```bash #!/bin/bash ### This script assumes you have the `java` and `wget` commands on the path export UNIT_NAME='myunit' # for example: prod export TENANT_NAME='mytenant' # for example: awesomecompany //Download the generator to your current working directory: wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.3.1/openapi-generator-cli-4.3.1.jar -O openapi-generator-cli.jar --server-variables \"tenant=${TENANT_NAME},unit=${UNIT_NAME}\" //generate a client library that you can vendor into your repository java -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g go \\ -o pkg/instana/openapi \\ --skip-validate-spec //(optional) format the Go code according to the Go code standard gofmt -s -w pkg/instana/openapi ``` The generated clients contain comprehensive READMEs, and you can start right away using the client from the example above: ```go import instana \"./pkg/instana/openapi\" // readTags will read all available application monitoring tags along with their type and category func readTags() { configuration := instana.NewConfiguration() configuration.Host = \"tenant-unit.instana.io\" configuration.BasePath = \"https://tenant-unit.instana.io\" client := instana.NewAPIClient(configuration) auth := context.WithValue(context.Background(), instana.ContextAPIKey, instana.APIKey{ Key: apiKey, Prefix: \"apiToken\", }) tags, _, err := client.ApplicationCatalogApi.GetApplicationTagCatalog(auth) if err != nil { fmt.Fatalf(\"Error calling the API, aborting.\") } for _, tag := range tags { fmt.Printf(\"%s (%s): %s\\n\", tag.Category, tag.Type, tag.Name) } } ``` #### Java Follow the instructions provided in the official documentation from [OpenAPI Tools](https://github.com/OpenAPITools) to download the [openapi-generator-cli.jar](https://github.com/OpenAPITools/openapi-generator?tab=readme-ov-file#13---download-jar). Depending on your environment, use one of the following java http client implementations which will create a valid client for our OpenAPI specification: ``` //Nativ Java HTTP Client java -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g java -o pkg/instana/openapi --skip-validate-spec -p dateLibrary=java8 --library native //Spring WebClient java -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g java -o pkg/instana/openapi --skip-validate-spec -p dateLibrary=java8,hideGenerationTimestamp=true --library webclient //Spring RestTemplate java -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g java -o pkg/instana/openapi --skip-validate-spec -p dateLibrary=java8,hideGenerationTimestamp=true --library resttemplate ```
7
+
8
+ The version of the OpenAPI document: 1.291.1002
9
+ Contact: support@instana.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ import warnings
16
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
17
+ from typing import Any, Dict, List, Optional, Tuple, Union
18
+ from typing_extensions import Annotated
19
+
20
+ from pydantic import Field, StrictStr
21
+ from typing import List, Optional
22
+ from typing_extensions import Annotated
23
+ from instana_client.models.policy import Policy
24
+
25
+ from instana_client.api_client import ApiClient, RequestSerialized
26
+ from instana_client.api_response import ApiResponse
27
+ from instana_client.rest import RESTResponseType
28
+
29
+
30
+ class PoliciesApi:
31
+ """NOTE: This class is auto generated by OpenAPI Generator
32
+ Ref: https://openapi-generator.tech
33
+
34
+ Do not edit the class manually.
35
+ """
36
+
37
+ def __init__(self, api_client=None) -> None:
38
+ if api_client is None:
39
+ api_client = ApiClient.get_default()
40
+ self.api_client = api_client
41
+
42
+
43
+ @validate_call
44
+ def add_policies(
45
+ self,
46
+ policy: List[Policy],
47
+ _request_timeout: Union[
48
+ None,
49
+ Annotated[StrictFloat, Field(gt=0)],
50
+ Tuple[
51
+ Annotated[StrictFloat, Field(gt=0)],
52
+ Annotated[StrictFloat, Field(gt=0)]
53
+ ]
54
+ ] = None,
55
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
56
+ _content_type: Optional[StrictStr] = None,
57
+ _headers: Optional[Dict[StrictStr, Any]] = None,
58
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
59
+ ) -> List[Policy]:
60
+ """Create automation policies.
61
+
62
+ Creates a list of automation policies. Policy creation requires `Configuration of automation policies` permission.
63
+
64
+ :param policy: (required)
65
+ :type policy: List[Policy]
66
+ :param _request_timeout: timeout setting for this request. If one
67
+ number provided, it will be total request
68
+ timeout. It can also be a pair (tuple) of
69
+ (connection, read) timeouts.
70
+ :type _request_timeout: int, tuple(int, int), optional
71
+ :param _request_auth: set to override the auth_settings for an a single
72
+ request; this effectively ignores the
73
+ authentication in the spec for a single request.
74
+ :type _request_auth: dict, optional
75
+ :param _content_type: force content-type for the request.
76
+ :type _content_type: str, Optional
77
+ :param _headers: set to override the headers for a single
78
+ request; this effectively ignores the headers
79
+ in the spec for a single request.
80
+ :type _headers: dict, optional
81
+ :param _host_index: set to override the host_index for a single
82
+ request; this effectively ignores the host_index
83
+ in the spec for a single request.
84
+ :type _host_index: int, optional
85
+ :return: Returns the result object.
86
+ """ # noqa: E501
87
+
88
+ _param = self._add_policies_serialize(
89
+ policy=policy,
90
+ _request_auth=_request_auth,
91
+ _content_type=_content_type,
92
+ _headers=_headers,
93
+ _host_index=_host_index
94
+ )
95
+
96
+ _response_types_map: Dict[str, Optional[str]] = {
97
+ '200': "List[Policy]",
98
+ '403': None,
99
+ '412': None,
100
+ '500': None,
101
+ }
102
+ response_data = self.api_client.call_api(
103
+ *_param,
104
+ _request_timeout=_request_timeout
105
+ )
106
+ response_data.read()
107
+ return self.api_client.response_deserialize(
108
+ response_data=response_data,
109
+ response_types_map=_response_types_map,
110
+ ).data
111
+
112
+
113
+ @validate_call
114
+ def add_policies_with_http_info(
115
+ self,
116
+ policy: List[Policy],
117
+ _request_timeout: Union[
118
+ None,
119
+ Annotated[StrictFloat, Field(gt=0)],
120
+ Tuple[
121
+ Annotated[StrictFloat, Field(gt=0)],
122
+ Annotated[StrictFloat, Field(gt=0)]
123
+ ]
124
+ ] = None,
125
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
126
+ _content_type: Optional[StrictStr] = None,
127
+ _headers: Optional[Dict[StrictStr, Any]] = None,
128
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
129
+ ) -> ApiResponse[List[Policy]]:
130
+ """Create automation policies.
131
+
132
+ Creates a list of automation policies. Policy creation requires `Configuration of automation policies` permission.
133
+
134
+ :param policy: (required)
135
+ :type policy: List[Policy]
136
+ :param _request_timeout: timeout setting for this request. If one
137
+ number provided, it will be total request
138
+ timeout. It can also be a pair (tuple) of
139
+ (connection, read) timeouts.
140
+ :type _request_timeout: int, tuple(int, int), optional
141
+ :param _request_auth: set to override the auth_settings for an a single
142
+ request; this effectively ignores the
143
+ authentication in the spec for a single request.
144
+ :type _request_auth: dict, optional
145
+ :param _content_type: force content-type for the request.
146
+ :type _content_type: str, Optional
147
+ :param _headers: set to override the headers for a single
148
+ request; this effectively ignores the headers
149
+ in the spec for a single request.
150
+ :type _headers: dict, optional
151
+ :param _host_index: set to override the host_index for a single
152
+ request; this effectively ignores the host_index
153
+ in the spec for a single request.
154
+ :type _host_index: int, optional
155
+ :return: Returns the result object.
156
+ """ # noqa: E501
157
+
158
+ _param = self._add_policies_serialize(
159
+ policy=policy,
160
+ _request_auth=_request_auth,
161
+ _content_type=_content_type,
162
+ _headers=_headers,
163
+ _host_index=_host_index
164
+ )
165
+
166
+ _response_types_map: Dict[str, Optional[str]] = {
167
+ '200': "List[Policy]",
168
+ '403': None,
169
+ '412': None,
170
+ '500': None,
171
+ }
172
+ response_data = self.api_client.call_api(
173
+ *_param,
174
+ _request_timeout=_request_timeout
175
+ )
176
+ response_data.read()
177
+ return self.api_client.response_deserialize(
178
+ response_data=response_data,
179
+ response_types_map=_response_types_map,
180
+ )
181
+
182
+
183
+ @validate_call
184
+ def add_policies_without_preload_content(
185
+ self,
186
+ policy: List[Policy],
187
+ _request_timeout: Union[
188
+ None,
189
+ Annotated[StrictFloat, Field(gt=0)],
190
+ Tuple[
191
+ Annotated[StrictFloat, Field(gt=0)],
192
+ Annotated[StrictFloat, Field(gt=0)]
193
+ ]
194
+ ] = None,
195
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
196
+ _content_type: Optional[StrictStr] = None,
197
+ _headers: Optional[Dict[StrictStr, Any]] = None,
198
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
199
+ ) -> RESTResponseType:
200
+ """Create automation policies.
201
+
202
+ Creates a list of automation policies. Policy creation requires `Configuration of automation policies` permission.
203
+
204
+ :param policy: (required)
205
+ :type policy: List[Policy]
206
+ :param _request_timeout: timeout setting for this request. If one
207
+ number provided, it will be total request
208
+ timeout. It can also be a pair (tuple) of
209
+ (connection, read) timeouts.
210
+ :type _request_timeout: int, tuple(int, int), optional
211
+ :param _request_auth: set to override the auth_settings for an a single
212
+ request; this effectively ignores the
213
+ authentication in the spec for a single request.
214
+ :type _request_auth: dict, optional
215
+ :param _content_type: force content-type for the request.
216
+ :type _content_type: str, Optional
217
+ :param _headers: set to override the headers for a single
218
+ request; this effectively ignores the headers
219
+ in the spec for a single request.
220
+ :type _headers: dict, optional
221
+ :param _host_index: set to override the host_index for a single
222
+ request; this effectively ignores the host_index
223
+ in the spec for a single request.
224
+ :type _host_index: int, optional
225
+ :return: Returns the result object.
226
+ """ # noqa: E501
227
+
228
+ _param = self._add_policies_serialize(
229
+ policy=policy,
230
+ _request_auth=_request_auth,
231
+ _content_type=_content_type,
232
+ _headers=_headers,
233
+ _host_index=_host_index
234
+ )
235
+
236
+ _response_types_map: Dict[str, Optional[str]] = {
237
+ '200': "List[Policy]",
238
+ '403': None,
239
+ '412': None,
240
+ '500': None,
241
+ }
242
+ response_data = self.api_client.call_api(
243
+ *_param,
244
+ _request_timeout=_request_timeout
245
+ )
246
+ return response_data.response
247
+
248
+
249
+ def _add_policies_serialize(
250
+ self,
251
+ policy,
252
+ _request_auth,
253
+ _content_type,
254
+ _headers,
255
+ _host_index,
256
+ ) -> RequestSerialized:
257
+
258
+ _host = None
259
+
260
+ _collection_formats: Dict[str, str] = {
261
+ 'Policy': '',
262
+ }
263
+
264
+ _path_params: Dict[str, str] = {}
265
+ _query_params: List[Tuple[str, str]] = []
266
+ _header_params: Dict[str, Optional[str]] = _headers or {}
267
+ _form_params: List[Tuple[str, str]] = []
268
+ _files: Dict[
269
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
270
+ ] = {}
271
+ _body_params: Optional[bytes] = None
272
+
273
+ # process the path parameters
274
+ # process the query parameters
275
+ # process the header parameters
276
+ # process the form parameters
277
+ # process the body parameter
278
+ if policy is not None:
279
+ _body_params = policy
280
+
281
+
282
+ # set the HTTP header `Accept`
283
+ if 'Accept' not in _header_params:
284
+ _header_params['Accept'] = self.api_client.select_header_accept(
285
+ [
286
+ 'application/json'
287
+ ]
288
+ )
289
+
290
+ # set the HTTP header `Content-Type`
291
+ if _content_type:
292
+ _header_params['Content-Type'] = _content_type
293
+ else:
294
+ _default_content_type = (
295
+ self.api_client.select_header_content_type(
296
+ [
297
+ 'application/json'
298
+ ]
299
+ )
300
+ )
301
+ if _default_content_type is not None:
302
+ _header_params['Content-Type'] = _default_content_type
303
+
304
+ # authentication setting
305
+ _auth_settings: List[str] = [
306
+ 'ApiKeyAuth'
307
+ ]
308
+
309
+ return self.api_client.param_serialize(
310
+ method='POST',
311
+ resource_path='/api/automation/policies/bulk',
312
+ path_params=_path_params,
313
+ query_params=_query_params,
314
+ header_params=_header_params,
315
+ body=_body_params,
316
+ post_params=_form_params,
317
+ files=_files,
318
+ auth_settings=_auth_settings,
319
+ collection_formats=_collection_formats,
320
+ _host=_host,
321
+ _request_auth=_request_auth
322
+ )
323
+
324
+
325
+
326
+
327
+ @validate_call
328
+ def add_policy(
329
+ self,
330
+ policy: Policy,
331
+ _request_timeout: Union[
332
+ None,
333
+ Annotated[StrictFloat, Field(gt=0)],
334
+ Tuple[
335
+ Annotated[StrictFloat, Field(gt=0)],
336
+ Annotated[StrictFloat, Field(gt=0)]
337
+ ]
338
+ ] = None,
339
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
340
+ _content_type: Optional[StrictStr] = None,
341
+ _headers: Optional[Dict[StrictStr, Any]] = None,
342
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
343
+ ) -> Policy:
344
+ """Create an automation policy.
345
+
346
+ Creates a new automation policy. Policy creation requires `Configuration of automation policies` permission.
347
+
348
+ :param policy: (required)
349
+ :type policy: Policy
350
+ :param _request_timeout: timeout setting for this request. If one
351
+ number provided, it will be total request
352
+ timeout. It can also be a pair (tuple) of
353
+ (connection, read) timeouts.
354
+ :type _request_timeout: int, tuple(int, int), optional
355
+ :param _request_auth: set to override the auth_settings for an a single
356
+ request; this effectively ignores the
357
+ authentication in the spec for a single request.
358
+ :type _request_auth: dict, optional
359
+ :param _content_type: force content-type for the request.
360
+ :type _content_type: str, Optional
361
+ :param _headers: set to override the headers for a single
362
+ request; this effectively ignores the headers
363
+ in the spec for a single request.
364
+ :type _headers: dict, optional
365
+ :param _host_index: set to override the host_index for a single
366
+ request; this effectively ignores the host_index
367
+ in the spec for a single request.
368
+ :type _host_index: int, optional
369
+ :return: Returns the result object.
370
+ """ # noqa: E501
371
+
372
+ _param = self._add_policy_serialize(
373
+ policy=policy,
374
+ _request_auth=_request_auth,
375
+ _content_type=_content_type,
376
+ _headers=_headers,
377
+ _host_index=_host_index
378
+ )
379
+
380
+ _response_types_map: Dict[str, Optional[str]] = {
381
+ '200': "Policy",
382
+ '403': None,
383
+ '412': None,
384
+ '500': None,
385
+ }
386
+ response_data = self.api_client.call_api(
387
+ *_param,
388
+ _request_timeout=_request_timeout
389
+ )
390
+ response_data.read()
391
+ return self.api_client.response_deserialize(
392
+ response_data=response_data,
393
+ response_types_map=_response_types_map,
394
+ ).data
395
+
396
+
397
+ @validate_call
398
+ def add_policy_with_http_info(
399
+ self,
400
+ policy: Policy,
401
+ _request_timeout: Union[
402
+ None,
403
+ Annotated[StrictFloat, Field(gt=0)],
404
+ Tuple[
405
+ Annotated[StrictFloat, Field(gt=0)],
406
+ Annotated[StrictFloat, Field(gt=0)]
407
+ ]
408
+ ] = None,
409
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
410
+ _content_type: Optional[StrictStr] = None,
411
+ _headers: Optional[Dict[StrictStr, Any]] = None,
412
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
413
+ ) -> ApiResponse[Policy]:
414
+ """Create an automation policy.
415
+
416
+ Creates a new automation policy. Policy creation requires `Configuration of automation policies` permission.
417
+
418
+ :param policy: (required)
419
+ :type policy: Policy
420
+ :param _request_timeout: timeout setting for this request. If one
421
+ number provided, it will be total request
422
+ timeout. It can also be a pair (tuple) of
423
+ (connection, read) timeouts.
424
+ :type _request_timeout: int, tuple(int, int), optional
425
+ :param _request_auth: set to override the auth_settings for an a single
426
+ request; this effectively ignores the
427
+ authentication in the spec for a single request.
428
+ :type _request_auth: dict, optional
429
+ :param _content_type: force content-type for the request.
430
+ :type _content_type: str, Optional
431
+ :param _headers: set to override the headers for a single
432
+ request; this effectively ignores the headers
433
+ in the spec for a single request.
434
+ :type _headers: dict, optional
435
+ :param _host_index: set to override the host_index for a single
436
+ request; this effectively ignores the host_index
437
+ in the spec for a single request.
438
+ :type _host_index: int, optional
439
+ :return: Returns the result object.
440
+ """ # noqa: E501
441
+
442
+ _param = self._add_policy_serialize(
443
+ policy=policy,
444
+ _request_auth=_request_auth,
445
+ _content_type=_content_type,
446
+ _headers=_headers,
447
+ _host_index=_host_index
448
+ )
449
+
450
+ _response_types_map: Dict[str, Optional[str]] = {
451
+ '200': "Policy",
452
+ '403': None,
453
+ '412': None,
454
+ '500': None,
455
+ }
456
+ response_data = self.api_client.call_api(
457
+ *_param,
458
+ _request_timeout=_request_timeout
459
+ )
460
+ response_data.read()
461
+ return self.api_client.response_deserialize(
462
+ response_data=response_data,
463
+ response_types_map=_response_types_map,
464
+ )
465
+
466
+
467
+ @validate_call
468
+ def add_policy_without_preload_content(
469
+ self,
470
+ policy: Policy,
471
+ _request_timeout: Union[
472
+ None,
473
+ Annotated[StrictFloat, Field(gt=0)],
474
+ Tuple[
475
+ Annotated[StrictFloat, Field(gt=0)],
476
+ Annotated[StrictFloat, Field(gt=0)]
477
+ ]
478
+ ] = None,
479
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
480
+ _content_type: Optional[StrictStr] = None,
481
+ _headers: Optional[Dict[StrictStr, Any]] = None,
482
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
483
+ ) -> RESTResponseType:
484
+ """Create an automation policy.
485
+
486
+ Creates a new automation policy. Policy creation requires `Configuration of automation policies` permission.
487
+
488
+ :param policy: (required)
489
+ :type policy: Policy
490
+ :param _request_timeout: timeout setting for this request. If one
491
+ number provided, it will be total request
492
+ timeout. It can also be a pair (tuple) of
493
+ (connection, read) timeouts.
494
+ :type _request_timeout: int, tuple(int, int), optional
495
+ :param _request_auth: set to override the auth_settings for an a single
496
+ request; this effectively ignores the
497
+ authentication in the spec for a single request.
498
+ :type _request_auth: dict, optional
499
+ :param _content_type: force content-type for the request.
500
+ :type _content_type: str, Optional
501
+ :param _headers: set to override the headers for a single
502
+ request; this effectively ignores the headers
503
+ in the spec for a single request.
504
+ :type _headers: dict, optional
505
+ :param _host_index: set to override the host_index for a single
506
+ request; this effectively ignores the host_index
507
+ in the spec for a single request.
508
+ :type _host_index: int, optional
509
+ :return: Returns the result object.
510
+ """ # noqa: E501
511
+
512
+ _param = self._add_policy_serialize(
513
+ policy=policy,
514
+ _request_auth=_request_auth,
515
+ _content_type=_content_type,
516
+ _headers=_headers,
517
+ _host_index=_host_index
518
+ )
519
+
520
+ _response_types_map: Dict[str, Optional[str]] = {
521
+ '200': "Policy",
522
+ '403': None,
523
+ '412': None,
524
+ '500': None,
525
+ }
526
+ response_data = self.api_client.call_api(
527
+ *_param,
528
+ _request_timeout=_request_timeout
529
+ )
530
+ return response_data.response
531
+
532
+
533
+ def _add_policy_serialize(
534
+ self,
535
+ policy,
536
+ _request_auth,
537
+ _content_type,
538
+ _headers,
539
+ _host_index,
540
+ ) -> RequestSerialized:
541
+
542
+ _host = None
543
+
544
+ _collection_formats: Dict[str, str] = {
545
+ }
546
+
547
+ _path_params: Dict[str, str] = {}
548
+ _query_params: List[Tuple[str, str]] = []
549
+ _header_params: Dict[str, Optional[str]] = _headers or {}
550
+ _form_params: List[Tuple[str, str]] = []
551
+ _files: Dict[
552
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
553
+ ] = {}
554
+ _body_params: Optional[bytes] = None
555
+
556
+ # process the path parameters
557
+ # process the query parameters
558
+ # process the header parameters
559
+ # process the form parameters
560
+ # process the body parameter
561
+ if policy is not None:
562
+ _body_params = policy
563
+
564
+
565
+ # set the HTTP header `Accept`
566
+ if 'Accept' not in _header_params:
567
+ _header_params['Accept'] = self.api_client.select_header_accept(
568
+ [
569
+ 'application/json'
570
+ ]
571
+ )
572
+
573
+ # set the HTTP header `Content-Type`
574
+ if _content_type:
575
+ _header_params['Content-Type'] = _content_type
576
+ else:
577
+ _default_content_type = (
578
+ self.api_client.select_header_content_type(
579
+ [
580
+ 'application/json'
581
+ ]
582
+ )
583
+ )
584
+ if _default_content_type is not None:
585
+ _header_params['Content-Type'] = _default_content_type
586
+
587
+ # authentication setting
588
+ _auth_settings: List[str] = [
589
+ 'ApiKeyAuth'
590
+ ]
591
+
592
+ return self.api_client.param_serialize(
593
+ method='POST',
594
+ resource_path='/api/automation/policies',
595
+ path_params=_path_params,
596
+ query_params=_query_params,
597
+ header_params=_header_params,
598
+ body=_body_params,
599
+ post_params=_form_params,
600
+ files=_files,
601
+ auth_settings=_auth_settings,
602
+ collection_formats=_collection_formats,
603
+ _host=_host,
604
+ _request_auth=_request_auth
605
+ )
606
+
607
+
608
+
609
+
610
+ @validate_call
611
+ def delete_policy(
612
+ self,
613
+ id: Annotated[StrictStr, Field(description="Automation policy ID to delete")],
614
+ _request_timeout: Union[
615
+ None,
616
+ Annotated[StrictFloat, Field(gt=0)],
617
+ Tuple[
618
+ Annotated[StrictFloat, Field(gt=0)],
619
+ Annotated[StrictFloat, Field(gt=0)]
620
+ ]
621
+ ] = None,
622
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
623
+ _content_type: Optional[StrictStr] = None,
624
+ _headers: Optional[Dict[StrictStr, Any]] = None,
625
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
626
+ ) -> None:
627
+ """Deletes an automation policy by identifier.
628
+
629
+ Deletes an automation policy by identifier. Policy deletion requires `Configuration of automation policies` permission. When using personal tokens the automation policies deleted are based on the access set in `Limited access` permission settings.
630
+
631
+ :param id: Automation policy ID to delete (required)
632
+ :type id: str
633
+ :param _request_timeout: timeout setting for this request. If one
634
+ number provided, it will be total request
635
+ timeout. It can also be a pair (tuple) of
636
+ (connection, read) timeouts.
637
+ :type _request_timeout: int, tuple(int, int), optional
638
+ :param _request_auth: set to override the auth_settings for an a single
639
+ request; this effectively ignores the
640
+ authentication in the spec for a single request.
641
+ :type _request_auth: dict, optional
642
+ :param _content_type: force content-type for the request.
643
+ :type _content_type: str, Optional
644
+ :param _headers: set to override the headers for a single
645
+ request; this effectively ignores the headers
646
+ in the spec for a single request.
647
+ :type _headers: dict, optional
648
+ :param _host_index: set to override the host_index for a single
649
+ request; this effectively ignores the host_index
650
+ in the spec for a single request.
651
+ :type _host_index: int, optional
652
+ :return: Returns the result object.
653
+ """ # noqa: E501
654
+
655
+ _param = self._delete_policy_serialize(
656
+ id=id,
657
+ _request_auth=_request_auth,
658
+ _content_type=_content_type,
659
+ _headers=_headers,
660
+ _host_index=_host_index
661
+ )
662
+
663
+ _response_types_map: Dict[str, Optional[str]] = {
664
+ '204': None,
665
+ '403': None,
666
+ '412': None,
667
+ }
668
+ response_data = self.api_client.call_api(
669
+ *_param,
670
+ _request_timeout=_request_timeout
671
+ )
672
+ response_data.read()
673
+ return self.api_client.response_deserialize(
674
+ response_data=response_data,
675
+ response_types_map=_response_types_map,
676
+ ).data
677
+
678
+
679
+ @validate_call
680
+ def delete_policy_with_http_info(
681
+ self,
682
+ id: Annotated[StrictStr, Field(description="Automation policy ID to delete")],
683
+ _request_timeout: Union[
684
+ None,
685
+ Annotated[StrictFloat, Field(gt=0)],
686
+ Tuple[
687
+ Annotated[StrictFloat, Field(gt=0)],
688
+ Annotated[StrictFloat, Field(gt=0)]
689
+ ]
690
+ ] = None,
691
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
692
+ _content_type: Optional[StrictStr] = None,
693
+ _headers: Optional[Dict[StrictStr, Any]] = None,
694
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
695
+ ) -> ApiResponse[None]:
696
+ """Deletes an automation policy by identifier.
697
+
698
+ Deletes an automation policy by identifier. Policy deletion requires `Configuration of automation policies` permission. When using personal tokens the automation policies deleted are based on the access set in `Limited access` permission settings.
699
+
700
+ :param id: Automation policy ID to delete (required)
701
+ :type id: str
702
+ :param _request_timeout: timeout setting for this request. If one
703
+ number provided, it will be total request
704
+ timeout. It can also be a pair (tuple) of
705
+ (connection, read) timeouts.
706
+ :type _request_timeout: int, tuple(int, int), optional
707
+ :param _request_auth: set to override the auth_settings for an a single
708
+ request; this effectively ignores the
709
+ authentication in the spec for a single request.
710
+ :type _request_auth: dict, optional
711
+ :param _content_type: force content-type for the request.
712
+ :type _content_type: str, Optional
713
+ :param _headers: set to override the headers for a single
714
+ request; this effectively ignores the headers
715
+ in the spec for a single request.
716
+ :type _headers: dict, optional
717
+ :param _host_index: set to override the host_index for a single
718
+ request; this effectively ignores the host_index
719
+ in the spec for a single request.
720
+ :type _host_index: int, optional
721
+ :return: Returns the result object.
722
+ """ # noqa: E501
723
+
724
+ _param = self._delete_policy_serialize(
725
+ id=id,
726
+ _request_auth=_request_auth,
727
+ _content_type=_content_type,
728
+ _headers=_headers,
729
+ _host_index=_host_index
730
+ )
731
+
732
+ _response_types_map: Dict[str, Optional[str]] = {
733
+ '204': None,
734
+ '403': None,
735
+ '412': None,
736
+ }
737
+ response_data = self.api_client.call_api(
738
+ *_param,
739
+ _request_timeout=_request_timeout
740
+ )
741
+ response_data.read()
742
+ return self.api_client.response_deserialize(
743
+ response_data=response_data,
744
+ response_types_map=_response_types_map,
745
+ )
746
+
747
+
748
+ @validate_call
749
+ def delete_policy_without_preload_content(
750
+ self,
751
+ id: Annotated[StrictStr, Field(description="Automation policy ID to delete")],
752
+ _request_timeout: Union[
753
+ None,
754
+ Annotated[StrictFloat, Field(gt=0)],
755
+ Tuple[
756
+ Annotated[StrictFloat, Field(gt=0)],
757
+ Annotated[StrictFloat, Field(gt=0)]
758
+ ]
759
+ ] = None,
760
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
761
+ _content_type: Optional[StrictStr] = None,
762
+ _headers: Optional[Dict[StrictStr, Any]] = None,
763
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
764
+ ) -> RESTResponseType:
765
+ """Deletes an automation policy by identifier.
766
+
767
+ Deletes an automation policy by identifier. Policy deletion requires `Configuration of automation policies` permission. When using personal tokens the automation policies deleted are based on the access set in `Limited access` permission settings.
768
+
769
+ :param id: Automation policy ID to delete (required)
770
+ :type id: str
771
+ :param _request_timeout: timeout setting for this request. If one
772
+ number provided, it will be total request
773
+ timeout. It can also be a pair (tuple) of
774
+ (connection, read) timeouts.
775
+ :type _request_timeout: int, tuple(int, int), optional
776
+ :param _request_auth: set to override the auth_settings for an a single
777
+ request; this effectively ignores the
778
+ authentication in the spec for a single request.
779
+ :type _request_auth: dict, optional
780
+ :param _content_type: force content-type for the request.
781
+ :type _content_type: str, Optional
782
+ :param _headers: set to override the headers for a single
783
+ request; this effectively ignores the headers
784
+ in the spec for a single request.
785
+ :type _headers: dict, optional
786
+ :param _host_index: set to override the host_index for a single
787
+ request; this effectively ignores the host_index
788
+ in the spec for a single request.
789
+ :type _host_index: int, optional
790
+ :return: Returns the result object.
791
+ """ # noqa: E501
792
+
793
+ _param = self._delete_policy_serialize(
794
+ id=id,
795
+ _request_auth=_request_auth,
796
+ _content_type=_content_type,
797
+ _headers=_headers,
798
+ _host_index=_host_index
799
+ )
800
+
801
+ _response_types_map: Dict[str, Optional[str]] = {
802
+ '204': None,
803
+ '403': None,
804
+ '412': None,
805
+ }
806
+ response_data = self.api_client.call_api(
807
+ *_param,
808
+ _request_timeout=_request_timeout
809
+ )
810
+ return response_data.response
811
+
812
+
813
+ def _delete_policy_serialize(
814
+ self,
815
+ id,
816
+ _request_auth,
817
+ _content_type,
818
+ _headers,
819
+ _host_index,
820
+ ) -> RequestSerialized:
821
+
822
+ _host = None
823
+
824
+ _collection_formats: Dict[str, str] = {
825
+ }
826
+
827
+ _path_params: Dict[str, str] = {}
828
+ _query_params: List[Tuple[str, str]] = []
829
+ _header_params: Dict[str, Optional[str]] = _headers or {}
830
+ _form_params: List[Tuple[str, str]] = []
831
+ _files: Dict[
832
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
833
+ ] = {}
834
+ _body_params: Optional[bytes] = None
835
+
836
+ # process the path parameters
837
+ if id is not None:
838
+ _path_params['id'] = id
839
+ # process the query parameters
840
+ # process the header parameters
841
+ # process the form parameters
842
+ # process the body parameter
843
+
844
+
845
+
846
+
847
+ # authentication setting
848
+ _auth_settings: List[str] = [
849
+ 'ApiKeyAuth'
850
+ ]
851
+
852
+ return self.api_client.param_serialize(
853
+ method='DELETE',
854
+ resource_path='/api/automation/policies/{id}',
855
+ path_params=_path_params,
856
+ query_params=_query_params,
857
+ header_params=_header_params,
858
+ body=_body_params,
859
+ post_params=_form_params,
860
+ files=_files,
861
+ auth_settings=_auth_settings,
862
+ collection_formats=_collection_formats,
863
+ _host=_host,
864
+ _request_auth=_request_auth
865
+ )
866
+
867
+
868
+
869
+
870
+ @validate_call
871
+ def get_policies(
872
+ self,
873
+ trigger_type: Annotated[Optional[StrictStr], Field(description="Filter policies by the event or alert type that can trigger a policy. This is an optional parameter. Valid values are customEvent, builtinEvent, applicationSmartAlert, globalApplicationSmartAlert, websiteSmartAlert, infraSmartAlert, mobileAppSmartAlert, syntheticsSmartAlert, logSmartAlert, sloSmartAlert")] = None,
874
+ trigger_id: Annotated[Optional[StrictStr], Field(description="Trigger identifier. This is an optional parameter.")] = None,
875
+ execution_type: Annotated[Optional[StrictStr], Field(description="Filter policies by policy execution type. This is an optional parameter. Valid values are automatic or manual")] = None,
876
+ action_id: Annotated[Optional[StrictStr], Field(description="Filter policies by action ID. This is an optional parameter.")] = None,
877
+ _request_timeout: Union[
878
+ None,
879
+ Annotated[StrictFloat, Field(gt=0)],
880
+ Tuple[
881
+ Annotated[StrictFloat, Field(gt=0)],
882
+ Annotated[StrictFloat, Field(gt=0)]
883
+ ]
884
+ ] = None,
885
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
886
+ _content_type: Optional[StrictStr] = None,
887
+ _headers: Optional[Dict[StrictStr, Any]] = None,
888
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
889
+ ) -> List[Policy]:
890
+ """Get all automation policies.
891
+
892
+ Returns all the automation policies filtered by the values in optional query parameters. When using personal access tokens, the user must have at least `Viewer` access for Automation and the automation policies returned are also filtered based on the access set in `Limited access` permission settings.
893
+
894
+ :param trigger_type: Filter policies by the event or alert type that can trigger a policy. This is an optional parameter. Valid values are customEvent, builtinEvent, applicationSmartAlert, globalApplicationSmartAlert, websiteSmartAlert, infraSmartAlert, mobileAppSmartAlert, syntheticsSmartAlert, logSmartAlert, sloSmartAlert
895
+ :type trigger_type: str
896
+ :param trigger_id: Trigger identifier. This is an optional parameter.
897
+ :type trigger_id: str
898
+ :param execution_type: Filter policies by policy execution type. This is an optional parameter. Valid values are automatic or manual
899
+ :type execution_type: str
900
+ :param action_id: Filter policies by action ID. This is an optional parameter.
901
+ :type action_id: str
902
+ :param _request_timeout: timeout setting for this request. If one
903
+ number provided, it will be total request
904
+ timeout. It can also be a pair (tuple) of
905
+ (connection, read) timeouts.
906
+ :type _request_timeout: int, tuple(int, int), optional
907
+ :param _request_auth: set to override the auth_settings for an a single
908
+ request; this effectively ignores the
909
+ authentication in the spec for a single request.
910
+ :type _request_auth: dict, optional
911
+ :param _content_type: force content-type for the request.
912
+ :type _content_type: str, Optional
913
+ :param _headers: set to override the headers for a single
914
+ request; this effectively ignores the headers
915
+ in the spec for a single request.
916
+ :type _headers: dict, optional
917
+ :param _host_index: set to override the host_index for a single
918
+ request; this effectively ignores the host_index
919
+ in the spec for a single request.
920
+ :type _host_index: int, optional
921
+ :return: Returns the result object.
922
+ """ # noqa: E501
923
+
924
+ _param = self._get_policies_serialize(
925
+ trigger_type=trigger_type,
926
+ trigger_id=trigger_id,
927
+ execution_type=execution_type,
928
+ action_id=action_id,
929
+ _request_auth=_request_auth,
930
+ _content_type=_content_type,
931
+ _headers=_headers,
932
+ _host_index=_host_index
933
+ )
934
+
935
+ _response_types_map: Dict[str, Optional[str]] = {
936
+ '200': "List[Policy]",
937
+ '403': None,
938
+ '412': None,
939
+ '500': None,
940
+ }
941
+ response_data = self.api_client.call_api(
942
+ *_param,
943
+ _request_timeout=_request_timeout
944
+ )
945
+ response_data.read()
946
+ return self.api_client.response_deserialize(
947
+ response_data=response_data,
948
+ response_types_map=_response_types_map,
949
+ ).data
950
+
951
+
952
+ @validate_call
953
+ def get_policies_with_http_info(
954
+ self,
955
+ trigger_type: Annotated[Optional[StrictStr], Field(description="Filter policies by the event or alert type that can trigger a policy. This is an optional parameter. Valid values are customEvent, builtinEvent, applicationSmartAlert, globalApplicationSmartAlert, websiteSmartAlert, infraSmartAlert, mobileAppSmartAlert, syntheticsSmartAlert, logSmartAlert, sloSmartAlert")] = None,
956
+ trigger_id: Annotated[Optional[StrictStr], Field(description="Trigger identifier. This is an optional parameter.")] = None,
957
+ execution_type: Annotated[Optional[StrictStr], Field(description="Filter policies by policy execution type. This is an optional parameter. Valid values are automatic or manual")] = None,
958
+ action_id: Annotated[Optional[StrictStr], Field(description="Filter policies by action ID. This is an optional parameter.")] = None,
959
+ _request_timeout: Union[
960
+ None,
961
+ Annotated[StrictFloat, Field(gt=0)],
962
+ Tuple[
963
+ Annotated[StrictFloat, Field(gt=0)],
964
+ Annotated[StrictFloat, Field(gt=0)]
965
+ ]
966
+ ] = None,
967
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
968
+ _content_type: Optional[StrictStr] = None,
969
+ _headers: Optional[Dict[StrictStr, Any]] = None,
970
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
971
+ ) -> ApiResponse[List[Policy]]:
972
+ """Get all automation policies.
973
+
974
+ Returns all the automation policies filtered by the values in optional query parameters. When using personal access tokens, the user must have at least `Viewer` access for Automation and the automation policies returned are also filtered based on the access set in `Limited access` permission settings.
975
+
976
+ :param trigger_type: Filter policies by the event or alert type that can trigger a policy. This is an optional parameter. Valid values are customEvent, builtinEvent, applicationSmartAlert, globalApplicationSmartAlert, websiteSmartAlert, infraSmartAlert, mobileAppSmartAlert, syntheticsSmartAlert, logSmartAlert, sloSmartAlert
977
+ :type trigger_type: str
978
+ :param trigger_id: Trigger identifier. This is an optional parameter.
979
+ :type trigger_id: str
980
+ :param execution_type: Filter policies by policy execution type. This is an optional parameter. Valid values are automatic or manual
981
+ :type execution_type: str
982
+ :param action_id: Filter policies by action ID. This is an optional parameter.
983
+ :type action_id: str
984
+ :param _request_timeout: timeout setting for this request. If one
985
+ number provided, it will be total request
986
+ timeout. It can also be a pair (tuple) of
987
+ (connection, read) timeouts.
988
+ :type _request_timeout: int, tuple(int, int), optional
989
+ :param _request_auth: set to override the auth_settings for an a single
990
+ request; this effectively ignores the
991
+ authentication in the spec for a single request.
992
+ :type _request_auth: dict, optional
993
+ :param _content_type: force content-type for the request.
994
+ :type _content_type: str, Optional
995
+ :param _headers: set to override the headers for a single
996
+ request; this effectively ignores the headers
997
+ in the spec for a single request.
998
+ :type _headers: dict, optional
999
+ :param _host_index: set to override the host_index for a single
1000
+ request; this effectively ignores the host_index
1001
+ in the spec for a single request.
1002
+ :type _host_index: int, optional
1003
+ :return: Returns the result object.
1004
+ """ # noqa: E501
1005
+
1006
+ _param = self._get_policies_serialize(
1007
+ trigger_type=trigger_type,
1008
+ trigger_id=trigger_id,
1009
+ execution_type=execution_type,
1010
+ action_id=action_id,
1011
+ _request_auth=_request_auth,
1012
+ _content_type=_content_type,
1013
+ _headers=_headers,
1014
+ _host_index=_host_index
1015
+ )
1016
+
1017
+ _response_types_map: Dict[str, Optional[str]] = {
1018
+ '200': "List[Policy]",
1019
+ '403': None,
1020
+ '412': None,
1021
+ '500': None,
1022
+ }
1023
+ response_data = self.api_client.call_api(
1024
+ *_param,
1025
+ _request_timeout=_request_timeout
1026
+ )
1027
+ response_data.read()
1028
+ return self.api_client.response_deserialize(
1029
+ response_data=response_data,
1030
+ response_types_map=_response_types_map,
1031
+ )
1032
+
1033
+
1034
+ @validate_call
1035
+ def get_policies_without_preload_content(
1036
+ self,
1037
+ trigger_type: Annotated[Optional[StrictStr], Field(description="Filter policies by the event or alert type that can trigger a policy. This is an optional parameter. Valid values are customEvent, builtinEvent, applicationSmartAlert, globalApplicationSmartAlert, websiteSmartAlert, infraSmartAlert, mobileAppSmartAlert, syntheticsSmartAlert, logSmartAlert, sloSmartAlert")] = None,
1038
+ trigger_id: Annotated[Optional[StrictStr], Field(description="Trigger identifier. This is an optional parameter.")] = None,
1039
+ execution_type: Annotated[Optional[StrictStr], Field(description="Filter policies by policy execution type. This is an optional parameter. Valid values are automatic or manual")] = None,
1040
+ action_id: Annotated[Optional[StrictStr], Field(description="Filter policies by action ID. This is an optional parameter.")] = None,
1041
+ _request_timeout: Union[
1042
+ None,
1043
+ Annotated[StrictFloat, Field(gt=0)],
1044
+ Tuple[
1045
+ Annotated[StrictFloat, Field(gt=0)],
1046
+ Annotated[StrictFloat, Field(gt=0)]
1047
+ ]
1048
+ ] = None,
1049
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1050
+ _content_type: Optional[StrictStr] = None,
1051
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1052
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1053
+ ) -> RESTResponseType:
1054
+ """Get all automation policies.
1055
+
1056
+ Returns all the automation policies filtered by the values in optional query parameters. When using personal access tokens, the user must have at least `Viewer` access for Automation and the automation policies returned are also filtered based on the access set in `Limited access` permission settings.
1057
+
1058
+ :param trigger_type: Filter policies by the event or alert type that can trigger a policy. This is an optional parameter. Valid values are customEvent, builtinEvent, applicationSmartAlert, globalApplicationSmartAlert, websiteSmartAlert, infraSmartAlert, mobileAppSmartAlert, syntheticsSmartAlert, logSmartAlert, sloSmartAlert
1059
+ :type trigger_type: str
1060
+ :param trigger_id: Trigger identifier. This is an optional parameter.
1061
+ :type trigger_id: str
1062
+ :param execution_type: Filter policies by policy execution type. This is an optional parameter. Valid values are automatic or manual
1063
+ :type execution_type: str
1064
+ :param action_id: Filter policies by action ID. This is an optional parameter.
1065
+ :type action_id: str
1066
+ :param _request_timeout: timeout setting for this request. If one
1067
+ number provided, it will be total request
1068
+ timeout. It can also be a pair (tuple) of
1069
+ (connection, read) timeouts.
1070
+ :type _request_timeout: int, tuple(int, int), optional
1071
+ :param _request_auth: set to override the auth_settings for an a single
1072
+ request; this effectively ignores the
1073
+ authentication in the spec for a single request.
1074
+ :type _request_auth: dict, optional
1075
+ :param _content_type: force content-type for the request.
1076
+ :type _content_type: str, Optional
1077
+ :param _headers: set to override the headers for a single
1078
+ request; this effectively ignores the headers
1079
+ in the spec for a single request.
1080
+ :type _headers: dict, optional
1081
+ :param _host_index: set to override the host_index for a single
1082
+ request; this effectively ignores the host_index
1083
+ in the spec for a single request.
1084
+ :type _host_index: int, optional
1085
+ :return: Returns the result object.
1086
+ """ # noqa: E501
1087
+
1088
+ _param = self._get_policies_serialize(
1089
+ trigger_type=trigger_type,
1090
+ trigger_id=trigger_id,
1091
+ execution_type=execution_type,
1092
+ action_id=action_id,
1093
+ _request_auth=_request_auth,
1094
+ _content_type=_content_type,
1095
+ _headers=_headers,
1096
+ _host_index=_host_index
1097
+ )
1098
+
1099
+ _response_types_map: Dict[str, Optional[str]] = {
1100
+ '200': "List[Policy]",
1101
+ '403': None,
1102
+ '412': None,
1103
+ '500': None,
1104
+ }
1105
+ response_data = self.api_client.call_api(
1106
+ *_param,
1107
+ _request_timeout=_request_timeout
1108
+ )
1109
+ return response_data.response
1110
+
1111
+
1112
+ def _get_policies_serialize(
1113
+ self,
1114
+ trigger_type,
1115
+ trigger_id,
1116
+ execution_type,
1117
+ action_id,
1118
+ _request_auth,
1119
+ _content_type,
1120
+ _headers,
1121
+ _host_index,
1122
+ ) -> RequestSerialized:
1123
+
1124
+ _host = None
1125
+
1126
+ _collection_formats: Dict[str, str] = {
1127
+ }
1128
+
1129
+ _path_params: Dict[str, str] = {}
1130
+ _query_params: List[Tuple[str, str]] = []
1131
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1132
+ _form_params: List[Tuple[str, str]] = []
1133
+ _files: Dict[
1134
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1135
+ ] = {}
1136
+ _body_params: Optional[bytes] = None
1137
+
1138
+ # process the path parameters
1139
+ # process the query parameters
1140
+ if trigger_type is not None:
1141
+
1142
+ _query_params.append(('triggerType', trigger_type))
1143
+
1144
+ if trigger_id is not None:
1145
+
1146
+ _query_params.append(('triggerId', trigger_id))
1147
+
1148
+ if execution_type is not None:
1149
+
1150
+ _query_params.append(('executionType', execution_type))
1151
+
1152
+ if action_id is not None:
1153
+
1154
+ _query_params.append(('actionId', action_id))
1155
+
1156
+ # process the header parameters
1157
+ # process the form parameters
1158
+ # process the body parameter
1159
+
1160
+
1161
+ # set the HTTP header `Accept`
1162
+ if 'Accept' not in _header_params:
1163
+ _header_params['Accept'] = self.api_client.select_header_accept(
1164
+ [
1165
+ 'application/json'
1166
+ ]
1167
+ )
1168
+
1169
+
1170
+ # authentication setting
1171
+ _auth_settings: List[str] = [
1172
+ 'ApiKeyAuth'
1173
+ ]
1174
+
1175
+ return self.api_client.param_serialize(
1176
+ method='GET',
1177
+ resource_path='/api/automation/policies',
1178
+ path_params=_path_params,
1179
+ query_params=_query_params,
1180
+ header_params=_header_params,
1181
+ body=_body_params,
1182
+ post_params=_form_params,
1183
+ files=_files,
1184
+ auth_settings=_auth_settings,
1185
+ collection_formats=_collection_formats,
1186
+ _host=_host,
1187
+ _request_auth=_request_auth
1188
+ )
1189
+
1190
+
1191
+
1192
+
1193
+ @validate_call
1194
+ def get_policy_by_id(
1195
+ self,
1196
+ id: Annotated[StrictStr, Field(description="Automation policy ID")],
1197
+ _request_timeout: Union[
1198
+ None,
1199
+ Annotated[StrictFloat, Field(gt=0)],
1200
+ Tuple[
1201
+ Annotated[StrictFloat, Field(gt=0)],
1202
+ Annotated[StrictFloat, Field(gt=0)]
1203
+ ]
1204
+ ] = None,
1205
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1206
+ _content_type: Optional[StrictStr] = None,
1207
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1208
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1209
+ ) -> Policy:
1210
+ """Get an automation policy by ID.
1211
+
1212
+ Returns the automation policy filtered by the ID in request parameter. When using personal access tokens, the user must have at least `Viewer` access for Automation and the automation policies returned are also filtered based on the access set in `Limited access` permission settings.
1213
+
1214
+ :param id: Automation policy ID (required)
1215
+ :type id: str
1216
+ :param _request_timeout: timeout setting for this request. If one
1217
+ number provided, it will be total request
1218
+ timeout. It can also be a pair (tuple) of
1219
+ (connection, read) timeouts.
1220
+ :type _request_timeout: int, tuple(int, int), optional
1221
+ :param _request_auth: set to override the auth_settings for an a single
1222
+ request; this effectively ignores the
1223
+ authentication in the spec for a single request.
1224
+ :type _request_auth: dict, optional
1225
+ :param _content_type: force content-type for the request.
1226
+ :type _content_type: str, Optional
1227
+ :param _headers: set to override the headers for a single
1228
+ request; this effectively ignores the headers
1229
+ in the spec for a single request.
1230
+ :type _headers: dict, optional
1231
+ :param _host_index: set to override the host_index for a single
1232
+ request; this effectively ignores the host_index
1233
+ in the spec for a single request.
1234
+ :type _host_index: int, optional
1235
+ :return: Returns the result object.
1236
+ """ # noqa: E501
1237
+
1238
+ _param = self._get_policy_by_id_serialize(
1239
+ id=id,
1240
+ _request_auth=_request_auth,
1241
+ _content_type=_content_type,
1242
+ _headers=_headers,
1243
+ _host_index=_host_index
1244
+ )
1245
+
1246
+ _response_types_map: Dict[str, Optional[str]] = {
1247
+ '200': "Policy",
1248
+ '403': None,
1249
+ '404': None,
1250
+ }
1251
+ response_data = self.api_client.call_api(
1252
+ *_param,
1253
+ _request_timeout=_request_timeout
1254
+ )
1255
+ response_data.read()
1256
+ return self.api_client.response_deserialize(
1257
+ response_data=response_data,
1258
+ response_types_map=_response_types_map,
1259
+ ).data
1260
+
1261
+
1262
+ @validate_call
1263
+ def get_policy_by_id_with_http_info(
1264
+ self,
1265
+ id: Annotated[StrictStr, Field(description="Automation policy ID")],
1266
+ _request_timeout: Union[
1267
+ None,
1268
+ Annotated[StrictFloat, Field(gt=0)],
1269
+ Tuple[
1270
+ Annotated[StrictFloat, Field(gt=0)],
1271
+ Annotated[StrictFloat, Field(gt=0)]
1272
+ ]
1273
+ ] = None,
1274
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1275
+ _content_type: Optional[StrictStr] = None,
1276
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1277
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1278
+ ) -> ApiResponse[Policy]:
1279
+ """Get an automation policy by ID.
1280
+
1281
+ Returns the automation policy filtered by the ID in request parameter. When using personal access tokens, the user must have at least `Viewer` access for Automation and the automation policies returned are also filtered based on the access set in `Limited access` permission settings.
1282
+
1283
+ :param id: Automation policy ID (required)
1284
+ :type id: str
1285
+ :param _request_timeout: timeout setting for this request. If one
1286
+ number provided, it will be total request
1287
+ timeout. It can also be a pair (tuple) of
1288
+ (connection, read) timeouts.
1289
+ :type _request_timeout: int, tuple(int, int), optional
1290
+ :param _request_auth: set to override the auth_settings for an a single
1291
+ request; this effectively ignores the
1292
+ authentication in the spec for a single request.
1293
+ :type _request_auth: dict, optional
1294
+ :param _content_type: force content-type for the request.
1295
+ :type _content_type: str, Optional
1296
+ :param _headers: set to override the headers for a single
1297
+ request; this effectively ignores the headers
1298
+ in the spec for a single request.
1299
+ :type _headers: dict, optional
1300
+ :param _host_index: set to override the host_index for a single
1301
+ request; this effectively ignores the host_index
1302
+ in the spec for a single request.
1303
+ :type _host_index: int, optional
1304
+ :return: Returns the result object.
1305
+ """ # noqa: E501
1306
+
1307
+ _param = self._get_policy_by_id_serialize(
1308
+ id=id,
1309
+ _request_auth=_request_auth,
1310
+ _content_type=_content_type,
1311
+ _headers=_headers,
1312
+ _host_index=_host_index
1313
+ )
1314
+
1315
+ _response_types_map: Dict[str, Optional[str]] = {
1316
+ '200': "Policy",
1317
+ '403': None,
1318
+ '404': None,
1319
+ }
1320
+ response_data = self.api_client.call_api(
1321
+ *_param,
1322
+ _request_timeout=_request_timeout
1323
+ )
1324
+ response_data.read()
1325
+ return self.api_client.response_deserialize(
1326
+ response_data=response_data,
1327
+ response_types_map=_response_types_map,
1328
+ )
1329
+
1330
+
1331
+ @validate_call
1332
+ def get_policy_by_id_without_preload_content(
1333
+ self,
1334
+ id: Annotated[StrictStr, Field(description="Automation policy ID")],
1335
+ _request_timeout: Union[
1336
+ None,
1337
+ Annotated[StrictFloat, Field(gt=0)],
1338
+ Tuple[
1339
+ Annotated[StrictFloat, Field(gt=0)],
1340
+ Annotated[StrictFloat, Field(gt=0)]
1341
+ ]
1342
+ ] = None,
1343
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1344
+ _content_type: Optional[StrictStr] = None,
1345
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1346
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1347
+ ) -> RESTResponseType:
1348
+ """Get an automation policy by ID.
1349
+
1350
+ Returns the automation policy filtered by the ID in request parameter. When using personal access tokens, the user must have at least `Viewer` access for Automation and the automation policies returned are also filtered based on the access set in `Limited access` permission settings.
1351
+
1352
+ :param id: Automation policy ID (required)
1353
+ :type id: str
1354
+ :param _request_timeout: timeout setting for this request. If one
1355
+ number provided, it will be total request
1356
+ timeout. It can also be a pair (tuple) of
1357
+ (connection, read) timeouts.
1358
+ :type _request_timeout: int, tuple(int, int), optional
1359
+ :param _request_auth: set to override the auth_settings for an a single
1360
+ request; this effectively ignores the
1361
+ authentication in the spec for a single request.
1362
+ :type _request_auth: dict, optional
1363
+ :param _content_type: force content-type for the request.
1364
+ :type _content_type: str, Optional
1365
+ :param _headers: set to override the headers for a single
1366
+ request; this effectively ignores the headers
1367
+ in the spec for a single request.
1368
+ :type _headers: dict, optional
1369
+ :param _host_index: set to override the host_index for a single
1370
+ request; this effectively ignores the host_index
1371
+ in the spec for a single request.
1372
+ :type _host_index: int, optional
1373
+ :return: Returns the result object.
1374
+ """ # noqa: E501
1375
+
1376
+ _param = self._get_policy_by_id_serialize(
1377
+ id=id,
1378
+ _request_auth=_request_auth,
1379
+ _content_type=_content_type,
1380
+ _headers=_headers,
1381
+ _host_index=_host_index
1382
+ )
1383
+
1384
+ _response_types_map: Dict[str, Optional[str]] = {
1385
+ '200': "Policy",
1386
+ '403': None,
1387
+ '404': None,
1388
+ }
1389
+ response_data = self.api_client.call_api(
1390
+ *_param,
1391
+ _request_timeout=_request_timeout
1392
+ )
1393
+ return response_data.response
1394
+
1395
+
1396
+ def _get_policy_by_id_serialize(
1397
+ self,
1398
+ id,
1399
+ _request_auth,
1400
+ _content_type,
1401
+ _headers,
1402
+ _host_index,
1403
+ ) -> RequestSerialized:
1404
+
1405
+ _host = None
1406
+
1407
+ _collection_formats: Dict[str, str] = {
1408
+ }
1409
+
1410
+ _path_params: Dict[str, str] = {}
1411
+ _query_params: List[Tuple[str, str]] = []
1412
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1413
+ _form_params: List[Tuple[str, str]] = []
1414
+ _files: Dict[
1415
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1416
+ ] = {}
1417
+ _body_params: Optional[bytes] = None
1418
+
1419
+ # process the path parameters
1420
+ if id is not None:
1421
+ _path_params['id'] = id
1422
+ # process the query parameters
1423
+ # process the header parameters
1424
+ # process the form parameters
1425
+ # process the body parameter
1426
+
1427
+
1428
+ # set the HTTP header `Accept`
1429
+ if 'Accept' not in _header_params:
1430
+ _header_params['Accept'] = self.api_client.select_header_accept(
1431
+ [
1432
+ 'application/json'
1433
+ ]
1434
+ )
1435
+
1436
+
1437
+ # authentication setting
1438
+ _auth_settings: List[str] = [
1439
+ 'ApiKeyAuth'
1440
+ ]
1441
+
1442
+ return self.api_client.param_serialize(
1443
+ method='GET',
1444
+ resource_path='/api/automation/policies/{id}',
1445
+ path_params=_path_params,
1446
+ query_params=_query_params,
1447
+ header_params=_header_params,
1448
+ body=_body_params,
1449
+ post_params=_form_params,
1450
+ files=_files,
1451
+ auth_settings=_auth_settings,
1452
+ collection_formats=_collection_formats,
1453
+ _host=_host,
1454
+ _request_auth=_request_auth
1455
+ )
1456
+
1457
+
1458
+
1459
+
1460
+ @validate_call
1461
+ def update_policy(
1462
+ self,
1463
+ id: StrictStr,
1464
+ policy: Policy,
1465
+ _request_timeout: Union[
1466
+ None,
1467
+ Annotated[StrictFloat, Field(gt=0)],
1468
+ Tuple[
1469
+ Annotated[StrictFloat, Field(gt=0)],
1470
+ Annotated[StrictFloat, Field(gt=0)]
1471
+ ]
1472
+ ] = None,
1473
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1474
+ _content_type: Optional[StrictStr] = None,
1475
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1476
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1477
+ ) -> Policy:
1478
+ """Updates an automation policy by identifier.
1479
+
1480
+ Updates an automation policy by identifier. Policy updates requires `Configuration of automation policies` permission. When using personal tokens the automation policies updated are based on the access set in `Limited access` permission settings.
1481
+
1482
+ :param id: (required)
1483
+ :type id: str
1484
+ :param policy: (required)
1485
+ :type policy: Policy
1486
+ :param _request_timeout: timeout setting for this request. If one
1487
+ number provided, it will be total request
1488
+ timeout. It can also be a pair (tuple) of
1489
+ (connection, read) timeouts.
1490
+ :type _request_timeout: int, tuple(int, int), optional
1491
+ :param _request_auth: set to override the auth_settings for an a single
1492
+ request; this effectively ignores the
1493
+ authentication in the spec for a single request.
1494
+ :type _request_auth: dict, optional
1495
+ :param _content_type: force content-type for the request.
1496
+ :type _content_type: str, Optional
1497
+ :param _headers: set to override the headers for a single
1498
+ request; this effectively ignores the headers
1499
+ in the spec for a single request.
1500
+ :type _headers: dict, optional
1501
+ :param _host_index: set to override the host_index for a single
1502
+ request; this effectively ignores the host_index
1503
+ in the spec for a single request.
1504
+ :type _host_index: int, optional
1505
+ :return: Returns the result object.
1506
+ """ # noqa: E501
1507
+
1508
+ _param = self._update_policy_serialize(
1509
+ id=id,
1510
+ policy=policy,
1511
+ _request_auth=_request_auth,
1512
+ _content_type=_content_type,
1513
+ _headers=_headers,
1514
+ _host_index=_host_index
1515
+ )
1516
+
1517
+ _response_types_map: Dict[str, Optional[str]] = {
1518
+ '200': "Policy",
1519
+ '403': None,
1520
+ '412': None,
1521
+ '500': None,
1522
+ }
1523
+ response_data = self.api_client.call_api(
1524
+ *_param,
1525
+ _request_timeout=_request_timeout
1526
+ )
1527
+ response_data.read()
1528
+ return self.api_client.response_deserialize(
1529
+ response_data=response_data,
1530
+ response_types_map=_response_types_map,
1531
+ ).data
1532
+
1533
+
1534
+ @validate_call
1535
+ def update_policy_with_http_info(
1536
+ self,
1537
+ id: StrictStr,
1538
+ policy: Policy,
1539
+ _request_timeout: Union[
1540
+ None,
1541
+ Annotated[StrictFloat, Field(gt=0)],
1542
+ Tuple[
1543
+ Annotated[StrictFloat, Field(gt=0)],
1544
+ Annotated[StrictFloat, Field(gt=0)]
1545
+ ]
1546
+ ] = None,
1547
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1548
+ _content_type: Optional[StrictStr] = None,
1549
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1550
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1551
+ ) -> ApiResponse[Policy]:
1552
+ """Updates an automation policy by identifier.
1553
+
1554
+ Updates an automation policy by identifier. Policy updates requires `Configuration of automation policies` permission. When using personal tokens the automation policies updated are based on the access set in `Limited access` permission settings.
1555
+
1556
+ :param id: (required)
1557
+ :type id: str
1558
+ :param policy: (required)
1559
+ :type policy: Policy
1560
+ :param _request_timeout: timeout setting for this request. If one
1561
+ number provided, it will be total request
1562
+ timeout. It can also be a pair (tuple) of
1563
+ (connection, read) timeouts.
1564
+ :type _request_timeout: int, tuple(int, int), optional
1565
+ :param _request_auth: set to override the auth_settings for an a single
1566
+ request; this effectively ignores the
1567
+ authentication in the spec for a single request.
1568
+ :type _request_auth: dict, optional
1569
+ :param _content_type: force content-type for the request.
1570
+ :type _content_type: str, Optional
1571
+ :param _headers: set to override the headers for a single
1572
+ request; this effectively ignores the headers
1573
+ in the spec for a single request.
1574
+ :type _headers: dict, optional
1575
+ :param _host_index: set to override the host_index for a single
1576
+ request; this effectively ignores the host_index
1577
+ in the spec for a single request.
1578
+ :type _host_index: int, optional
1579
+ :return: Returns the result object.
1580
+ """ # noqa: E501
1581
+
1582
+ _param = self._update_policy_serialize(
1583
+ id=id,
1584
+ policy=policy,
1585
+ _request_auth=_request_auth,
1586
+ _content_type=_content_type,
1587
+ _headers=_headers,
1588
+ _host_index=_host_index
1589
+ )
1590
+
1591
+ _response_types_map: Dict[str, Optional[str]] = {
1592
+ '200': "Policy",
1593
+ '403': None,
1594
+ '412': None,
1595
+ '500': None,
1596
+ }
1597
+ response_data = self.api_client.call_api(
1598
+ *_param,
1599
+ _request_timeout=_request_timeout
1600
+ )
1601
+ response_data.read()
1602
+ return self.api_client.response_deserialize(
1603
+ response_data=response_data,
1604
+ response_types_map=_response_types_map,
1605
+ )
1606
+
1607
+
1608
+ @validate_call
1609
+ def update_policy_without_preload_content(
1610
+ self,
1611
+ id: StrictStr,
1612
+ policy: Policy,
1613
+ _request_timeout: Union[
1614
+ None,
1615
+ Annotated[StrictFloat, Field(gt=0)],
1616
+ Tuple[
1617
+ Annotated[StrictFloat, Field(gt=0)],
1618
+ Annotated[StrictFloat, Field(gt=0)]
1619
+ ]
1620
+ ] = None,
1621
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1622
+ _content_type: Optional[StrictStr] = None,
1623
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1624
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1625
+ ) -> RESTResponseType:
1626
+ """Updates an automation policy by identifier.
1627
+
1628
+ Updates an automation policy by identifier. Policy updates requires `Configuration of automation policies` permission. When using personal tokens the automation policies updated are based on the access set in `Limited access` permission settings.
1629
+
1630
+ :param id: (required)
1631
+ :type id: str
1632
+ :param policy: (required)
1633
+ :type policy: Policy
1634
+ :param _request_timeout: timeout setting for this request. If one
1635
+ number provided, it will be total request
1636
+ timeout. It can also be a pair (tuple) of
1637
+ (connection, read) timeouts.
1638
+ :type _request_timeout: int, tuple(int, int), optional
1639
+ :param _request_auth: set to override the auth_settings for an a single
1640
+ request; this effectively ignores the
1641
+ authentication in the spec for a single request.
1642
+ :type _request_auth: dict, optional
1643
+ :param _content_type: force content-type for the request.
1644
+ :type _content_type: str, Optional
1645
+ :param _headers: set to override the headers for a single
1646
+ request; this effectively ignores the headers
1647
+ in the spec for a single request.
1648
+ :type _headers: dict, optional
1649
+ :param _host_index: set to override the host_index for a single
1650
+ request; this effectively ignores the host_index
1651
+ in the spec for a single request.
1652
+ :type _host_index: int, optional
1653
+ :return: Returns the result object.
1654
+ """ # noqa: E501
1655
+
1656
+ _param = self._update_policy_serialize(
1657
+ id=id,
1658
+ policy=policy,
1659
+ _request_auth=_request_auth,
1660
+ _content_type=_content_type,
1661
+ _headers=_headers,
1662
+ _host_index=_host_index
1663
+ )
1664
+
1665
+ _response_types_map: Dict[str, Optional[str]] = {
1666
+ '200': "Policy",
1667
+ '403': None,
1668
+ '412': None,
1669
+ '500': None,
1670
+ }
1671
+ response_data = self.api_client.call_api(
1672
+ *_param,
1673
+ _request_timeout=_request_timeout
1674
+ )
1675
+ return response_data.response
1676
+
1677
+
1678
+ def _update_policy_serialize(
1679
+ self,
1680
+ id,
1681
+ policy,
1682
+ _request_auth,
1683
+ _content_type,
1684
+ _headers,
1685
+ _host_index,
1686
+ ) -> RequestSerialized:
1687
+
1688
+ _host = None
1689
+
1690
+ _collection_formats: Dict[str, str] = {
1691
+ }
1692
+
1693
+ _path_params: Dict[str, str] = {}
1694
+ _query_params: List[Tuple[str, str]] = []
1695
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1696
+ _form_params: List[Tuple[str, str]] = []
1697
+ _files: Dict[
1698
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1699
+ ] = {}
1700
+ _body_params: Optional[bytes] = None
1701
+
1702
+ # process the path parameters
1703
+ if id is not None:
1704
+ _path_params['id'] = id
1705
+ # process the query parameters
1706
+ # process the header parameters
1707
+ # process the form parameters
1708
+ # process the body parameter
1709
+ if policy is not None:
1710
+ _body_params = policy
1711
+
1712
+
1713
+ # set the HTTP header `Accept`
1714
+ if 'Accept' not in _header_params:
1715
+ _header_params['Accept'] = self.api_client.select_header_accept(
1716
+ [
1717
+ 'application/json'
1718
+ ]
1719
+ )
1720
+
1721
+ # set the HTTP header `Content-Type`
1722
+ if _content_type:
1723
+ _header_params['Content-Type'] = _content_type
1724
+ else:
1725
+ _default_content_type = (
1726
+ self.api_client.select_header_content_type(
1727
+ [
1728
+ 'application/json'
1729
+ ]
1730
+ )
1731
+ )
1732
+ if _default_content_type is not None:
1733
+ _header_params['Content-Type'] = _default_content_type
1734
+
1735
+ # authentication setting
1736
+ _auth_settings: List[str] = [
1737
+ 'ApiKeyAuth'
1738
+ ]
1739
+
1740
+ return self.api_client.param_serialize(
1741
+ method='PUT',
1742
+ resource_path='/api/automation/policies/{id}',
1743
+ path_params=_path_params,
1744
+ query_params=_query_params,
1745
+ header_params=_header_params,
1746
+ body=_body_params,
1747
+ post_params=_form_params,
1748
+ files=_files,
1749
+ auth_settings=_auth_settings,
1750
+ collection_formats=_collection_formats,
1751
+ _host=_host,
1752
+ _request_auth=_request_auth
1753
+ )
1754
+
1755
+