azure_mgmt_synapse 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse.rb +154 -0
  4. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/big_data_pools.rb +842 -0
  5. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/ip_firewall_rules.rb +728 -0
  6. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/auto_pause_properties.rb +61 -0
  7. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/auto_scale_properties.rb +73 -0
  8. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/available_rp_operation.rb +94 -0
  9. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/available_rp_operation_display_info.rb +79 -0
  10. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/azure_entity_resource.rb +75 -0
  11. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/big_data_pool_patch_info.rb +56 -0
  12. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/big_data_pool_resource_info.rb +219 -0
  13. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/big_data_pool_resource_info_list_result.rb +98 -0
  14. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/blob_auditing_policy_state.rb +16 -0
  15. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/check_name_availability_request.rb +59 -0
  16. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/check_name_availability_response.rb +81 -0
  17. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/column_data_type.rb +48 -0
  18. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/create_sql_pool_restore_point_definition.rb +47 -0
  19. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/data_lake_storage_account_details.rb +57 -0
  20. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/data_warehouse_user_activities.rb +74 -0
  21. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/error_additional_info.rb +59 -0
  22. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/error_contract.rb +49 -0
  23. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/error_detail.rb +68 -0
  24. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/error_response.rb +113 -0
  25. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/geo_backup_policy.rb +112 -0
  26. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/geo_backup_policy_state.rb +16 -0
  27. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/ip_firewall_rule_info.rb +100 -0
  28. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/ip_firewall_rule_info_list_result.rb +98 -0
  29. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/ip_firewall_rule_properties.rb +73 -0
  30. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/library_requirements.rb +72 -0
  31. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/managed_identity.rb +72 -0
  32. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/managed_identity_sql_control_settings_model.rb +78 -0
  33. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/managed_identity_sql_control_settings_model_properties_grant_sql_control_to_managed_identity.rb +62 -0
  34. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/management_operation_state.rb +20 -0
  35. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/metadata_sync_config.rb +76 -0
  36. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/node_size.rb +18 -0
  37. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/node_size_family.rb +16 -0
  38. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/operation_meta_log_specification.rb +68 -0
  39. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/operation_meta_metric_dimension_specification.rb +69 -0
  40. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/operation_meta_metric_specification.rb +167 -0
  41. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/operation_meta_service_specification.rb +77 -0
  42. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/operation_resource.rb +125 -0
  43. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/operation_status.rb +18 -0
  44. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/provisioning_state.rb +19 -0
  45. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/proxy_resource.rb +63 -0
  46. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_aggregation_function.rb +18 -0
  47. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_execution_type.rb +19 -0
  48. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_interval.rb +83 -0
  49. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_metric.rb +85 -0
  50. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_metric_unit.rb +17 -0
  51. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_observed_metric_type.rb +19 -0
  52. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/query_statistic.rb +68 -0
  53. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/replace_all_firewall_rules_operation_response.rb +46 -0
  54. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/replace_all_ip_firewall_rules_request.rb +56 -0
  55. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/replication_link.rb +206 -0
  56. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/replication_link_list_result.rb +100 -0
  57. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/replication_role.rb +19 -0
  58. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/replication_state.rb +18 -0
  59. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/resource.rb +83 -0
  60. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/resource_identity_type.rb +16 -0
  61. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/resource_move_definition.rb +46 -0
  62. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/restore_point.rb +125 -0
  63. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/restore_point_list_result.rb +100 -0
  64. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/restore_point_type.rb +16 -0
  65. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/security_alert_policy_state.rb +17 -0
  66. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sensitivity_label.rb +121 -0
  67. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sensitivity_label_list_result.rb +100 -0
  68. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sku.rb +59 -0
  69. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool.rb +199 -0
  70. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_blob_auditing_policy.rb +269 -0
  71. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_blob_auditing_policy_sql_pool_operation_list_result.rb +102 -0
  72. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_column.rb +79 -0
  73. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_column_list_result.rb +100 -0
  74. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_connection_policy.rb +163 -0
  75. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_info_list_result.rb +98 -0
  76. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_operation.rb +233 -0
  77. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_patch_info.rb +178 -0
  78. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_schema.rb +62 -0
  79. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_schema_list_result.rb +100 -0
  80. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_security_alert_policy.rb +179 -0
  81. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_table.rb +62 -0
  82. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_table_list_result.rb +100 -0
  83. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_usage.rb +120 -0
  84. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_usage_list_result.rb +99 -0
  85. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_vulnerability_assessment.rb +115 -0
  86. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_vulnerability_assessment_list_result.rb +101 -0
  87. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_vulnerability_assessment_rule_baseline.rb +84 -0
  88. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_vulnerability_assessment_rule_baseline_item.rb +56 -0
  89. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/sql_pool_vulnerability_assessment_scans_export.rb +76 -0
  90. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/top_queries.rb +152 -0
  91. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/top_queries_list_result.rb +55 -0
  92. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/tracked_resource.rb +92 -0
  93. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/transparent_data_encryption.rb +88 -0
  94. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/transparent_data_encryption_status.rb +16 -0
  95. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/virtual_network_profile.rb +46 -0
  96. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_policy_baseline_name.rb +16 -0
  97. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_recurring_scans_properties.rb +80 -0
  98. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_scan_error.rb +59 -0
  99. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_scan_record.rb +169 -0
  100. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_scan_record_list_result.rb +102 -0
  101. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_scan_state.rb +18 -0
  102. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/vulnerability_assessment_scan_trigger_type.rb +16 -0
  103. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workspace.rb +188 -0
  104. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workspace_aad_admin_info.rb +108 -0
  105. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workspace_info_list_result.rb +98 -0
  106. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/models/workspace_patch_info.rb +89 -0
  107. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/module_definition.rb +9 -0
  108. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb +457 -0
  109. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_blob_auditing_policies.rb +275 -0
  110. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_connection_policies.rb +138 -0
  111. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_data_warehouse_user_activities.rb +141 -0
  112. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_geo_backup_policies.rb +138 -0
  113. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_metadata_sync_configs.rb +263 -0
  114. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_operation_results.rb +131 -0
  115. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_operations.rb +260 -0
  116. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_replication_links.rb +259 -0
  117. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_restore_points.rb +439 -0
  118. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_schemas.rb +267 -0
  119. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_security_alert_policies.rb +275 -0
  120. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_sensitivity_labels.rb +992 -0
  121. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_table_columns.rb +277 -0
  122. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_tables.rb +272 -0
  123. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_transparent_data_encryptions.rb +275 -0
  124. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_usages.rb +259 -0
  125. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_vulnerability_assessment_rule_baselines.rb +276 -0
  126. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_vulnerability_assessment_scans.rb +536 -0
  127. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pool_vulnerability_assessments.rb +608 -0
  128. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/sql_pools.rb +1248 -0
  129. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/synapse_management_client.rb +237 -0
  130. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_aad_admins.rb +432 -0
  131. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspace_managed_identity_sql_control_settings.rb +246 -0
  132. data/lib/2019-06-01-preview/generated/azure_mgmt_synapse/workspaces.rb +1026 -0
  133. data/lib/azure_mgmt_synapse.rb +6 -0
  134. data/lib/module_definition.rb +7 -0
  135. data/lib/profiles/latest/modules/synapse_profile_module.rb +515 -0
  136. data/lib/profiles/latest/synapse_latest_profile_client.rb +40 -0
  137. data/lib/profiles/latest/synapse_module_definition.rb +8 -0
  138. data/lib/version.rb +7 -0
  139. metadata +254 -0
@@ -0,0 +1,276 @@
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::Synapse::Mgmt::V2019_06_01_preview
7
+ #
8
+ # Azure Synapse Analytics Management Client
9
+ #
10
+ class SqlPoolVulnerabilityAssessmentRuleBaselines
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the SqlPoolVulnerabilityAssessmentRuleBaselines class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [SynapseManagementClient] reference to the SynapseManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Creates or updates a Sql pool's vulnerability assessment rule baseline.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group. The name
28
+ # is case insensitive.
29
+ # @param workspace_name [String] The name of the workspace
30
+ # @param sql_pool_name [String] SQL pool name
31
+ # @param rule_id [String] The vulnerability assessment rule ID.
32
+ # @param baseline_name [VulnerabilityAssessmentPolicyBaselineName] The name of
33
+ # the vulnerability assessment rule baseline (default implies a baseline on a
34
+ # Sql pool level rule and master for workspace level rule). Possible values
35
+ # include: 'master', 'default'
36
+ # @param parameters [SqlPoolVulnerabilityAssessmentRuleBaseline] The requested
37
+ # rule baseline resource.
38
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
39
+ # will be added to the HTTP request.
40
+ #
41
+ # @return [SqlPoolVulnerabilityAssessmentRuleBaseline] operation results.
42
+ #
43
+ def create_or_update(resource_group_name, workspace_name, sql_pool_name, rule_id, baseline_name, parameters, custom_headers:nil)
44
+ response = create_or_update_async(resource_group_name, workspace_name, sql_pool_name, rule_id, baseline_name, parameters, custom_headers:custom_headers).value!
45
+ response.body unless response.nil?
46
+ end
47
+
48
+ #
49
+ # Creates or updates a Sql pool's vulnerability assessment rule baseline.
50
+ #
51
+ # @param resource_group_name [String] The name of the resource group. The name
52
+ # is case insensitive.
53
+ # @param workspace_name [String] The name of the workspace
54
+ # @param sql_pool_name [String] SQL pool name
55
+ # @param rule_id [String] The vulnerability assessment rule ID.
56
+ # @param baseline_name [VulnerabilityAssessmentPolicyBaselineName] The name of
57
+ # the vulnerability assessment rule baseline (default implies a baseline on a
58
+ # Sql pool level rule and master for workspace level rule). Possible values
59
+ # include: 'master', 'default'
60
+ # @param parameters [SqlPoolVulnerabilityAssessmentRuleBaseline] The requested
61
+ # rule baseline resource.
62
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
63
+ # will be added to the HTTP request.
64
+ #
65
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
66
+ #
67
+ def create_or_update_with_http_info(resource_group_name, workspace_name, sql_pool_name, rule_id, baseline_name, parameters, custom_headers:nil)
68
+ create_or_update_async(resource_group_name, workspace_name, sql_pool_name, rule_id, baseline_name, parameters, custom_headers:custom_headers).value!
69
+ end
70
+
71
+ #
72
+ # Creates or updates a Sql pool's vulnerability assessment rule baseline.
73
+ #
74
+ # @param resource_group_name [String] The name of the resource group. The name
75
+ # is case insensitive.
76
+ # @param workspace_name [String] The name of the workspace
77
+ # @param sql_pool_name [String] SQL pool name
78
+ # @param rule_id [String] The vulnerability assessment rule ID.
79
+ # @param baseline_name [VulnerabilityAssessmentPolicyBaselineName] The name of
80
+ # the vulnerability assessment rule baseline (default implies a baseline on a
81
+ # Sql pool level rule and master for workspace level rule). Possible values
82
+ # include: 'master', 'default'
83
+ # @param parameters [SqlPoolVulnerabilityAssessmentRuleBaseline] The requested
84
+ # rule baseline resource.
85
+ # @param [Hash{String => String}] A hash of custom headers that will be added
86
+ # to the HTTP request.
87
+ #
88
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
89
+ #
90
+ def create_or_update_async(resource_group_name, workspace_name, sql_pool_name, rule_id, baseline_name, parameters, custom_headers:nil)
91
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
92
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
93
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
94
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
95
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
96
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
97
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
98
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
99
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
100
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
101
+ vulnerability_assessment_name = 'default'
102
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
103
+ fail ArgumentError, 'baseline_name is nil' if baseline_name.nil?
104
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
105
+
106
+
107
+ request_headers = {}
108
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
109
+
110
+ # Set Headers
111
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
112
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
113
+
114
+ # Serialize Request
115
+ request_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SqlPoolVulnerabilityAssessmentRuleBaseline.mapper()
116
+ request_content = @client.serialize(request_mapper, parameters)
117
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
118
+
119
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}'
120
+
121
+ request_url = @base_url || @client.base_url
122
+
123
+ options = {
124
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
125
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'vulnerabilityAssessmentName' => vulnerability_assessment_name,'ruleId' => rule_id,'baselineName' => baseline_name},
126
+ query_params: {'api-version' => @client.api_version},
127
+ body: request_content,
128
+ headers: request_headers.merge(custom_headers || {}),
129
+ base_url: request_url
130
+ }
131
+ promise = @client.make_request_async(:put, path_template, options)
132
+
133
+ promise = promise.then do |result|
134
+ http_response = result.response
135
+ status_code = http_response.status
136
+ response_content = http_response.body
137
+ unless status_code == 200
138
+ error_model = JSON.load(response_content)
139
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
140
+ end
141
+
142
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
143
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
144
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
145
+ # Deserialize Response
146
+ if status_code == 200
147
+ begin
148
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
149
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SqlPoolVulnerabilityAssessmentRuleBaseline.mapper()
150
+ result.body = @client.deserialize(result_mapper, parsed_response)
151
+ rescue Exception => e
152
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
153
+ end
154
+ end
155
+
156
+ result
157
+ end
158
+
159
+ promise.execute
160
+ end
161
+
162
+ #
163
+ # Removes the database's vulnerability assessment rule baseline.
164
+ #
165
+ # @param resource_group_name [String] The name of the resource group. The name
166
+ # is case insensitive.
167
+ # @param workspace_name [String] The name of the workspace
168
+ # @param sql_pool_name [String] SQL pool name
169
+ # @param rule_id [String] The vulnerability assessment rule ID.
170
+ # @param baseline_name [VulnerabilityAssessmentPolicyBaselineName] The name of
171
+ # the vulnerability assessment rule baseline (default implies a baseline on a
172
+ # Sql pool level rule and master for workspace level rule). Possible values
173
+ # include: 'master', 'default'
174
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
175
+ # will be added to the HTTP request.
176
+ #
177
+ #
178
+ def delete(resource_group_name, workspace_name, sql_pool_name, rule_id, baseline_name, custom_headers:nil)
179
+ response = delete_async(resource_group_name, workspace_name, sql_pool_name, rule_id, baseline_name, custom_headers:custom_headers).value!
180
+ nil
181
+ end
182
+
183
+ #
184
+ # Removes the database's vulnerability assessment rule baseline.
185
+ #
186
+ # @param resource_group_name [String] The name of the resource group. The name
187
+ # is case insensitive.
188
+ # @param workspace_name [String] The name of the workspace
189
+ # @param sql_pool_name [String] SQL pool name
190
+ # @param rule_id [String] The vulnerability assessment rule ID.
191
+ # @param baseline_name [VulnerabilityAssessmentPolicyBaselineName] The name of
192
+ # the vulnerability assessment rule baseline (default implies a baseline on a
193
+ # Sql pool level rule and master for workspace level rule). Possible values
194
+ # include: 'master', 'default'
195
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
196
+ # will be added to the HTTP request.
197
+ #
198
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
199
+ #
200
+ def delete_with_http_info(resource_group_name, workspace_name, sql_pool_name, rule_id, baseline_name, custom_headers:nil)
201
+ delete_async(resource_group_name, workspace_name, sql_pool_name, rule_id, baseline_name, custom_headers:custom_headers).value!
202
+ end
203
+
204
+ #
205
+ # Removes the database's vulnerability assessment rule baseline.
206
+ #
207
+ # @param resource_group_name [String] The name of the resource group. The name
208
+ # is case insensitive.
209
+ # @param workspace_name [String] The name of the workspace
210
+ # @param sql_pool_name [String] SQL pool name
211
+ # @param rule_id [String] The vulnerability assessment rule ID.
212
+ # @param baseline_name [VulnerabilityAssessmentPolicyBaselineName] The name of
213
+ # the vulnerability assessment rule baseline (default implies a baseline on a
214
+ # Sql pool level rule and master for workspace level rule). Possible values
215
+ # include: 'master', 'default'
216
+ # @param [Hash{String => String}] A hash of custom headers that will be added
217
+ # to the HTTP request.
218
+ #
219
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
220
+ #
221
+ def delete_async(resource_group_name, workspace_name, sql_pool_name, rule_id, baseline_name, custom_headers:nil)
222
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
223
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
224
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
225
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
226
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
227
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
228
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
229
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
230
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
231
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
232
+ vulnerability_assessment_name = 'default'
233
+ fail ArgumentError, 'rule_id is nil' if rule_id.nil?
234
+ fail ArgumentError, 'baseline_name is nil' if baseline_name.nil?
235
+
236
+
237
+ request_headers = {}
238
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
239
+
240
+ # Set Headers
241
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
242
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
243
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}'
244
+
245
+ request_url = @base_url || @client.base_url
246
+
247
+ options = {
248
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
249
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'vulnerabilityAssessmentName' => vulnerability_assessment_name,'ruleId' => rule_id,'baselineName' => baseline_name},
250
+ query_params: {'api-version' => @client.api_version},
251
+ headers: request_headers.merge(custom_headers || {}),
252
+ base_url: request_url
253
+ }
254
+ promise = @client.make_request_async(:delete, path_template, options)
255
+
256
+ promise = promise.then do |result|
257
+ http_response = result.response
258
+ status_code = http_response.status
259
+ response_content = http_response.body
260
+ unless status_code == 200
261
+ error_model = JSON.load(response_content)
262
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
263
+ end
264
+
265
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
266
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
267
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
268
+
269
+ result
270
+ end
271
+
272
+ promise.execute
273
+ end
274
+
275
+ end
276
+ end
@@ -0,0 +1,536 @@
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::Synapse::Mgmt::V2019_06_01_preview
7
+ #
8
+ # Azure Synapse Analytics Management Client
9
+ #
10
+ class SqlPoolVulnerabilityAssessmentScans
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the SqlPoolVulnerabilityAssessmentScans class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [SynapseManagementClient] reference to the SynapseManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists the vulnerability assessment scans of a SQL pool
26
+ #
27
+ # Lists the vulnerability assessment scans of a SQL pool.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group. The name
30
+ # is case insensitive.
31
+ # @param workspace_name [String] The name of the workspace
32
+ # @param sql_pool_name [String] SQL pool name
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<VulnerabilityAssessmentScanRecord>] operation results.
37
+ #
38
+ def list(resource_group_name, workspace_name, sql_pool_name, custom_headers:nil)
39
+ first_page = list_as_lazy(resource_group_name, workspace_name, sql_pool_name, custom_headers:custom_headers)
40
+ first_page.get_all_items
41
+ end
42
+
43
+ #
44
+ # Lists the vulnerability assessment scans of a SQL pool
45
+ #
46
+ # Lists the vulnerability assessment scans of a SQL pool.
47
+ #
48
+ # @param resource_group_name [String] The name of the resource group. The name
49
+ # is case insensitive.
50
+ # @param workspace_name [String] The name of the workspace
51
+ # @param sql_pool_name [String] SQL pool name
52
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
53
+ # will be added to the HTTP request.
54
+ #
55
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
56
+ #
57
+ def list_with_http_info(resource_group_name, workspace_name, sql_pool_name, custom_headers:nil)
58
+ list_async(resource_group_name, workspace_name, sql_pool_name, custom_headers:custom_headers).value!
59
+ end
60
+
61
+ #
62
+ # Lists the vulnerability assessment scans of a SQL pool
63
+ #
64
+ # Lists the vulnerability assessment scans of a SQL pool.
65
+ #
66
+ # @param resource_group_name [String] The name of the resource group. The name
67
+ # is case insensitive.
68
+ # @param workspace_name [String] The name of the workspace
69
+ # @param sql_pool_name [String] SQL pool name
70
+ # @param [Hash{String => String}] A hash of custom headers that will be added
71
+ # to the HTTP request.
72
+ #
73
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
74
+ #
75
+ def list_async(resource_group_name, workspace_name, sql_pool_name, custom_headers:nil)
76
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
77
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
78
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
79
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
80
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
81
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
82
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
83
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
84
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
85
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
86
+ vulnerability_assessment_name = 'default'
87
+
88
+
89
+ request_headers = {}
90
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
91
+
92
+ # Set Headers
93
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
94
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
95
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans'
96
+
97
+ request_url = @base_url || @client.base_url
98
+
99
+ options = {
100
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
101
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'vulnerabilityAssessmentName' => vulnerability_assessment_name},
102
+ query_params: {'api-version' => @client.api_version},
103
+ headers: request_headers.merge(custom_headers || {}),
104
+ base_url: request_url
105
+ }
106
+ promise = @client.make_request_async(:get, path_template, options)
107
+
108
+ promise = promise.then do |result|
109
+ http_response = result.response
110
+ status_code = http_response.status
111
+ response_content = http_response.body
112
+ unless status_code == 200
113
+ error_model = JSON.load(response_content)
114
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
115
+ end
116
+
117
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
118
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
119
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
120
+ # Deserialize Response
121
+ if status_code == 200
122
+ begin
123
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
124
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::VulnerabilityAssessmentScanRecordListResult.mapper()
125
+ result.body = @client.deserialize(result_mapper, parsed_response)
126
+ rescue Exception => e
127
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
128
+ end
129
+ end
130
+
131
+ result
132
+ end
133
+
134
+ promise.execute
135
+ end
136
+
137
+ #
138
+ # Executes a Vulnerability Assessment database scan.
139
+ #
140
+ # @param resource_group_name [String] The name of the resource group. The name
141
+ # is case insensitive.
142
+ # @param workspace_name [String] The name of the workspace
143
+ # @param sql_pool_name [String] SQL pool name
144
+ # @param scan_id [String] The vulnerability assessment scan Id of the scan to
145
+ # retrieve.
146
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
+ # will be added to the HTTP request.
148
+ #
149
+ def initiate_scan(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:nil)
150
+ response = initiate_scan_async(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:custom_headers).value!
151
+ nil
152
+ end
153
+
154
+ #
155
+ # @param resource_group_name [String] The name of the resource group. The name
156
+ # is case insensitive.
157
+ # @param workspace_name [String] The name of the workspace
158
+ # @param sql_pool_name [String] SQL pool name
159
+ # @param scan_id [String] The vulnerability assessment scan Id of the scan to
160
+ # retrieve.
161
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
162
+ # will be added to the HTTP request.
163
+ #
164
+ # @return [Concurrent::Promise] promise which provides async access to http
165
+ # response.
166
+ #
167
+ def initiate_scan_async(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:nil)
168
+ # Send request
169
+ promise = begin_initiate_scan_async(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:custom_headers)
170
+
171
+ promise = promise.then do |response|
172
+ # Defining deserialization method.
173
+ deserialize_method = lambda do |parsed_response|
174
+ end
175
+
176
+ # Waiting for response.
177
+ @client.get_long_running_operation_result(response, deserialize_method)
178
+ end
179
+
180
+ promise
181
+ end
182
+
183
+ #
184
+ # Convert an existing scan result to a human readable format. If already exists
185
+ # nothing happens
186
+ #
187
+ # @param resource_group_name [String] The name of the resource group. The name
188
+ # is case insensitive.
189
+ # @param workspace_name [String] The name of the workspace
190
+ # @param sql_pool_name [String] SQL pool name
191
+ # @param scan_id [String] The vulnerability assessment scan Id of the scan to
192
+ # retrieve.
193
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
194
+ # will be added to the HTTP request.
195
+ #
196
+ # @return [SqlPoolVulnerabilityAssessmentScansExport] operation results.
197
+ #
198
+ def export(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:nil)
199
+ response = export_async(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:custom_headers).value!
200
+ response.body unless response.nil?
201
+ end
202
+
203
+ #
204
+ # Convert an existing scan result to a human readable format. If already exists
205
+ # nothing happens
206
+ #
207
+ # @param resource_group_name [String] The name of the resource group. The name
208
+ # is case insensitive.
209
+ # @param workspace_name [String] The name of the workspace
210
+ # @param sql_pool_name [String] SQL pool name
211
+ # @param scan_id [String] The vulnerability assessment scan Id of the scan to
212
+ # retrieve.
213
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
214
+ # will be added to the HTTP request.
215
+ #
216
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
217
+ #
218
+ def export_with_http_info(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:nil)
219
+ export_async(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:custom_headers).value!
220
+ end
221
+
222
+ #
223
+ # Convert an existing scan result to a human readable format. If already exists
224
+ # nothing happens
225
+ #
226
+ # @param resource_group_name [String] The name of the resource group. The name
227
+ # is case insensitive.
228
+ # @param workspace_name [String] The name of the workspace
229
+ # @param sql_pool_name [String] SQL pool name
230
+ # @param scan_id [String] The vulnerability assessment scan Id of the scan to
231
+ # retrieve.
232
+ # @param [Hash{String => String}] A hash of custom headers that will be added
233
+ # to the HTTP request.
234
+ #
235
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
236
+ #
237
+ def export_async(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:nil)
238
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
239
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
240
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
241
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
242
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
243
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
244
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
245
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
246
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
247
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
248
+ vulnerability_assessment_name = 'default'
249
+ fail ArgumentError, 'scan_id is nil' if scan_id.nil?
250
+
251
+
252
+ request_headers = {}
253
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
254
+
255
+ # Set Headers
256
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
257
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
258
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export'
259
+
260
+ request_url = @base_url || @client.base_url
261
+
262
+ options = {
263
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
264
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'vulnerabilityAssessmentName' => vulnerability_assessment_name,'scanId' => scan_id},
265
+ query_params: {'api-version' => @client.api_version},
266
+ headers: request_headers.merge(custom_headers || {}),
267
+ base_url: request_url
268
+ }
269
+ promise = @client.make_request_async(:post, path_template, options)
270
+
271
+ promise = promise.then do |result|
272
+ http_response = result.response
273
+ status_code = http_response.status
274
+ response_content = http_response.body
275
+ unless status_code == 200 || status_code == 201
276
+ error_model = JSON.load(response_content)
277
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
278
+ end
279
+
280
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
281
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
282
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
283
+ # Deserialize Response
284
+ if status_code == 200
285
+ begin
286
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
287
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SqlPoolVulnerabilityAssessmentScansExport.mapper()
288
+ result.body = @client.deserialize(result_mapper, parsed_response)
289
+ rescue Exception => e
290
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
291
+ end
292
+ end
293
+ # Deserialize Response
294
+ if status_code == 201
295
+ begin
296
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
297
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::SqlPoolVulnerabilityAssessmentScansExport.mapper()
298
+ result.body = @client.deserialize(result_mapper, parsed_response)
299
+ rescue Exception => e
300
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
301
+ end
302
+ end
303
+
304
+ result
305
+ end
306
+
307
+ promise.execute
308
+ end
309
+
310
+ #
311
+ # Executes a Vulnerability Assessment database scan.
312
+ #
313
+ # @param resource_group_name [String] The name of the resource group. The name
314
+ # is case insensitive.
315
+ # @param workspace_name [String] The name of the workspace
316
+ # @param sql_pool_name [String] SQL pool name
317
+ # @param scan_id [String] The vulnerability assessment scan Id of the scan to
318
+ # retrieve.
319
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
320
+ # will be added to the HTTP request.
321
+ #
322
+ #
323
+ def begin_initiate_scan(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:nil)
324
+ response = begin_initiate_scan_async(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:custom_headers).value!
325
+ nil
326
+ end
327
+
328
+ #
329
+ # Executes a Vulnerability Assessment database scan.
330
+ #
331
+ # @param resource_group_name [String] The name of the resource group. The name
332
+ # is case insensitive.
333
+ # @param workspace_name [String] The name of the workspace
334
+ # @param sql_pool_name [String] SQL pool name
335
+ # @param scan_id [String] The vulnerability assessment scan Id of the scan to
336
+ # retrieve.
337
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
338
+ # will be added to the HTTP request.
339
+ #
340
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
341
+ #
342
+ def begin_initiate_scan_with_http_info(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:nil)
343
+ begin_initiate_scan_async(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:custom_headers).value!
344
+ end
345
+
346
+ #
347
+ # Executes a Vulnerability Assessment database scan.
348
+ #
349
+ # @param resource_group_name [String] The name of the resource group. The name
350
+ # is case insensitive.
351
+ # @param workspace_name [String] The name of the workspace
352
+ # @param sql_pool_name [String] SQL pool name
353
+ # @param scan_id [String] The vulnerability assessment scan Id of the scan to
354
+ # retrieve.
355
+ # @param [Hash{String => String}] A hash of custom headers that will be added
356
+ # to the HTTP request.
357
+ #
358
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
359
+ #
360
+ def begin_initiate_scan_async(resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers:nil)
361
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
362
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
363
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
364
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
365
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
366
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
367
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
368
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
369
+ fail ArgumentError, 'workspace_name is nil' if workspace_name.nil?
370
+ fail ArgumentError, 'sql_pool_name is nil' if sql_pool_name.nil?
371
+ vulnerability_assessment_name = 'default'
372
+ fail ArgumentError, 'scan_id is nil' if scan_id.nil?
373
+
374
+
375
+ request_headers = {}
376
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
377
+
378
+ # Set Headers
379
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
380
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
381
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan'
382
+
383
+ request_url = @base_url || @client.base_url
384
+
385
+ options = {
386
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
387
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'sqlPoolName' => sql_pool_name,'vulnerabilityAssessmentName' => vulnerability_assessment_name,'scanId' => scan_id},
388
+ query_params: {'api-version' => @client.api_version},
389
+ headers: request_headers.merge(custom_headers || {}),
390
+ base_url: request_url
391
+ }
392
+ promise = @client.make_request_async(:post, path_template, options)
393
+
394
+ promise = promise.then do |result|
395
+ http_response = result.response
396
+ status_code = http_response.status
397
+ response_content = http_response.body
398
+ unless status_code == 200 || status_code == 202
399
+ error_model = JSON.load(response_content)
400
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
401
+ end
402
+
403
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
404
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
405
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
406
+
407
+ result
408
+ end
409
+
410
+ promise.execute
411
+ end
412
+
413
+ #
414
+ # Lists the vulnerability assessment scans of a SQL pool
415
+ #
416
+ # Lists the vulnerability assessment scans of a SQL pool.
417
+ #
418
+ # @param next_page_link [String] The NextLink from the previous successful call
419
+ # to List operation.
420
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
421
+ # will be added to the HTTP request.
422
+ #
423
+ # @return [VulnerabilityAssessmentScanRecordListResult] operation results.
424
+ #
425
+ def list_next(next_page_link, custom_headers:nil)
426
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
427
+ response.body unless response.nil?
428
+ end
429
+
430
+ #
431
+ # Lists the vulnerability assessment scans of a SQL pool
432
+ #
433
+ # Lists the vulnerability assessment scans of a SQL pool.
434
+ #
435
+ # @param next_page_link [String] The NextLink from the previous successful call
436
+ # to List operation.
437
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
438
+ # will be added to the HTTP request.
439
+ #
440
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
441
+ #
442
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
443
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
444
+ end
445
+
446
+ #
447
+ # Lists the vulnerability assessment scans of a SQL pool
448
+ #
449
+ # Lists the vulnerability assessment scans of a SQL pool.
450
+ #
451
+ # @param next_page_link [String] The NextLink from the previous successful call
452
+ # to List operation.
453
+ # @param [Hash{String => String}] A hash of custom headers that will be added
454
+ # to the HTTP request.
455
+ #
456
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
457
+ #
458
+ def list_next_async(next_page_link, custom_headers:nil)
459
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
460
+
461
+
462
+ request_headers = {}
463
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
464
+
465
+ # Set Headers
466
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
467
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
468
+ path_template = '{nextLink}'
469
+
470
+ request_url = @base_url || @client.base_url
471
+
472
+ options = {
473
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
474
+ skip_encoding_path_params: {'nextLink' => next_page_link},
475
+ headers: request_headers.merge(custom_headers || {}),
476
+ base_url: request_url
477
+ }
478
+ promise = @client.make_request_async(:get, path_template, options)
479
+
480
+ promise = promise.then do |result|
481
+ http_response = result.response
482
+ status_code = http_response.status
483
+ response_content = http_response.body
484
+ unless status_code == 200
485
+ error_model = JSON.load(response_content)
486
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
487
+ end
488
+
489
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
490
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
491
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
492
+ # Deserialize Response
493
+ if status_code == 200
494
+ begin
495
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
496
+ result_mapper = Azure::Synapse::Mgmt::V2019_06_01_preview::Models::VulnerabilityAssessmentScanRecordListResult.mapper()
497
+ result.body = @client.deserialize(result_mapper, parsed_response)
498
+ rescue Exception => e
499
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
500
+ end
501
+ end
502
+
503
+ result
504
+ end
505
+
506
+ promise.execute
507
+ end
508
+
509
+ #
510
+ # Lists the vulnerability assessment scans of a SQL pool
511
+ #
512
+ # Lists the vulnerability assessment scans of a SQL pool.
513
+ #
514
+ # @param resource_group_name [String] The name of the resource group. The name
515
+ # is case insensitive.
516
+ # @param workspace_name [String] The name of the workspace
517
+ # @param sql_pool_name [String] SQL pool name
518
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
519
+ # will be added to the HTTP request.
520
+ #
521
+ # @return [VulnerabilityAssessmentScanRecordListResult] which provide lazy
522
+ # access to pages of the response.
523
+ #
524
+ def list_as_lazy(resource_group_name, workspace_name, sql_pool_name, custom_headers:nil)
525
+ response = list_async(resource_group_name, workspace_name, sql_pool_name, custom_headers:custom_headers).value!
526
+ unless response.nil?
527
+ page = response.body
528
+ page.next_method = Proc.new do |next_page_link|
529
+ list_next_async(next_page_link, custom_headers:custom_headers)
530
+ end
531
+ page
532
+ end
533
+ end
534
+
535
+ end
536
+ end