azure_mgmt_security_insights 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (331) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights.rb +254 -0
  4. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/actions.rb +255 -0
  5. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/alert_rule_templates.rb +365 -0
  6. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/alert_rules.rb +966 -0
  7. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/bookmark_operations.rb +154 -0
  8. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/bookmark_relations.rb +651 -0
  9. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/bookmarks.rb +602 -0
  10. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/case_comments.rb +155 -0
  11. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/case_relations.rb +652 -0
  12. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/cases.rb +752 -0
  13. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/cases_aggregations.rb +140 -0
  14. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/comments.rb +287 -0
  15. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/data_connectors.rb +603 -0
  16. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/data_connectors_check_requirements_operations.rb +150 -0
  17. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/entities.rb +492 -0
  18. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/entities_relations.rb +287 -0
  19. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/entity_queries.rb +364 -0
  20. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/entity_relations.rb +144 -0
  21. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/incident_comments.rb +652 -0
  22. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/incident_relations.rb +651 -0
  23. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/incidents.rb +976 -0
  24. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aadcheck_requirements.rb +61 -0
  25. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aaddata_connector.rb +109 -0
  26. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aatpcheck_requirements.rb +62 -0
  27. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aatpdata_connector.rb +109 -0
  28. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/account_entity.rb +261 -0
  29. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/action_properties_base.rb +47 -0
  30. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/action_request.rb +93 -0
  31. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/action_response.rb +96 -0
  32. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/actions_list.rb +99 -0
  33. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aggregations.rb +82 -0
  34. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aggregations_kind.rb +49 -0
  35. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule.rb +95 -0
  36. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule_kind.rb +17 -0
  37. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule_kind1.rb +47 -0
  38. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule_template.rb +84 -0
  39. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule_template_data_source.rb +66 -0
  40. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule_template_properties_base.rb +115 -0
  41. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rule_templates_list.rb +101 -0
  42. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_rules_list.rb +101 -0
  43. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_severity.rb +18 -0
  44. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alert_status.rb +19 -0
  45. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alerts_data_type_of_data_connector.rb +48 -0
  46. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/alerts_data_type_of_data_connector_alerts.rb +43 -0
  47. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/asccheck_requirements.rb +62 -0
  48. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ascdata_connector.rb +110 -0
  49. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/attack_tactic.rb +27 -0
  50. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aws_cloud_trail_check_requirements.rb +50 -0
  51. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aws_cloud_trail_data_connector.rb +110 -0
  52. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aws_cloud_trail_data_connector_data_types.rb +48 -0
  53. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/aws_cloud_trail_data_connector_data_types_logs.rb +43 -0
  54. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/azure_resource_entity.rb +136 -0
  55. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/bookmark.rb +191 -0
  56. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/bookmark_expand_parameters.rb +71 -0
  57. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/bookmark_expand_response.rb +60 -0
  58. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/bookmark_expand_response_value.rb +57 -0
  59. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/bookmark_list.rb +99 -0
  60. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_comment.rb +98 -0
  61. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_comment_list.rb +99 -0
  62. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_list.rb +99 -0
  63. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_model.rb +293 -0
  64. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_relation.rb +123 -0
  65. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_relation_list.rb +99 -0
  66. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_severity.rb +19 -0
  67. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/case_status.rb +18 -0
  68. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/cases_aggregation.rb +103 -0
  69. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/cases_aggregation_by_severity_properties.rb +96 -0
  70. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/cases_aggregation_by_status_properties.rb +83 -0
  71. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/client_info.rb +79 -0
  72. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/close_reason.rb +19 -0
  73. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/cloud_application_entity.rb +150 -0
  74. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/confidence_level.rb +17 -0
  75. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/confidence_score_status.rb +18 -0
  76. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector.rb +102 -0
  77. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_authorization_state.rb +16 -0
  78. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_data_type_common.rb +47 -0
  79. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_kind.rb +24 -0
  80. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_kind1.rb +51 -0
  81. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_license_state.rb +17 -0
  82. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_list.rb +101 -0
  83. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_requirements_state.rb +59 -0
  84. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_tenant_id.rb +46 -0
  85. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connector_with_alerts_properties.rb +48 -0
  86. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_connectors_check_requirements.rb +54 -0
  87. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/data_type_state.rb +16 -0
  88. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/dns_entity.rb +170 -0
  89. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/elevation_token.rb +17 -0
  90. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entities_matching_method.rb +17 -0
  91. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity.rb +98 -0
  92. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_analytics.rb +97 -0
  93. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_common_properties.rb +70 -0
  94. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_expand_parameters.rb +71 -0
  95. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_expand_response.rb +60 -0
  96. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_expand_response_value.rb +57 -0
  97. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_kind.rb +31 -0
  98. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_kind1.rb +50 -0
  99. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_list.rb +101 -0
  100. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_query.rb +159 -0
  101. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_query_list.rb +99 -0
  102. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/entity_type.rb +31 -0
  103. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/event_grouping_aggregation_kind.rb +16 -0
  104. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/event_grouping_settings.rb +47 -0
  105. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/expansion_result_aggregation.rb +85 -0
  106. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/expansion_results_metadata.rb +56 -0
  107. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/eyes_on.rb +97 -0
  108. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/file_entity.rb +170 -0
  109. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/file_hash_algorithm.rb +19 -0
  110. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/file_hash_entity.rb +137 -0
  111. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/fusion_alert_rule.rb +179 -0
  112. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/fusion_alert_rule_template.rb +188 -0
  113. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/geo_location.rb +126 -0
  114. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/grouping_configuration.rb +101 -0
  115. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/grouping_entity_type.rb +18 -0
  116. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/host_entity.rb +224 -0
  117. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/hunting_bookmark.rb +244 -0
  118. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident.rb +291 -0
  119. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_additional_data.rb +111 -0
  120. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_alert_list.rb +55 -0
  121. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_bookmark_list.rb +55 -0
  122. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_classification.rb +18 -0
  123. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_classification_reason.rb +18 -0
  124. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_comment.rb +118 -0
  125. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_comment_list.rb +99 -0
  126. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_configuration.rb +60 -0
  127. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_entities_response.rb +78 -0
  128. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_entities_results_metadata.rb +63 -0
  129. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_info.rb +80 -0
  130. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_label.rb +59 -0
  131. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_label_type.rb +16 -0
  132. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_list.rb +99 -0
  133. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_owner_info.rb +80 -0
  134. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_severity.rb +18 -0
  135. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/incident_status.rb +17 -0
  136. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/io_tdevice_entity.rb +218 -0
  137. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ip_entity.rb +160 -0
  138. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/kill_chain_intent.rb +28 -0
  139. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/malware_entity.rb +178 -0
  140. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/mcascheck_requirements.rb +62 -0
  141. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/mcasdata_connector.rb +109 -0
  142. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/mcasdata_connector_data_types.rb +58 -0
  143. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/mcasdata_connector_data_types_discovery_logs.rb +43 -0
  144. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/mdatpcheck_requirements.rb +62 -0
  145. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/mdatpdata_connector.rb +110 -0
  146. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/microsoft_security_incident_creation_alert_rule.rb +221 -0
  147. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/microsoft_security_incident_creation_alert_rule_common_properties.rb +112 -0
  148. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/microsoft_security_incident_creation_alert_rule_template.rb +234 -0
  149. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/microsoft_security_product_name.rb +21 -0
  150. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_atpcheck_requirements.rb +62 -0
  151. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_atpdata_connector.rb +110 -0
  152. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_consent.rb +85 -0
  153. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_consent_list.rb +99 -0
  154. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_data_connector.rb +109 -0
  155. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_data_connector_data_types.rb +73 -0
  156. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_data_connector_data_types_exchange.rb +43 -0
  157. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_data_connector_data_types_share_point.rb +43 -0
  158. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/office_data_connector_data_types_teams.rb +43 -0
  159. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/operation.rb +58 -0
  160. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/operation_display.rb +79 -0
  161. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/operations_list.rb +98 -0
  162. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/osfamily.rb +18 -0
  163. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/process_entity.rb +221 -0
  164. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/registry_hive.rb +24 -0
  165. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/registry_key_entity.rb +141 -0
  166. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/registry_value_entity.rb +163 -0
  167. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/registry_value_kind.rb +22 -0
  168. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relation.rb +117 -0
  169. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relation_base.rb +86 -0
  170. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relation_list.rb +99 -0
  171. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relation_node.rb +89 -0
  172. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relation_node_kind.rb +16 -0
  173. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relation_types.rb +15 -0
  174. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/relations_model_input.rb +114 -0
  175. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/resource.rb +80 -0
  176. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/resource_with_etag.rb +82 -0
  177. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/scheduled_alert_rule.rb +285 -0
  178. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/scheduled_alert_rule_common_properties.rb +119 -0
  179. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/scheduled_alert_rule_template.rb +260 -0
  180. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/security_alert.rb +462 -0
  181. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/security_alert_properties_confidence_reasons_item.rb +60 -0
  182. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/security_group_entity.rb +150 -0
  183. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/setting_kind.rb +17 -0
  184. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/setting_list.rb +57 -0
  185. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/settings.rb +95 -0
  186. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/settings_kind.rb +47 -0
  187. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/source.rb +16 -0
  188. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/template_status.rb +17 -0
  189. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence.rb +108 -0
  190. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_append_tags_request_body.rb +54 -0
  191. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_arm_stix_query.rb +227 -0
  192. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_arm_stix_sort_by.rb +17 -0
  193. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_arm_stix_sort_by1.rb +58 -0
  194. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_granular_marking_model.rb +76 -0
  195. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_indicator_model.rb +410 -0
  196. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_indicator_without_read_only_fields.rb +382 -0
  197. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_kill_chain_phase.rb +57 -0
  198. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_metric.rb +106 -0
  199. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_metric_entity.rb +57 -0
  200. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_metric_resource.rb +47 -0
  201. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_metric_resource_list.rb +56 -0
  202. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_resource.rb +93 -0
  203. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_resource_kind.rb +15 -0
  204. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_resource_kind1.rb +48 -0
  205. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/threat_intelligence_resource_list.rb +102 -0
  206. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ti_taxii_check_requirements.rb +61 -0
  207. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ti_taxii_data_connector.rb +175 -0
  208. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ti_taxii_data_connector_data_types.rb +48 -0
  209. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ti_taxii_data_connector_data_types_taxii_client.rb +43 -0
  210. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ticheck_requirements.rb +61 -0
  211. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/tidata_connector.rb +109 -0
  212. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/tidata_connector_data_types.rb +49 -0
  213. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/tidata_connector_data_types_indicators.rb +43 -0
  214. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/trigger_operator.rb +18 -0
  215. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ueba.rb +105 -0
  216. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/ueba_data_sources.rb +18 -0
  217. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/url_entity.rb +124 -0
  218. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/user_info.rb +70 -0
  219. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/watchlist.rb +256 -0
  220. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/watchlist_item.rb +185 -0
  221. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/models/watchlist_list.rb +99 -0
  222. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/module_definition.rb +9 -0
  223. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/office_consents.rb +468 -0
  224. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/operations.rb +219 -0
  225. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/product_settings.rb +487 -0
  226. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/security_insights.rb +384 -0
  227. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/threat_intelligence_indicator.rb +494 -0
  228. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/threat_intelligence_indicator_metrics.rb +139 -0
  229. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/threat_intelligence_indicator_upsert.rb +167 -0
  230. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/threat_intelligence_indicators.rb +283 -0
  231. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/threat_intelligence_indicators_list.rb +267 -0
  232. data/lib/2019-01-01-preview/generated/azure_mgmt_security_insights/watchlists.rb +814 -0
  233. data/lib/2020-01-01/generated/azure_mgmt_security_insights.rb +116 -0
  234. data/lib/2020-01-01/generated/azure_mgmt_security_insights/actions.rb +246 -0
  235. data/lib/2020-01-01/generated/azure_mgmt_security_insights/alert_rule_templates.rb +349 -0
  236. data/lib/2020-01-01/generated/azure_mgmt_security_insights/alert_rules.rb +915 -0
  237. data/lib/2020-01-01/generated/azure_mgmt_security_insights/bookmarks.rb +572 -0
  238. data/lib/2020-01-01/generated/azure_mgmt_security_insights/data_connectors.rb +573 -0
  239. data/lib/2020-01-01/generated/azure_mgmt_security_insights/incident_comments.rb +512 -0
  240. data/lib/2020-01-01/generated/azure_mgmt_security_insights/incidents.rb +604 -0
  241. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/aaddata_connector.rb +109 -0
  242. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/aatpdata_connector.rb +109 -0
  243. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/action_properties_base.rb +47 -0
  244. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/action_request.rb +93 -0
  245. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/action_response.rb +96 -0
  246. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/actions_list.rb +99 -0
  247. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_rule.rb +79 -0
  248. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_rule_kind.rb +17 -0
  249. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_rule_template.rb +71 -0
  250. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_rule_template_data_source.rb +66 -0
  251. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_rule_templates_list.rb +101 -0
  252. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_rules_list.rb +101 -0
  253. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alert_severity.rb +18 -0
  254. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/alerts_data_type_of_data_connector.rb +47 -0
  255. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/ascdata_connector.rb +110 -0
  256. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/attack_tactic.rb +26 -0
  257. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/aws_cloud_trail_data_connector.rb +110 -0
  258. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/aws_cloud_trail_data_connector_data_types.rb +48 -0
  259. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/aws_cloud_trail_data_connector_data_types_logs.rb +43 -0
  260. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/bookmark.rb +191 -0
  261. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/bookmark_list.rb +99 -0
  262. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/case_severity.rb +19 -0
  263. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/client_info.rb +79 -0
  264. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_connector.rb +79 -0
  265. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_connector_data_type_common.rb +47 -0
  266. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_connector_kind.rb +22 -0
  267. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_connector_list.rb +101 -0
  268. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_connector_tenant_id.rb +46 -0
  269. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_connector_with_alerts_properties.rb +48 -0
  270. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/data_type_state.rb +16 -0
  271. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/error_additional_info.rb +59 -0
  272. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/error_response.rb +117 -0
  273. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/fusion_alert_rule.rb +179 -0
  274. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/fusion_alert_rule_template.rb +188 -0
  275. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident.rb +291 -0
  276. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_additional_data.rb +111 -0
  277. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_classification.rb +18 -0
  278. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_classification_reason.rb +18 -0
  279. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_comment.rb +98 -0
  280. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_comment_list.rb +99 -0
  281. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_info.rb +80 -0
  282. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_label.rb +59 -0
  283. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_label_type.rb +16 -0
  284. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_list.rb +99 -0
  285. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_owner_info.rb +80 -0
  286. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_severity.rb +18 -0
  287. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/incident_status.rb +17 -0
  288. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/license_status.rb +16 -0
  289. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/mcasdata_connector.rb +109 -0
  290. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/mcasdata_connector_data_types.rb +58 -0
  291. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/mdatpdata_connector.rb +110 -0
  292. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/microsoft_security_incident_creation_alert_rule.rb +220 -0
  293. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/microsoft_security_incident_creation_alert_rule_common_properties.rb +111 -0
  294. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/microsoft_security_incident_creation_alert_rule_template.rb +233 -0
  295. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/microsoft_security_product_name.rb +19 -0
  296. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/office_consent.rb +85 -0
  297. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/office_consent_list.rb +67 -0
  298. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/office_data_connector.rb +109 -0
  299. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/office_data_connector_data_types.rb +61 -0
  300. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/office_data_connector_data_types_exchange.rb +43 -0
  301. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/office_data_connector_data_types_share_point.rb +43 -0
  302. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/operation.rb +58 -0
  303. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/operation_display.rb +79 -0
  304. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/operations_list.rb +98 -0
  305. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/resource.rb +80 -0
  306. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/resource_with_etag.rb +82 -0
  307. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/scheduled_alert_rule.rb +260 -0
  308. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/scheduled_alert_rule_common_properties.rb +107 -0
  309. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/scheduled_alert_rule_template.rb +248 -0
  310. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/setting_kind.rb +16 -0
  311. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/settings.rb +79 -0
  312. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/status_in_mcas.rb +16 -0
  313. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/template_status.rb +17 -0
  314. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/threat_intelligence.rb +108 -0
  315. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/tidata_connector.rb +109 -0
  316. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/tidata_connector_data_types.rb +48 -0
  317. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/tidata_connector_data_types_indicators.rb +43 -0
  318. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/toggle_settings.rb +96 -0
  319. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/trigger_operator.rb +18 -0
  320. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/ueba_settings.rb +125 -0
  321. data/lib/2020-01-01/generated/azure_mgmt_security_insights/models/user_info.rb +70 -0
  322. data/lib/2020-01-01/generated/azure_mgmt_security_insights/module_definition.rb +9 -0
  323. data/lib/2020-01-01/generated/azure_mgmt_security_insights/operations.rb +219 -0
  324. data/lib/2020-01-01/generated/azure_mgmt_security_insights/security_insights.rb +159 -0
  325. data/lib/azure_mgmt_security_insights.rb +7 -0
  326. data/lib/module_definition.rb +7 -0
  327. data/lib/profiles/latest/modules/securityinsights_profile_module.rb +399 -0
  328. data/lib/profiles/latest/securityinsights_latest_profile_client.rb +40 -0
  329. data/lib/profiles/latest/securityinsights_module_definition.rb +8 -0
  330. data/lib/version.rb +7 -0
  331. metadata +446 -0
@@ -0,0 +1,365 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::SecurityInsights::Mgmt::V2019_01_01_preview
7
+ #
8
+ # API spec for Microsoft.SecurityInsights (Azure Security Insights) resource
9
+ # provider
10
+ #
11
+ class AlertRuleTemplates
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the AlertRuleTemplates class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [SecurityInsights] reference to the SecurityInsights
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets all alert rule templates.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group within the
29
+ # user's subscription. The name is case insensitive.
30
+ # @param operational_insights_resource_provider [String] The namespace of
31
+ # workspaces resource provider- Microsoft.OperationalInsights.
32
+ # @param workspace_name [String] The name of the workspace.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [Array<AlertRuleTemplate>] operation results.
37
+ #
38
+ def list(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:nil)
39
+ first_page = list_as_lazy(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:custom_headers)
40
+ first_page.get_all_items
41
+ end
42
+
43
+ #
44
+ # Gets all alert rule templates.
45
+ #
46
+ # @param resource_group_name [String] The name of the resource group within the
47
+ # user's subscription. The name is case insensitive.
48
+ # @param operational_insights_resource_provider [String] The namespace of
49
+ # workspaces resource provider- Microsoft.OperationalInsights.
50
+ # @param workspace_name [String] The name of the workspace.
51
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
+ # will be added to the HTTP request.
53
+ #
54
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
55
+ #
56
+ def list_with_http_info(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:nil)
57
+ list_async(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:custom_headers).value!
58
+ end
59
+
60
+ #
61
+ # Gets all alert rule templates.
62
+ #
63
+ # @param resource_group_name [String] The name of the resource group within the
64
+ # user's subscription. The name is case insensitive.
65
+ # @param operational_insights_resource_provider [String] The namespace of
66
+ # workspaces resource provider- Microsoft.OperationalInsights.
67
+ # @param workspace_name [String] The name of the workspace.
68
+ # @param [Hash{String => String}] A hash of custom headers that will be added
69
+ # to the HTTP request.
70
+ #
71
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
72
+ #
73
+ def list_async(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:nil)
74
+ @client.api_version = '2019-01-01-preview'
75
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
76
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
77
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
78
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
79
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
80
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
81
+ fail ArgumentError, 'operational_insights_resource_provider is nil' if operational_insights_resource_provider.nil?
82
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
83
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
84
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
85
+
86
+
87
+ request_headers = {}
88
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
89
+
90
+ # Set Headers
91
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
92
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
93
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates'
94
+
95
+ request_url = @base_url || @client.base_url
96
+
97
+ options = {
98
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
99
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'operationalInsightsResourceProvider' => operational_insights_resource_provider,'workspaceName' => workspace_name},
100
+ query_params: {'api-version' => @client.api_version},
101
+ headers: request_headers.merge(custom_headers || {}),
102
+ base_url: request_url
103
+ }
104
+ promise = @client.make_request_async(:get, path_template, options)
105
+
106
+ promise = promise.then do |result|
107
+ http_response = result.response
108
+ status_code = http_response.status
109
+ response_content = http_response.body
110
+ unless status_code == 200
111
+ error_model = JSON.load(response_content)
112
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
113
+ end
114
+
115
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
116
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
117
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
118
+ # Deserialize Response
119
+ if status_code == 200
120
+ begin
121
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
122
+ result_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::AlertRuleTemplatesList.mapper()
123
+ result.body = @client.deserialize(result_mapper, parsed_response)
124
+ rescue Exception => e
125
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
126
+ end
127
+ end
128
+
129
+ result
130
+ end
131
+
132
+ promise.execute
133
+ end
134
+
135
+ #
136
+ # Gets the alert rule template.
137
+ #
138
+ # @param resource_group_name [String] The name of the resource group within the
139
+ # user's subscription. The name is case insensitive.
140
+ # @param operational_insights_resource_provider [String] The namespace of
141
+ # workspaces resource provider- Microsoft.OperationalInsights.
142
+ # @param workspace_name [String] The name of the workspace.
143
+ # @param alert_rule_template_id [String] Alert rule template ID
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [AlertRuleTemplate] operation results.
148
+ #
149
+ def get(resource_group_name, operational_insights_resource_provider, workspace_name, alert_rule_template_id, custom_headers:nil)
150
+ response = get_async(resource_group_name, operational_insights_resource_provider, workspace_name, alert_rule_template_id, custom_headers:custom_headers).value!
151
+ response.body unless response.nil?
152
+ end
153
+
154
+ #
155
+ # Gets the alert rule template.
156
+ #
157
+ # @param resource_group_name [String] The name of the resource group within the
158
+ # user's subscription. The name is case insensitive.
159
+ # @param operational_insights_resource_provider [String] The namespace of
160
+ # workspaces resource provider- Microsoft.OperationalInsights.
161
+ # @param workspace_name [String] The name of the workspace.
162
+ # @param alert_rule_template_id [String] Alert rule template ID
163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
164
+ # will be added to the HTTP request.
165
+ #
166
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
167
+ #
168
+ def get_with_http_info(resource_group_name, operational_insights_resource_provider, workspace_name, alert_rule_template_id, custom_headers:nil)
169
+ get_async(resource_group_name, operational_insights_resource_provider, workspace_name, alert_rule_template_id, custom_headers:custom_headers).value!
170
+ end
171
+
172
+ #
173
+ # Gets the alert rule template.
174
+ #
175
+ # @param resource_group_name [String] The name of the resource group within the
176
+ # user's subscription. The name is case insensitive.
177
+ # @param operational_insights_resource_provider [String] The namespace of
178
+ # workspaces resource provider- Microsoft.OperationalInsights.
179
+ # @param workspace_name [String] The name of the workspace.
180
+ # @param alert_rule_template_id [String] Alert rule template ID
181
+ # @param [Hash{String => String}] A hash of custom headers that will be added
182
+ # to the HTTP request.
183
+ #
184
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
185
+ #
186
+ def get_async(resource_group_name, operational_insights_resource_provider, workspace_name, alert_rule_template_id, custom_headers:nil)
187
+ @client.api_version = '2019-01-01-preview'
188
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
189
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
190
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
191
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
192
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
193
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
194
+ fail ArgumentError, 'operational_insights_resource_provider is nil' if operational_insights_resource_provider.nil?
195
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
196
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
197
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
198
+ fail ArgumentError, 'alert_rule_template_id is nil' if alert_rule_template_id.nil?
199
+
200
+
201
+ request_headers = {}
202
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
203
+
204
+ # Set Headers
205
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
206
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
207
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates/{alertRuleTemplateId}'
208
+
209
+ request_url = @base_url || @client.base_url
210
+
211
+ options = {
212
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
213
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'operationalInsightsResourceProvider' => operational_insights_resource_provider,'workspaceName' => workspace_name,'alertRuleTemplateId' => alert_rule_template_id},
214
+ query_params: {'api-version' => @client.api_version},
215
+ headers: request_headers.merge(custom_headers || {}),
216
+ base_url: request_url
217
+ }
218
+ promise = @client.make_request_async(:get, path_template, options)
219
+
220
+ promise = promise.then do |result|
221
+ http_response = result.response
222
+ status_code = http_response.status
223
+ response_content = http_response.body
224
+ unless status_code == 200
225
+ error_model = JSON.load(response_content)
226
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
227
+ end
228
+
229
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
230
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
231
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
232
+ # Deserialize Response
233
+ if status_code == 200
234
+ begin
235
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
236
+ result_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::AlertRuleTemplate.mapper()
237
+ result.body = @client.deserialize(result_mapper, parsed_response)
238
+ rescue Exception => e
239
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
240
+ end
241
+ end
242
+
243
+ result
244
+ end
245
+
246
+ promise.execute
247
+ end
248
+
249
+ #
250
+ # Gets all alert rule templates.
251
+ #
252
+ # @param next_page_link [String] The NextLink from the previous successful call
253
+ # to List operation.
254
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
255
+ # will be added to the HTTP request.
256
+ #
257
+ # @return [AlertRuleTemplatesList] operation results.
258
+ #
259
+ def list_next(next_page_link, custom_headers:nil)
260
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
261
+ response.body unless response.nil?
262
+ end
263
+
264
+ #
265
+ # Gets all alert rule templates.
266
+ #
267
+ # @param next_page_link [String] The NextLink from the previous successful call
268
+ # to List operation.
269
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
270
+ # will be added to the HTTP request.
271
+ #
272
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
273
+ #
274
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
275
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
276
+ end
277
+
278
+ #
279
+ # Gets all alert rule templates.
280
+ #
281
+ # @param next_page_link [String] The NextLink from the previous successful call
282
+ # to List operation.
283
+ # @param [Hash{String => String}] A hash of custom headers that will be added
284
+ # to the HTTP request.
285
+ #
286
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
287
+ #
288
+ def list_next_async(next_page_link, custom_headers:nil)
289
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
290
+
291
+
292
+ request_headers = {}
293
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
294
+
295
+ # Set Headers
296
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
297
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
298
+ path_template = '{nextLink}'
299
+
300
+ request_url = @base_url || @client.base_url
301
+
302
+ options = {
303
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
304
+ skip_encoding_path_params: {'nextLink' => next_page_link},
305
+ headers: request_headers.merge(custom_headers || {}),
306
+ base_url: request_url
307
+ }
308
+ promise = @client.make_request_async(:get, path_template, options)
309
+
310
+ promise = promise.then do |result|
311
+ http_response = result.response
312
+ status_code = http_response.status
313
+ response_content = http_response.body
314
+ unless status_code == 200
315
+ error_model = JSON.load(response_content)
316
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
317
+ end
318
+
319
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
320
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
321
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
322
+ # Deserialize Response
323
+ if status_code == 200
324
+ begin
325
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
326
+ result_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::AlertRuleTemplatesList.mapper()
327
+ result.body = @client.deserialize(result_mapper, parsed_response)
328
+ rescue Exception => e
329
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
330
+ end
331
+ end
332
+
333
+ result
334
+ end
335
+
336
+ promise.execute
337
+ end
338
+
339
+ #
340
+ # Gets all alert rule templates.
341
+ #
342
+ # @param resource_group_name [String] The name of the resource group within the
343
+ # user's subscription. The name is case insensitive.
344
+ # @param operational_insights_resource_provider [String] The namespace of
345
+ # workspaces resource provider- Microsoft.OperationalInsights.
346
+ # @param workspace_name [String] The name of the workspace.
347
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
348
+ # will be added to the HTTP request.
349
+ #
350
+ # @return [AlertRuleTemplatesList] which provide lazy access to pages of the
351
+ # response.
352
+ #
353
+ def list_as_lazy(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:nil)
354
+ response = list_async(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:custom_headers).value!
355
+ unless response.nil?
356
+ page = response.body
357
+ page.next_method = Proc.new do |next_page_link|
358
+ list_next_async(next_page_link, custom_headers:custom_headers)
359
+ end
360
+ page
361
+ end
362
+ end
363
+
364
+ end
365
+ end
@@ -0,0 +1,966 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::SecurityInsights::Mgmt::V2019_01_01_preview
7
+ #
8
+ # API spec for Microsoft.SecurityInsights (Azure Security Insights) resource
9
+ # provider
10
+ #
11
+ class AlertRules
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the AlertRules class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [SecurityInsights] reference to the SecurityInsights
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets all alert rules.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group within the
29
+ # user's subscription. The name is case insensitive.
30
+ # @param operational_insights_resource_provider [String] The namespace of
31
+ # workspaces resource provider- Microsoft.OperationalInsights.
32
+ # @param workspace_name [String] The name of the workspace.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [Array<AlertRule>] operation results.
37
+ #
38
+ def list(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:nil)
39
+ first_page = list_as_lazy(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:custom_headers)
40
+ first_page.get_all_items
41
+ end
42
+
43
+ #
44
+ # Gets all alert rules.
45
+ #
46
+ # @param resource_group_name [String] The name of the resource group within the
47
+ # user's subscription. The name is case insensitive.
48
+ # @param operational_insights_resource_provider [String] The namespace of
49
+ # workspaces resource provider- Microsoft.OperationalInsights.
50
+ # @param workspace_name [String] The name of the workspace.
51
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
+ # will be added to the HTTP request.
53
+ #
54
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
55
+ #
56
+ def list_with_http_info(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:nil)
57
+ list_async(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:custom_headers).value!
58
+ end
59
+
60
+ #
61
+ # Gets all alert rules.
62
+ #
63
+ # @param resource_group_name [String] The name of the resource group within the
64
+ # user's subscription. The name is case insensitive.
65
+ # @param operational_insights_resource_provider [String] The namespace of
66
+ # workspaces resource provider- Microsoft.OperationalInsights.
67
+ # @param workspace_name [String] The name of the workspace.
68
+ # @param [Hash{String => String}] A hash of custom headers that will be added
69
+ # to the HTTP request.
70
+ #
71
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
72
+ #
73
+ def list_async(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:nil)
74
+ @client.api_version = '2019-01-01-preview'
75
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
76
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
77
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
78
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
79
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
80
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
81
+ fail ArgumentError, 'operational_insights_resource_provider is nil' if operational_insights_resource_provider.nil?
82
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
83
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
84
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
85
+
86
+
87
+ request_headers = {}
88
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
89
+
90
+ # Set Headers
91
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
92
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
93
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules'
94
+
95
+ request_url = @base_url || @client.base_url
96
+
97
+ options = {
98
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
99
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'operationalInsightsResourceProvider' => operational_insights_resource_provider,'workspaceName' => workspace_name},
100
+ query_params: {'api-version' => @client.api_version},
101
+ headers: request_headers.merge(custom_headers || {}),
102
+ base_url: request_url
103
+ }
104
+ promise = @client.make_request_async(:get, path_template, options)
105
+
106
+ promise = promise.then do |result|
107
+ http_response = result.response
108
+ status_code = http_response.status
109
+ response_content = http_response.body
110
+ unless status_code == 200
111
+ error_model = JSON.load(response_content)
112
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
113
+ end
114
+
115
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
116
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
117
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
118
+ # Deserialize Response
119
+ if status_code == 200
120
+ begin
121
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
122
+ result_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::AlertRulesList.mapper()
123
+ result.body = @client.deserialize(result_mapper, parsed_response)
124
+ rescue Exception => e
125
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
126
+ end
127
+ end
128
+
129
+ result
130
+ end
131
+
132
+ promise.execute
133
+ end
134
+
135
+ #
136
+ # Gets the alert rule.
137
+ #
138
+ # @param resource_group_name [String] The name of the resource group within the
139
+ # user's subscription. The name is case insensitive.
140
+ # @param operational_insights_resource_provider [String] The namespace of
141
+ # workspaces resource provider- Microsoft.OperationalInsights.
142
+ # @param workspace_name [String] The name of the workspace.
143
+ # @param rule_id [String] Alert rule ID
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [AlertRule] operation results.
148
+ #
149
+ def get(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers:nil)
150
+ response = get_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers:custom_headers).value!
151
+ response.body unless response.nil?
152
+ end
153
+
154
+ #
155
+ # Gets the alert rule.
156
+ #
157
+ # @param resource_group_name [String] The name of the resource group within the
158
+ # user's subscription. The name is case insensitive.
159
+ # @param operational_insights_resource_provider [String] The namespace of
160
+ # workspaces resource provider- Microsoft.OperationalInsights.
161
+ # @param workspace_name [String] The name of the workspace.
162
+ # @param rule_id [String] Alert rule ID
163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
164
+ # will be added to the HTTP request.
165
+ #
166
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
167
+ #
168
+ def get_with_http_info(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers:nil)
169
+ get_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers:custom_headers).value!
170
+ end
171
+
172
+ #
173
+ # Gets the alert rule.
174
+ #
175
+ # @param resource_group_name [String] The name of the resource group within the
176
+ # user's subscription. The name is case insensitive.
177
+ # @param operational_insights_resource_provider [String] The namespace of
178
+ # workspaces resource provider- Microsoft.OperationalInsights.
179
+ # @param workspace_name [String] The name of the workspace.
180
+ # @param rule_id [String] Alert rule ID
181
+ # @param [Hash{String => String}] A hash of custom headers that will be added
182
+ # to the HTTP request.
183
+ #
184
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
185
+ #
186
+ def get_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers:nil)
187
+ @client.api_version = '2019-01-01-preview'
188
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
189
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
190
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
191
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
192
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
193
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
194
+ fail ArgumentError, 'operational_insights_resource_provider is nil' if operational_insights_resource_provider.nil?
195
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
196
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
197
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
198
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
199
+
200
+
201
+ request_headers = {}
202
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
203
+
204
+ # Set Headers
205
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
206
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
207
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'
208
+
209
+ request_url = @base_url || @client.base_url
210
+
211
+ options = {
212
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
213
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'operationalInsightsResourceProvider' => operational_insights_resource_provider,'workspaceName' => workspace_name,'ruleId' => rule_id},
214
+ query_params: {'api-version' => @client.api_version},
215
+ headers: request_headers.merge(custom_headers || {}),
216
+ base_url: request_url
217
+ }
218
+ promise = @client.make_request_async(:get, path_template, options)
219
+
220
+ promise = promise.then do |result|
221
+ http_response = result.response
222
+ status_code = http_response.status
223
+ response_content = http_response.body
224
+ unless status_code == 200
225
+ error_model = JSON.load(response_content)
226
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
227
+ end
228
+
229
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
230
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
231
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
232
+ # Deserialize Response
233
+ if status_code == 200
234
+ begin
235
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
236
+ result_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::AlertRule.mapper()
237
+ result.body = @client.deserialize(result_mapper, parsed_response)
238
+ rescue Exception => e
239
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
240
+ end
241
+ end
242
+
243
+ result
244
+ end
245
+
246
+ promise.execute
247
+ end
248
+
249
+ #
250
+ # Creates or updates the alert rule.
251
+ #
252
+ # @param resource_group_name [String] The name of the resource group within the
253
+ # user's subscription. The name is case insensitive.
254
+ # @param operational_insights_resource_provider [String] The namespace of
255
+ # workspaces resource provider- Microsoft.OperationalInsights.
256
+ # @param workspace_name [String] The name of the workspace.
257
+ # @param rule_id [String] Alert rule ID
258
+ # @param alert_rule [AlertRule] The alert rule
259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
260
+ # will be added to the HTTP request.
261
+ #
262
+ # @return [AlertRule] operation results.
263
+ #
264
+ def create_or_update(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, alert_rule, custom_headers:nil)
265
+ response = create_or_update_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, alert_rule, custom_headers:custom_headers).value!
266
+ response.body unless response.nil?
267
+ end
268
+
269
+ #
270
+ # Creates or updates the alert rule.
271
+ #
272
+ # @param resource_group_name [String] The name of the resource group within the
273
+ # user's subscription. The name is case insensitive.
274
+ # @param operational_insights_resource_provider [String] The namespace of
275
+ # workspaces resource provider- Microsoft.OperationalInsights.
276
+ # @param workspace_name [String] The name of the workspace.
277
+ # @param rule_id [String] Alert rule ID
278
+ # @param alert_rule [AlertRule] The alert rule
279
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
280
+ # will be added to the HTTP request.
281
+ #
282
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
283
+ #
284
+ def create_or_update_with_http_info(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, alert_rule, custom_headers:nil)
285
+ create_or_update_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, alert_rule, custom_headers:custom_headers).value!
286
+ end
287
+
288
+ #
289
+ # Creates or updates the alert rule.
290
+ #
291
+ # @param resource_group_name [String] The name of the resource group within the
292
+ # user's subscription. The name is case insensitive.
293
+ # @param operational_insights_resource_provider [String] The namespace of
294
+ # workspaces resource provider- Microsoft.OperationalInsights.
295
+ # @param workspace_name [String] The name of the workspace.
296
+ # @param rule_id [String] Alert rule ID
297
+ # @param alert_rule [AlertRule] The alert rule
298
+ # @param [Hash{String => String}] A hash of custom headers that will be added
299
+ # to the HTTP request.
300
+ #
301
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
302
+ #
303
+ def create_or_update_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, alert_rule, custom_headers:nil)
304
+ @client.api_version = '2019-01-01-preview'
305
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
306
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
307
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
308
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
309
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
310
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
311
+ fail ArgumentError, 'operational_insights_resource_provider is nil' if operational_insights_resource_provider.nil?
312
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
313
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
314
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
315
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
316
+ fail ArgumentError, 'alert_rule is nil' if alert_rule.nil?
317
+
318
+
319
+ request_headers = {}
320
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
321
+
322
+ # Set Headers
323
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
324
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
325
+
326
+ # Serialize Request
327
+ request_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::AlertRule.mapper()
328
+ request_content = @client.serialize(request_mapper, alert_rule)
329
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
330
+
331
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'
332
+
333
+ request_url = @base_url || @client.base_url
334
+
335
+ options = {
336
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
337
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'operationalInsightsResourceProvider' => operational_insights_resource_provider,'workspaceName' => workspace_name,'ruleId' => rule_id},
338
+ query_params: {'api-version' => @client.api_version},
339
+ body: request_content,
340
+ headers: request_headers.merge(custom_headers || {}),
341
+ base_url: request_url
342
+ }
343
+ promise = @client.make_request_async(:put, path_template, options)
344
+
345
+ promise = promise.then do |result|
346
+ http_response = result.response
347
+ status_code = http_response.status
348
+ response_content = http_response.body
349
+ unless status_code == 200 || status_code == 201
350
+ error_model = JSON.load(response_content)
351
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
352
+ end
353
+
354
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
355
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
356
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
357
+ # Deserialize Response
358
+ if status_code == 200
359
+ begin
360
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
361
+ result_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::AlertRule.mapper()
362
+ result.body = @client.deserialize(result_mapper, parsed_response)
363
+ rescue Exception => e
364
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
365
+ end
366
+ end
367
+ # Deserialize Response
368
+ if status_code == 201
369
+ begin
370
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
371
+ result_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::AlertRule.mapper()
372
+ result.body = @client.deserialize(result_mapper, parsed_response)
373
+ rescue Exception => e
374
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
375
+ end
376
+ end
377
+
378
+ result
379
+ end
380
+
381
+ promise.execute
382
+ end
383
+
384
+ #
385
+ # Delete the alert rule.
386
+ #
387
+ # @param resource_group_name [String] The name of the resource group within the
388
+ # user's subscription. The name is case insensitive.
389
+ # @param operational_insights_resource_provider [String] The namespace of
390
+ # workspaces resource provider- Microsoft.OperationalInsights.
391
+ # @param workspace_name [String] The name of the workspace.
392
+ # @param rule_id [String] Alert rule ID
393
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
394
+ # will be added to the HTTP request.
395
+ #
396
+ #
397
+ def delete(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers:nil)
398
+ response = delete_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers:custom_headers).value!
399
+ nil
400
+ end
401
+
402
+ #
403
+ # Delete the alert rule.
404
+ #
405
+ # @param resource_group_name [String] The name of the resource group within the
406
+ # user's subscription. The name is case insensitive.
407
+ # @param operational_insights_resource_provider [String] The namespace of
408
+ # workspaces resource provider- Microsoft.OperationalInsights.
409
+ # @param workspace_name [String] The name of the workspace.
410
+ # @param rule_id [String] Alert rule ID
411
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
412
+ # will be added to the HTTP request.
413
+ #
414
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
415
+ #
416
+ def delete_with_http_info(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers:nil)
417
+ delete_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers:custom_headers).value!
418
+ end
419
+
420
+ #
421
+ # Delete the alert rule.
422
+ #
423
+ # @param resource_group_name [String] The name of the resource group within the
424
+ # user's subscription. The name is case insensitive.
425
+ # @param operational_insights_resource_provider [String] The namespace of
426
+ # workspaces resource provider- Microsoft.OperationalInsights.
427
+ # @param workspace_name [String] The name of the workspace.
428
+ # @param rule_id [String] Alert rule ID
429
+ # @param [Hash{String => String}] A hash of custom headers that will be added
430
+ # to the HTTP request.
431
+ #
432
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
433
+ #
434
+ def delete_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers:nil)
435
+ @client.api_version = '2019-01-01-preview'
436
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
437
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
438
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
439
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
440
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
441
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
442
+ fail ArgumentError, 'operational_insights_resource_provider is nil' if operational_insights_resource_provider.nil?
443
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
444
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
445
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
446
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
447
+
448
+
449
+ request_headers = {}
450
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
451
+
452
+ # Set Headers
453
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
454
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
455
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'
456
+
457
+ request_url = @base_url || @client.base_url
458
+
459
+ options = {
460
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
461
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'operationalInsightsResourceProvider' => operational_insights_resource_provider,'workspaceName' => workspace_name,'ruleId' => rule_id},
462
+ query_params: {'api-version' => @client.api_version},
463
+ headers: request_headers.merge(custom_headers || {}),
464
+ base_url: request_url
465
+ }
466
+ promise = @client.make_request_async(:delete, path_template, options)
467
+
468
+ promise = promise.then do |result|
469
+ http_response = result.response
470
+ status_code = http_response.status
471
+ response_content = http_response.body
472
+ unless status_code == 200 || status_code == 204
473
+ error_model = JSON.load(response_content)
474
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
475
+ end
476
+
477
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
478
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
479
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
480
+
481
+ result
482
+ end
483
+
484
+ promise.execute
485
+ end
486
+
487
+ #
488
+ # Gets the action of alert rule.
489
+ #
490
+ # @param resource_group_name [String] The name of the resource group within the
491
+ # user's subscription. The name is case insensitive.
492
+ # @param operational_insights_resource_provider [String] The namespace of
493
+ # workspaces resource provider- Microsoft.OperationalInsights.
494
+ # @param workspace_name [String] The name of the workspace.
495
+ # @param rule_id [String] Alert rule ID
496
+ # @param action_id [String] Action ID
497
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
498
+ # will be added to the HTTP request.
499
+ #
500
+ # @return [ActionResponse] operation results.
501
+ #
502
+ def get_action(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, custom_headers:nil)
503
+ response = get_action_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, custom_headers:custom_headers).value!
504
+ response.body unless response.nil?
505
+ end
506
+
507
+ #
508
+ # Gets the action of alert rule.
509
+ #
510
+ # @param resource_group_name [String] The name of the resource group within the
511
+ # user's subscription. The name is case insensitive.
512
+ # @param operational_insights_resource_provider [String] The namespace of
513
+ # workspaces resource provider- Microsoft.OperationalInsights.
514
+ # @param workspace_name [String] The name of the workspace.
515
+ # @param rule_id [String] Alert rule ID
516
+ # @param action_id [String] Action ID
517
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
518
+ # will be added to the HTTP request.
519
+ #
520
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
521
+ #
522
+ def get_action_with_http_info(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, custom_headers:nil)
523
+ get_action_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, custom_headers:custom_headers).value!
524
+ end
525
+
526
+ #
527
+ # Gets the action of alert rule.
528
+ #
529
+ # @param resource_group_name [String] The name of the resource group within the
530
+ # user's subscription. The name is case insensitive.
531
+ # @param operational_insights_resource_provider [String] The namespace of
532
+ # workspaces resource provider- Microsoft.OperationalInsights.
533
+ # @param workspace_name [String] The name of the workspace.
534
+ # @param rule_id [String] Alert rule ID
535
+ # @param action_id [String] Action ID
536
+ # @param [Hash{String => String}] A hash of custom headers that will be added
537
+ # to the HTTP request.
538
+ #
539
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
540
+ #
541
+ def get_action_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, custom_headers:nil)
542
+ @client.api_version = '2019-01-01-preview'
543
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
544
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
545
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
546
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
547
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
548
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
549
+ fail ArgumentError, 'operational_insights_resource_provider is nil' if operational_insights_resource_provider.nil?
550
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
551
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
552
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
553
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
554
+ fail ArgumentError, 'action_id is nil' if action_id.nil?
555
+
556
+
557
+ request_headers = {}
558
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
559
+
560
+ # Set Headers
561
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
562
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
563
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}'
564
+
565
+ request_url = @base_url || @client.base_url
566
+
567
+ options = {
568
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
569
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'operationalInsightsResourceProvider' => operational_insights_resource_provider,'workspaceName' => workspace_name,'ruleId' => rule_id,'actionId' => action_id},
570
+ query_params: {'api-version' => @client.api_version},
571
+ headers: request_headers.merge(custom_headers || {}),
572
+ base_url: request_url
573
+ }
574
+ promise = @client.make_request_async(:get, path_template, options)
575
+
576
+ promise = promise.then do |result|
577
+ http_response = result.response
578
+ status_code = http_response.status
579
+ response_content = http_response.body
580
+ unless status_code == 200
581
+ error_model = JSON.load(response_content)
582
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
583
+ end
584
+
585
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
586
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
587
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
588
+ # Deserialize Response
589
+ if status_code == 200
590
+ begin
591
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
592
+ result_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::ActionResponse.mapper()
593
+ result.body = @client.deserialize(result_mapper, parsed_response)
594
+ rescue Exception => e
595
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
596
+ end
597
+ end
598
+
599
+ result
600
+ end
601
+
602
+ promise.execute
603
+ end
604
+
605
+ #
606
+ # Creates or updates the action of alert rule.
607
+ #
608
+ # @param resource_group_name [String] The name of the resource group within the
609
+ # user's subscription. The name is case insensitive.
610
+ # @param operational_insights_resource_provider [String] The namespace of
611
+ # workspaces resource provider- Microsoft.OperationalInsights.
612
+ # @param workspace_name [String] The name of the workspace.
613
+ # @param rule_id [String] Alert rule ID
614
+ # @param action_id [String] Action ID
615
+ # @param action [ActionRequest] The action
616
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
617
+ # will be added to the HTTP request.
618
+ #
619
+ # @return [ActionResponse] operation results.
620
+ #
621
+ def create_or_update_action(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, action, custom_headers:nil)
622
+ response = create_or_update_action_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, action, custom_headers:custom_headers).value!
623
+ response.body unless response.nil?
624
+ end
625
+
626
+ #
627
+ # Creates or updates the action of alert rule.
628
+ #
629
+ # @param resource_group_name [String] The name of the resource group within the
630
+ # user's subscription. The name is case insensitive.
631
+ # @param operational_insights_resource_provider [String] The namespace of
632
+ # workspaces resource provider- Microsoft.OperationalInsights.
633
+ # @param workspace_name [String] The name of the workspace.
634
+ # @param rule_id [String] Alert rule ID
635
+ # @param action_id [String] Action ID
636
+ # @param action [ActionRequest] The action
637
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
638
+ # will be added to the HTTP request.
639
+ #
640
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
641
+ #
642
+ def create_or_update_action_with_http_info(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, action, custom_headers:nil)
643
+ create_or_update_action_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, action, custom_headers:custom_headers).value!
644
+ end
645
+
646
+ #
647
+ # Creates or updates the action of alert rule.
648
+ #
649
+ # @param resource_group_name [String] The name of the resource group within the
650
+ # user's subscription. The name is case insensitive.
651
+ # @param operational_insights_resource_provider [String] The namespace of
652
+ # workspaces resource provider- Microsoft.OperationalInsights.
653
+ # @param workspace_name [String] The name of the workspace.
654
+ # @param rule_id [String] Alert rule ID
655
+ # @param action_id [String] Action ID
656
+ # @param action [ActionRequest] The action
657
+ # @param [Hash{String => String}] A hash of custom headers that will be added
658
+ # to the HTTP request.
659
+ #
660
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
661
+ #
662
+ def create_or_update_action_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, action, custom_headers:nil)
663
+ @client.api_version = '2019-01-01-preview'
664
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
665
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
666
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
667
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
668
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
669
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
670
+ fail ArgumentError, 'operational_insights_resource_provider is nil' if operational_insights_resource_provider.nil?
671
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
672
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
673
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
674
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
675
+ fail ArgumentError, 'action_id is nil' if action_id.nil?
676
+ fail ArgumentError, 'action is nil' if action.nil?
677
+
678
+
679
+ request_headers = {}
680
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
681
+
682
+ # Set Headers
683
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
684
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
685
+
686
+ # Serialize Request
687
+ request_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::ActionRequest.mapper()
688
+ request_content = @client.serialize(request_mapper, action)
689
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
690
+
691
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}'
692
+
693
+ request_url = @base_url || @client.base_url
694
+
695
+ options = {
696
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
697
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'operationalInsightsResourceProvider' => operational_insights_resource_provider,'workspaceName' => workspace_name,'ruleId' => rule_id,'actionId' => action_id},
698
+ query_params: {'api-version' => @client.api_version},
699
+ body: request_content,
700
+ headers: request_headers.merge(custom_headers || {}),
701
+ base_url: request_url
702
+ }
703
+ promise = @client.make_request_async(:put, path_template, options)
704
+
705
+ promise = promise.then do |result|
706
+ http_response = result.response
707
+ status_code = http_response.status
708
+ response_content = http_response.body
709
+ unless status_code == 200 || status_code == 201
710
+ error_model = JSON.load(response_content)
711
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
712
+ end
713
+
714
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
715
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
716
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
717
+ # Deserialize Response
718
+ if status_code == 200
719
+ begin
720
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
721
+ result_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::ActionResponse.mapper()
722
+ result.body = @client.deserialize(result_mapper, parsed_response)
723
+ rescue Exception => e
724
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
725
+ end
726
+ end
727
+ # Deserialize Response
728
+ if status_code == 201
729
+ begin
730
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
731
+ result_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::ActionResponse.mapper()
732
+ result.body = @client.deserialize(result_mapper, parsed_response)
733
+ rescue Exception => e
734
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
735
+ end
736
+ end
737
+
738
+ result
739
+ end
740
+
741
+ promise.execute
742
+ end
743
+
744
+ #
745
+ # Delete the action of alert rule.
746
+ #
747
+ # @param resource_group_name [String] The name of the resource group within the
748
+ # user's subscription. The name is case insensitive.
749
+ # @param operational_insights_resource_provider [String] The namespace of
750
+ # workspaces resource provider- Microsoft.OperationalInsights.
751
+ # @param workspace_name [String] The name of the workspace.
752
+ # @param rule_id [String] Alert rule ID
753
+ # @param action_id [String] Action ID
754
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
755
+ # will be added to the HTTP request.
756
+ #
757
+ #
758
+ def delete_action(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, custom_headers:nil)
759
+ response = delete_action_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, custom_headers:custom_headers).value!
760
+ nil
761
+ end
762
+
763
+ #
764
+ # Delete the action of alert rule.
765
+ #
766
+ # @param resource_group_name [String] The name of the resource group within the
767
+ # user's subscription. The name is case insensitive.
768
+ # @param operational_insights_resource_provider [String] The namespace of
769
+ # workspaces resource provider- Microsoft.OperationalInsights.
770
+ # @param workspace_name [String] The name of the workspace.
771
+ # @param rule_id [String] Alert rule ID
772
+ # @param action_id [String] Action ID
773
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
774
+ # will be added to the HTTP request.
775
+ #
776
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
777
+ #
778
+ def delete_action_with_http_info(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, custom_headers:nil)
779
+ delete_action_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, custom_headers:custom_headers).value!
780
+ end
781
+
782
+ #
783
+ # Delete the action of alert rule.
784
+ #
785
+ # @param resource_group_name [String] The name of the resource group within the
786
+ # user's subscription. The name is case insensitive.
787
+ # @param operational_insights_resource_provider [String] The namespace of
788
+ # workspaces resource provider- Microsoft.OperationalInsights.
789
+ # @param workspace_name [String] The name of the workspace.
790
+ # @param rule_id [String] Alert rule ID
791
+ # @param action_id [String] Action ID
792
+ # @param [Hash{String => String}] A hash of custom headers that will be added
793
+ # to the HTTP request.
794
+ #
795
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
796
+ #
797
+ def delete_action_async(resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, custom_headers:nil)
798
+ @client.api_version = '2019-01-01-preview'
799
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
800
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
801
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
802
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
803
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
804
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
805
+ fail ArgumentError, 'operational_insights_resource_provider is nil' if operational_insights_resource_provider.nil?
806
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
807
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '90'" if !workspace_name.nil? && workspace_name.length > 90
808
+ fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1
809
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
810
+ fail ArgumentError, 'action_id is nil' if action_id.nil?
811
+
812
+
813
+ request_headers = {}
814
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
815
+
816
+ # Set Headers
817
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
818
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
819
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}'
820
+
821
+ request_url = @base_url || @client.base_url
822
+
823
+ options = {
824
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
825
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'operationalInsightsResourceProvider' => operational_insights_resource_provider,'workspaceName' => workspace_name,'ruleId' => rule_id,'actionId' => action_id},
826
+ query_params: {'api-version' => @client.api_version},
827
+ headers: request_headers.merge(custom_headers || {}),
828
+ base_url: request_url
829
+ }
830
+ promise = @client.make_request_async(:delete, path_template, options)
831
+
832
+ promise = promise.then do |result|
833
+ http_response = result.response
834
+ status_code = http_response.status
835
+ response_content = http_response.body
836
+ unless status_code == 200 || status_code == 204
837
+ error_model = JSON.load(response_content)
838
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
839
+ end
840
+
841
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
842
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
843
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
844
+
845
+ result
846
+ end
847
+
848
+ promise.execute
849
+ end
850
+
851
+ #
852
+ # Gets all alert rules.
853
+ #
854
+ # @param next_page_link [String] The NextLink from the previous successful call
855
+ # to List operation.
856
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
857
+ # will be added to the HTTP request.
858
+ #
859
+ # @return [AlertRulesList] operation results.
860
+ #
861
+ def list_next(next_page_link, custom_headers:nil)
862
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
863
+ response.body unless response.nil?
864
+ end
865
+
866
+ #
867
+ # Gets all alert rules.
868
+ #
869
+ # @param next_page_link [String] The NextLink from the previous successful call
870
+ # to List operation.
871
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
872
+ # will be added to the HTTP request.
873
+ #
874
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
875
+ #
876
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
877
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
878
+ end
879
+
880
+ #
881
+ # Gets all alert rules.
882
+ #
883
+ # @param next_page_link [String] The NextLink from the previous successful call
884
+ # to List operation.
885
+ # @param [Hash{String => String}] A hash of custom headers that will be added
886
+ # to the HTTP request.
887
+ #
888
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
889
+ #
890
+ def list_next_async(next_page_link, custom_headers:nil)
891
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
892
+
893
+
894
+ request_headers = {}
895
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
896
+
897
+ # Set Headers
898
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
899
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
900
+ path_template = '{nextLink}'
901
+
902
+ request_url = @base_url || @client.base_url
903
+
904
+ options = {
905
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
906
+ skip_encoding_path_params: {'nextLink' => next_page_link},
907
+ headers: request_headers.merge(custom_headers || {}),
908
+ base_url: request_url
909
+ }
910
+ promise = @client.make_request_async(:get, path_template, options)
911
+
912
+ promise = promise.then do |result|
913
+ http_response = result.response
914
+ status_code = http_response.status
915
+ response_content = http_response.body
916
+ unless status_code == 200
917
+ error_model = JSON.load(response_content)
918
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
919
+ end
920
+
921
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
922
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
923
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
924
+ # Deserialize Response
925
+ if status_code == 200
926
+ begin
927
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
928
+ result_mapper = Azure::SecurityInsights::Mgmt::V2019_01_01_preview::Models::AlertRulesList.mapper()
929
+ result.body = @client.deserialize(result_mapper, parsed_response)
930
+ rescue Exception => e
931
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
932
+ end
933
+ end
934
+
935
+ result
936
+ end
937
+
938
+ promise.execute
939
+ end
940
+
941
+ #
942
+ # Gets all alert rules.
943
+ #
944
+ # @param resource_group_name [String] The name of the resource group within the
945
+ # user's subscription. The name is case insensitive.
946
+ # @param operational_insights_resource_provider [String] The namespace of
947
+ # workspaces resource provider- Microsoft.OperationalInsights.
948
+ # @param workspace_name [String] The name of the workspace.
949
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
950
+ # will be added to the HTTP request.
951
+ #
952
+ # @return [AlertRulesList] which provide lazy access to pages of the response.
953
+ #
954
+ def list_as_lazy(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:nil)
955
+ response = list_async(resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers:custom_headers).value!
956
+ unless response.nil?
957
+ page = response.body
958
+ page.next_method = Proc.new do |next_page_link|
959
+ list_next_async(next_page_link, custom_headers:custom_headers)
960
+ end
961
+ page
962
+ end
963
+ end
964
+
965
+ end
966
+ end