azure_mgmt_sql 0.17.2 → 0.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb +6 -6
- data/lib/2014-04-01/generated/azure_mgmt_sql/models/database.rb +47 -27
- data/lib/2014-04-01/generated/azure_mgmt_sql/models/database_edition.rb +3 -0
- data/lib/2014-04-01/generated/azure_mgmt_sql/models/database_security_alert_policy.rb +1 -1
- data/lib/2014-04-01/generated/azure_mgmt_sql/models/database_update.rb +47 -27
- data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool.rb +2 -1
- data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool_edition.rb +2 -0
- data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool_update.rb +2 -1
- data/lib/2014-04-01/generated/azure_mgmt_sql/models/import_request.rb +16 -2
- data/lib/2014-04-01/generated/azure_mgmt_sql/models/metric_definition.rb +1 -1
- data/lib/2014-04-01/generated/azure_mgmt_sql/models/recommended_elastic_pool.rb +3 -2
- data/lib/2014-04-01/generated/azure_mgmt_sql/recommended_elastic_pools.rb +6 -6
- data/lib/2014-04-01/generated/azure_mgmt_sql/server_table_auditing_policies.rb +6 -6
- data/lib/2014-04-01/generated/azure_mgmt_sql/sql_management_client.rb +1 -1
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql.rb +35 -28
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/managed_instances.rb +317 -107
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/advisor.rb +3 -3
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb +37 -6
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/managed_instance.rb +145 -5
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/managed_instance_license_type.rb +16 -0
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/managed_instance_proxy_override.rb +17 -0
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/managed_instance_update.rb +143 -4
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/managed_server_create_mode.rb +16 -0
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/recommended_action_state_info.rb +2 -2
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/virtual_cluster.rb +130 -0
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/virtual_cluster_list_result.rb +100 -0
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/virtual_cluster_update.rb +98 -0
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +5 -1
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/virtual_clusters.rb +814 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql.rb +41 -26
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_vulnerability_assessments.rb +219 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_executions.rb +4 -4
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/long_term_retention_backups.rb +28 -28
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_backup_short_term_retention_policies.rb +684 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_database_security_alert_policies.rb +483 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_databases.rb +4 -4
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_restorable_dropped_database_backup_short_term_retention_policies.rb +684 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_server_security_alert_policies.rb +500 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/backup_long_term_retention_policy.rb +1 -1
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb +37 -6
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment.rb +19 -4
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment_list_result.rb +102 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/extended_database_blob_auditing_policy.rb +37 -6
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/extended_server_blob_auditing_policy.rb +37 -6
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_schedule.rb +1 -1
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/logical_server_security_alert_policy_list_result.rb +102 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/long_term_retention_backup_list_result.rb +1 -1
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_backup_short_term_retention_policy.rb +74 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_backup_short_term_retention_policy_list_result.rb +104 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_database.rb +32 -5
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_database_create_mode.rb +1 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_database_security_alert_policy.rb +179 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_database_security_alert_policy_list_result.rb +102 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_database_status.rb +1 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_database_update.rb +32 -5
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_server_security_alert_policy.rb +179 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_server_security_alert_policy_list_result.rb +102 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/restorable_dropped_managed_database.rb +135 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/restorable_dropped_managed_database_list_result.rb +102 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/restore_point_list_result.rb +1 -1
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/sensitivity_label.rb +37 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_blob_auditing_policy.rb +37 -6
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_security_alert_policy.rb +16 -3
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/restorable_dropped_managed_databases.rb +340 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/sensitivity_labels.rb +460 -14
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_security_alert_policies.rb +210 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +31 -5
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql.rb +41 -24
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/database_vulnerability_assessment_scans.rb +79 -79
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_database_vulnerability_assessment_rule_baselines.rb +400 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_database_vulnerability_assessment_scans.rb +621 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_database_vulnerability_assessments.rb +575 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_instance_encryption_protectors.rb +500 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_instance_keys.rb +669 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database.rb +42 -2
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_status.rb +2 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_update.rb +26 -1
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment.rb +19 -4
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment_list_result.rb +102 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment_rule_baseline.rb +84 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment_rule_baseline_item.rb +56 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool.rb +11 -1
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/managed_instance_encryption_protector.rb +123 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/managed_instance_encryption_protector_list_result.rb +102 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/managed_instance_key.rb +124 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/managed_instance_key_list_result.rb +100 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/recoverable_managed_database.rb +74 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/recoverable_managed_database_list_result.rb +100 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/server_key_type.rb +16 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/vulnerability_assessment_policy_baseline_name.rb +16 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/recoverable_managed_databases.rb +340 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +29 -1
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql.rb +64 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/database_columns.rb +375 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/database_schemas.rb +357 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/database_security_alert_policies.rb +483 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/database_tables.rb +366 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/instance_pools.rb +999 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/managed_database_columns.rb +375 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/managed_database_schemas.rb +357 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/managed_database_sensitivity_labels.rb +1058 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/managed_database_tables.rb +366 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/managed_instance_vulnerability_assessments.rb +561 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/column_data_type.rb +48 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/database_column.rb +79 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/database_column_list_result.rb +100 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/database_schema.rb +62 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/database_schema_list_result.rb +100 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/database_security_alert_list_result.rb +100 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/database_security_alert_policy.rb +179 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/database_table.rb +62 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/database_table_list_result.rb +100 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/instance_pool.rb +135 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/instance_pool_license_type.rb +16 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/instance_pool_list_result.rb +100 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/instance_pool_update.rb +54 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/managed_instance_vulnerability_assessment.rb +114 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/managed_instance_vulnerability_assessment_list_result.rb +104 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/proxy_resource.rb +62 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/resource.rb +80 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/security_alert_policy_state.rb +17 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/sensitivity_label.rb +121 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/sensitivity_label_list_result.rb +100 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/sensitivity_label_source.rb +16 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/server_vulnerability_assessment.rb +114 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/server_vulnerability_assessment_list_result.rb +101 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/sku.rb +97 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/tracked_resource.rb +92 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/vulnerability_assessment_recurring_scans_properties.rb +80 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/module_definition.rb +9 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/server_vulnerability_assessments.rb +554 -0
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +174 -0
- data/lib/azure_mgmt_sql.rb +1 -0
- data/lib/profiles/latest/modules/sql_profile_module.rb +467 -261
- data/lib/version.rb +1 -1
- metadata +82 -3
|
@@ -0,0 +1,366 @@
|
|
|
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::SQL::Mgmt::V2018_06_01_preview
|
|
7
|
+
#
|
|
8
|
+
# The Azure SQL Database management API provides a RESTful set of web APIs
|
|
9
|
+
# that interact with Azure SQL Database services to manage your databases.
|
|
10
|
+
# The API enables users to create, retrieve, update, and delete databases,
|
|
11
|
+
# servers, and other entities.
|
|
12
|
+
#
|
|
13
|
+
class ManagedDatabaseTables
|
|
14
|
+
include MsRestAzure
|
|
15
|
+
|
|
16
|
+
#
|
|
17
|
+
# Creates and initializes a new instance of the ManagedDatabaseTables class.
|
|
18
|
+
# @param client service class for accessing basic functionality.
|
|
19
|
+
#
|
|
20
|
+
def initialize(client)
|
|
21
|
+
@client = client
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @return [SqlManagementClient] reference to the SqlManagementClient
|
|
25
|
+
attr_reader :client
|
|
26
|
+
|
|
27
|
+
#
|
|
28
|
+
# List managed database tables
|
|
29
|
+
#
|
|
30
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
31
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
32
|
+
# Manager API or the portal.
|
|
33
|
+
# @param managed_instance_name [String] The name of the managed instance.
|
|
34
|
+
# @param database_name [String] The name of the database.
|
|
35
|
+
# @param schema_name [String] The name of the schema.
|
|
36
|
+
# @param filter [String] An OData filter expression that filters elements in
|
|
37
|
+
# the collection.
|
|
38
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
39
|
+
# will be added to the HTTP request.
|
|
40
|
+
#
|
|
41
|
+
# @return [Array<DatabaseTable>] operation results.
|
|
42
|
+
#
|
|
43
|
+
def list_by_schema(resource_group_name, managed_instance_name, database_name, schema_name, filter:nil, custom_headers:nil)
|
|
44
|
+
first_page = list_by_schema_as_lazy(resource_group_name, managed_instance_name, database_name, schema_name, filter:filter, custom_headers:custom_headers)
|
|
45
|
+
first_page.get_all_items
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
#
|
|
49
|
+
# List managed database tables
|
|
50
|
+
#
|
|
51
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
52
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
53
|
+
# Manager API or the portal.
|
|
54
|
+
# @param managed_instance_name [String] The name of the managed instance.
|
|
55
|
+
# @param database_name [String] The name of the database.
|
|
56
|
+
# @param schema_name [String] The name of the schema.
|
|
57
|
+
# @param filter [String] An OData filter expression that filters elements in
|
|
58
|
+
# the collection.
|
|
59
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
60
|
+
# will be added to the HTTP request.
|
|
61
|
+
#
|
|
62
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
63
|
+
#
|
|
64
|
+
def list_by_schema_with_http_info(resource_group_name, managed_instance_name, database_name, schema_name, filter:nil, custom_headers:nil)
|
|
65
|
+
list_by_schema_async(resource_group_name, managed_instance_name, database_name, schema_name, filter:filter, custom_headers:custom_headers).value!
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
#
|
|
69
|
+
# List managed database tables
|
|
70
|
+
#
|
|
71
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
72
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
73
|
+
# Manager API or the portal.
|
|
74
|
+
# @param managed_instance_name [String] The name of the managed instance.
|
|
75
|
+
# @param database_name [String] The name of the database.
|
|
76
|
+
# @param schema_name [String] The name of the schema.
|
|
77
|
+
# @param filter [String] An OData filter expression that filters elements in
|
|
78
|
+
# the collection.
|
|
79
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
80
|
+
# to the HTTP request.
|
|
81
|
+
#
|
|
82
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
83
|
+
#
|
|
84
|
+
def list_by_schema_async(resource_group_name, managed_instance_name, database_name, schema_name, filter:nil, custom_headers:nil)
|
|
85
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
86
|
+
fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
|
|
87
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
|
88
|
+
fail ArgumentError, 'schema_name is nil' if schema_name.nil?
|
|
89
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
90
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
request_headers = {}
|
|
94
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
95
|
+
|
|
96
|
+
# Set Headers
|
|
97
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
98
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
99
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables'
|
|
100
|
+
|
|
101
|
+
request_url = @base_url || @client.base_url
|
|
102
|
+
|
|
103
|
+
options = {
|
|
104
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
105
|
+
path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'databaseName' => database_name,'schemaName' => schema_name,'subscriptionId' => @client.subscription_id},
|
|
106
|
+
query_params: {'$filter' => filter,'api-version' => @client.api_version},
|
|
107
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
108
|
+
base_url: request_url
|
|
109
|
+
}
|
|
110
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
111
|
+
|
|
112
|
+
promise = promise.then do |result|
|
|
113
|
+
http_response = result.response
|
|
114
|
+
status_code = http_response.status
|
|
115
|
+
response_content = http_response.body
|
|
116
|
+
unless status_code == 200
|
|
117
|
+
error_model = JSON.load(response_content)
|
|
118
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
122
|
+
# Deserialize Response
|
|
123
|
+
if status_code == 200
|
|
124
|
+
begin
|
|
125
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
126
|
+
result_mapper = Azure::SQL::Mgmt::V2018_06_01_preview::Models::DatabaseTableListResult.mapper()
|
|
127
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
128
|
+
rescue Exception => e
|
|
129
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
result
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
promise.execute
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
#
|
|
140
|
+
# Get managed database table
|
|
141
|
+
#
|
|
142
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
143
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
144
|
+
# Manager API or the portal.
|
|
145
|
+
# @param managed_instance_name [String] The name of the managed instance.
|
|
146
|
+
# @param database_name [String] The name of the database.
|
|
147
|
+
# @param schema_name [String] The name of the schema.
|
|
148
|
+
# @param table_name [String] The name of the table.
|
|
149
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
150
|
+
# will be added to the HTTP request.
|
|
151
|
+
#
|
|
152
|
+
# @return [DatabaseTable] operation results.
|
|
153
|
+
#
|
|
154
|
+
def get(resource_group_name, managed_instance_name, database_name, schema_name, table_name, custom_headers:nil)
|
|
155
|
+
response = get_async(resource_group_name, managed_instance_name, database_name, schema_name, table_name, custom_headers:custom_headers).value!
|
|
156
|
+
response.body unless response.nil?
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
#
|
|
160
|
+
# Get managed database table
|
|
161
|
+
#
|
|
162
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
163
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
164
|
+
# Manager API or the portal.
|
|
165
|
+
# @param managed_instance_name [String] The name of the managed instance.
|
|
166
|
+
# @param database_name [String] The name of the database.
|
|
167
|
+
# @param schema_name [String] The name of the schema.
|
|
168
|
+
# @param table_name [String] The name of the table.
|
|
169
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
170
|
+
# will be added to the HTTP request.
|
|
171
|
+
#
|
|
172
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
173
|
+
#
|
|
174
|
+
def get_with_http_info(resource_group_name, managed_instance_name, database_name, schema_name, table_name, custom_headers:nil)
|
|
175
|
+
get_async(resource_group_name, managed_instance_name, database_name, schema_name, table_name, custom_headers:custom_headers).value!
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
#
|
|
179
|
+
# Get managed database table
|
|
180
|
+
#
|
|
181
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
182
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
183
|
+
# Manager API or the portal.
|
|
184
|
+
# @param managed_instance_name [String] The name of the managed instance.
|
|
185
|
+
# @param database_name [String] The name of the database.
|
|
186
|
+
# @param schema_name [String] The name of the schema.
|
|
187
|
+
# @param table_name [String] The name of the table.
|
|
188
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
189
|
+
# to the HTTP request.
|
|
190
|
+
#
|
|
191
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
192
|
+
#
|
|
193
|
+
def get_async(resource_group_name, managed_instance_name, database_name, schema_name, table_name, custom_headers:nil)
|
|
194
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
195
|
+
fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
|
|
196
|
+
fail ArgumentError, 'database_name is nil' if database_name.nil?
|
|
197
|
+
fail ArgumentError, 'schema_name is nil' if schema_name.nil?
|
|
198
|
+
fail ArgumentError, 'table_name is nil' if table_name.nil?
|
|
199
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
200
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
request_headers = {}
|
|
204
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
205
|
+
|
|
206
|
+
# Set Headers
|
|
207
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
208
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
209
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}'
|
|
210
|
+
|
|
211
|
+
request_url = @base_url || @client.base_url
|
|
212
|
+
|
|
213
|
+
options = {
|
|
214
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
215
|
+
path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'databaseName' => database_name,'schemaName' => schema_name,'tableName' => table_name,'subscriptionId' => @client.subscription_id},
|
|
216
|
+
query_params: {'api-version' => @client.api_version},
|
|
217
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
218
|
+
base_url: request_url
|
|
219
|
+
}
|
|
220
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
221
|
+
|
|
222
|
+
promise = promise.then do |result|
|
|
223
|
+
http_response = result.response
|
|
224
|
+
status_code = http_response.status
|
|
225
|
+
response_content = http_response.body
|
|
226
|
+
unless status_code == 200
|
|
227
|
+
error_model = JSON.load(response_content)
|
|
228
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-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::SQL::Mgmt::V2018_06_01_preview::Models::DatabaseTable.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
|
+
# List managed database tables
|
|
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 [DatabaseTableListResult] operation results.
|
|
258
|
+
#
|
|
259
|
+
def list_by_schema_next(next_page_link, custom_headers:nil)
|
|
260
|
+
response = list_by_schema_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
261
|
+
response.body unless response.nil?
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
#
|
|
265
|
+
# List managed database tables
|
|
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_by_schema_next_with_http_info(next_page_link, custom_headers:nil)
|
|
275
|
+
list_by_schema_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
#
|
|
279
|
+
# List managed database tables
|
|
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_by_schema_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
|
+
# Deserialize Response
|
|
321
|
+
if status_code == 200
|
|
322
|
+
begin
|
|
323
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
324
|
+
result_mapper = Azure::SQL::Mgmt::V2018_06_01_preview::Models::DatabaseTableListResult.mapper()
|
|
325
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
326
|
+
rescue Exception => e
|
|
327
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
328
|
+
end
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
result
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
promise.execute
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
#
|
|
338
|
+
# List managed database tables
|
|
339
|
+
#
|
|
340
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
341
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
342
|
+
# Manager API or the portal.
|
|
343
|
+
# @param managed_instance_name [String] The name of the managed instance.
|
|
344
|
+
# @param database_name [String] The name of the database.
|
|
345
|
+
# @param schema_name [String] The name of the schema.
|
|
346
|
+
# @param filter [String] An OData filter expression that filters elements in
|
|
347
|
+
# the collection.
|
|
348
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
349
|
+
# will be added to the HTTP request.
|
|
350
|
+
#
|
|
351
|
+
# @return [DatabaseTableListResult] which provide lazy access to pages of the
|
|
352
|
+
# response.
|
|
353
|
+
#
|
|
354
|
+
def list_by_schema_as_lazy(resource_group_name, managed_instance_name, database_name, schema_name, filter:nil, custom_headers:nil)
|
|
355
|
+
response = list_by_schema_async(resource_group_name, managed_instance_name, database_name, schema_name, filter:filter, custom_headers:custom_headers).value!
|
|
356
|
+
unless response.nil?
|
|
357
|
+
page = response.body
|
|
358
|
+
page.next_method = Proc.new do |next_page_link|
|
|
359
|
+
list_by_schema_next_async(next_page_link, custom_headers:custom_headers)
|
|
360
|
+
end
|
|
361
|
+
page
|
|
362
|
+
end
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
end
|
|
366
|
+
end
|
data/lib/2018-06-01-preview/generated/azure_mgmt_sql/managed_instance_vulnerability_assessments.rb
ADDED
|
@@ -0,0 +1,561 @@
|
|
|
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::SQL::Mgmt::V2018_06_01_preview
|
|
7
|
+
#
|
|
8
|
+
# The Azure SQL Database management API provides a RESTful set of web APIs
|
|
9
|
+
# that interact with Azure SQL Database services to manage your databases.
|
|
10
|
+
# The API enables users to create, retrieve, update, and delete databases,
|
|
11
|
+
# servers, and other entities.
|
|
12
|
+
#
|
|
13
|
+
class ManagedInstanceVulnerabilityAssessments
|
|
14
|
+
include MsRestAzure
|
|
15
|
+
|
|
16
|
+
#
|
|
17
|
+
# Creates and initializes a new instance of the ManagedInstanceVulnerabilityAssessments class.
|
|
18
|
+
# @param client service class for accessing basic functionality.
|
|
19
|
+
#
|
|
20
|
+
def initialize(client)
|
|
21
|
+
@client = client
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @return [SqlManagementClient] reference to the SqlManagementClient
|
|
25
|
+
attr_reader :client
|
|
26
|
+
|
|
27
|
+
#
|
|
28
|
+
# Gets the managed instance's vulnerability assessment.
|
|
29
|
+
#
|
|
30
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
31
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
32
|
+
# Manager API or the portal.
|
|
33
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
34
|
+
# which the vulnerability assessment is defined.
|
|
35
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
36
|
+
# will be added to the HTTP request.
|
|
37
|
+
#
|
|
38
|
+
# @return [ManagedInstanceVulnerabilityAssessment] operation results.
|
|
39
|
+
#
|
|
40
|
+
def get(resource_group_name, managed_instance_name, custom_headers:nil)
|
|
41
|
+
response = get_async(resource_group_name, managed_instance_name, custom_headers:custom_headers).value!
|
|
42
|
+
response.body unless response.nil?
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
#
|
|
46
|
+
# Gets the managed instance's vulnerability assessment.
|
|
47
|
+
#
|
|
48
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
49
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
50
|
+
# Manager API or the portal.
|
|
51
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
52
|
+
# which the vulnerability assessment is defined.
|
|
53
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
54
|
+
# will be added to the HTTP request.
|
|
55
|
+
#
|
|
56
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
57
|
+
#
|
|
58
|
+
def get_with_http_info(resource_group_name, managed_instance_name, custom_headers:nil)
|
|
59
|
+
get_async(resource_group_name, managed_instance_name, custom_headers:custom_headers).value!
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
#
|
|
63
|
+
# Gets the managed instance's vulnerability assessment.
|
|
64
|
+
#
|
|
65
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
66
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
67
|
+
# Manager API or the portal.
|
|
68
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
69
|
+
# which the vulnerability assessment is defined.
|
|
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 get_async(resource_group_name, managed_instance_name, custom_headers:nil)
|
|
76
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
77
|
+
fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
|
|
78
|
+
vulnerability_assessment_name = 'default'
|
|
79
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
80
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
request_headers = {}
|
|
84
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
85
|
+
|
|
86
|
+
# Set Headers
|
|
87
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
88
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
89
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}'
|
|
90
|
+
|
|
91
|
+
request_url = @base_url || @client.base_url
|
|
92
|
+
|
|
93
|
+
options = {
|
|
94
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
95
|
+
path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'vulnerabilityAssessmentName' => vulnerability_assessment_name,'subscriptionId' => @client.subscription_id},
|
|
96
|
+
query_params: {'api-version' => @client.api_version},
|
|
97
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
98
|
+
base_url: request_url
|
|
99
|
+
}
|
|
100
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
101
|
+
|
|
102
|
+
promise = promise.then do |result|
|
|
103
|
+
http_response = result.response
|
|
104
|
+
status_code = http_response.status
|
|
105
|
+
response_content = http_response.body
|
|
106
|
+
unless status_code == 200
|
|
107
|
+
error_model = JSON.load(response_content)
|
|
108
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
112
|
+
# Deserialize Response
|
|
113
|
+
if status_code == 200
|
|
114
|
+
begin
|
|
115
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
116
|
+
result_mapper = Azure::SQL::Mgmt::V2018_06_01_preview::Models::ManagedInstanceVulnerabilityAssessment.mapper()
|
|
117
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
118
|
+
rescue Exception => e
|
|
119
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
result
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
promise.execute
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
#
|
|
130
|
+
# Creates or updates the managed instance's vulnerability assessment.
|
|
131
|
+
#
|
|
132
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
133
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
134
|
+
# Manager API or the portal.
|
|
135
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
136
|
+
# which the vulnerability assessment is defined.
|
|
137
|
+
# @param parameters [ManagedInstanceVulnerabilityAssessment] The requested
|
|
138
|
+
# resource.
|
|
139
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
140
|
+
# will be added to the HTTP request.
|
|
141
|
+
#
|
|
142
|
+
# @return [ManagedInstanceVulnerabilityAssessment] operation results.
|
|
143
|
+
#
|
|
144
|
+
def create_or_update(resource_group_name, managed_instance_name, parameters, custom_headers:nil)
|
|
145
|
+
response = create_or_update_async(resource_group_name, managed_instance_name, parameters, custom_headers:custom_headers).value!
|
|
146
|
+
response.body unless response.nil?
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
#
|
|
150
|
+
# Creates or updates the managed instance's vulnerability assessment.
|
|
151
|
+
#
|
|
152
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
153
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
154
|
+
# Manager API or the portal.
|
|
155
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
156
|
+
# which the vulnerability assessment is defined.
|
|
157
|
+
# @param parameters [ManagedInstanceVulnerabilityAssessment] The requested
|
|
158
|
+
# resource.
|
|
159
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
160
|
+
# will be added to the HTTP request.
|
|
161
|
+
#
|
|
162
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
163
|
+
#
|
|
164
|
+
def create_or_update_with_http_info(resource_group_name, managed_instance_name, parameters, custom_headers:nil)
|
|
165
|
+
create_or_update_async(resource_group_name, managed_instance_name, parameters, custom_headers:custom_headers).value!
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
#
|
|
169
|
+
# Creates or updates the managed instance's vulnerability assessment.
|
|
170
|
+
#
|
|
171
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
172
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
173
|
+
# Manager API or the portal.
|
|
174
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
175
|
+
# which the vulnerability assessment is defined.
|
|
176
|
+
# @param parameters [ManagedInstanceVulnerabilityAssessment] The requested
|
|
177
|
+
# resource.
|
|
178
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
179
|
+
# to the HTTP request.
|
|
180
|
+
#
|
|
181
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
182
|
+
#
|
|
183
|
+
def create_or_update_async(resource_group_name, managed_instance_name, parameters, custom_headers:nil)
|
|
184
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
185
|
+
fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
|
|
186
|
+
vulnerability_assessment_name = 'default'
|
|
187
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
188
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
189
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
request_headers = {}
|
|
193
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
194
|
+
|
|
195
|
+
# Set Headers
|
|
196
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
197
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
198
|
+
|
|
199
|
+
# Serialize Request
|
|
200
|
+
request_mapper = Azure::SQL::Mgmt::V2018_06_01_preview::Models::ManagedInstanceVulnerabilityAssessment.mapper()
|
|
201
|
+
request_content = @client.serialize(request_mapper, parameters)
|
|
202
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
203
|
+
|
|
204
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}'
|
|
205
|
+
|
|
206
|
+
request_url = @base_url || @client.base_url
|
|
207
|
+
|
|
208
|
+
options = {
|
|
209
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
210
|
+
path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'vulnerabilityAssessmentName' => vulnerability_assessment_name,'subscriptionId' => @client.subscription_id},
|
|
211
|
+
query_params: {'api-version' => @client.api_version},
|
|
212
|
+
body: request_content,
|
|
213
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
214
|
+
base_url: request_url
|
|
215
|
+
}
|
|
216
|
+
promise = @client.make_request_async(:put, path_template, options)
|
|
217
|
+
|
|
218
|
+
promise = promise.then do |result|
|
|
219
|
+
http_response = result.response
|
|
220
|
+
status_code = http_response.status
|
|
221
|
+
response_content = http_response.body
|
|
222
|
+
unless status_code == 200 || status_code == 201
|
|
223
|
+
error_model = JSON.load(response_content)
|
|
224
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
228
|
+
# Deserialize Response
|
|
229
|
+
if status_code == 200
|
|
230
|
+
begin
|
|
231
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
232
|
+
result_mapper = Azure::SQL::Mgmt::V2018_06_01_preview::Models::ManagedInstanceVulnerabilityAssessment.mapper()
|
|
233
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
234
|
+
rescue Exception => e
|
|
235
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
# Deserialize Response
|
|
239
|
+
if status_code == 201
|
|
240
|
+
begin
|
|
241
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
242
|
+
result_mapper = Azure::SQL::Mgmt::V2018_06_01_preview::Models::ManagedInstanceVulnerabilityAssessment.mapper()
|
|
243
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
244
|
+
rescue Exception => e
|
|
245
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
result
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
promise.execute
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
#
|
|
256
|
+
# Removes the managed instance's vulnerability assessment.
|
|
257
|
+
#
|
|
258
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
259
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
260
|
+
# Manager API or the portal.
|
|
261
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
262
|
+
# which the vulnerability assessment is defined.
|
|
263
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
264
|
+
# will be added to the HTTP request.
|
|
265
|
+
#
|
|
266
|
+
#
|
|
267
|
+
def delete(resource_group_name, managed_instance_name, custom_headers:nil)
|
|
268
|
+
response = delete_async(resource_group_name, managed_instance_name, custom_headers:custom_headers).value!
|
|
269
|
+
nil
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
#
|
|
273
|
+
# Removes the managed instance's vulnerability assessment.
|
|
274
|
+
#
|
|
275
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
276
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
277
|
+
# Manager API or the portal.
|
|
278
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
279
|
+
# which the vulnerability assessment is defined.
|
|
280
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
281
|
+
# will be added to the HTTP request.
|
|
282
|
+
#
|
|
283
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
284
|
+
#
|
|
285
|
+
def delete_with_http_info(resource_group_name, managed_instance_name, custom_headers:nil)
|
|
286
|
+
delete_async(resource_group_name, managed_instance_name, custom_headers:custom_headers).value!
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
#
|
|
290
|
+
# Removes the managed instance's vulnerability assessment.
|
|
291
|
+
#
|
|
292
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
293
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
294
|
+
# Manager API or the portal.
|
|
295
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
296
|
+
# which the vulnerability assessment is defined.
|
|
297
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
298
|
+
# to the HTTP request.
|
|
299
|
+
#
|
|
300
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
301
|
+
#
|
|
302
|
+
def delete_async(resource_group_name, managed_instance_name, custom_headers:nil)
|
|
303
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
304
|
+
fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
|
|
305
|
+
vulnerability_assessment_name = 'default'
|
|
306
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
307
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
request_headers = {}
|
|
311
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
312
|
+
|
|
313
|
+
# Set Headers
|
|
314
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
315
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
316
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}'
|
|
317
|
+
|
|
318
|
+
request_url = @base_url || @client.base_url
|
|
319
|
+
|
|
320
|
+
options = {
|
|
321
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
322
|
+
path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'vulnerabilityAssessmentName' => vulnerability_assessment_name,'subscriptionId' => @client.subscription_id},
|
|
323
|
+
query_params: {'api-version' => @client.api_version},
|
|
324
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
325
|
+
base_url: request_url
|
|
326
|
+
}
|
|
327
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
|
328
|
+
|
|
329
|
+
promise = promise.then do |result|
|
|
330
|
+
http_response = result.response
|
|
331
|
+
status_code = http_response.status
|
|
332
|
+
response_content = http_response.body
|
|
333
|
+
unless status_code == 200
|
|
334
|
+
error_model = JSON.load(response_content)
|
|
335
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
339
|
+
|
|
340
|
+
result
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
promise.execute
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
#
|
|
347
|
+
# Gets the managed instance's vulnerability assessment policies.
|
|
348
|
+
#
|
|
349
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
350
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
351
|
+
# Manager API or the portal.
|
|
352
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
353
|
+
# which the vulnerability assessments is defined.
|
|
354
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
355
|
+
# will be added to the HTTP request.
|
|
356
|
+
#
|
|
357
|
+
# @return [Array<ManagedInstanceVulnerabilityAssessment>] operation results.
|
|
358
|
+
#
|
|
359
|
+
def list_by_instance(resource_group_name, managed_instance_name, custom_headers:nil)
|
|
360
|
+
first_page = list_by_instance_as_lazy(resource_group_name, managed_instance_name, custom_headers:custom_headers)
|
|
361
|
+
first_page.get_all_items
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
#
|
|
365
|
+
# Gets the managed instance's vulnerability assessment policies.
|
|
366
|
+
#
|
|
367
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
368
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
369
|
+
# Manager API or the portal.
|
|
370
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
371
|
+
# which the vulnerability assessments is defined.
|
|
372
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
373
|
+
# will be added to the HTTP request.
|
|
374
|
+
#
|
|
375
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
376
|
+
#
|
|
377
|
+
def list_by_instance_with_http_info(resource_group_name, managed_instance_name, custom_headers:nil)
|
|
378
|
+
list_by_instance_async(resource_group_name, managed_instance_name, custom_headers:custom_headers).value!
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
#
|
|
382
|
+
# Gets the managed instance's vulnerability assessment policies.
|
|
383
|
+
#
|
|
384
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
385
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
386
|
+
# Manager API or the portal.
|
|
387
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
388
|
+
# which the vulnerability assessments is defined.
|
|
389
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
390
|
+
# to the HTTP request.
|
|
391
|
+
#
|
|
392
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
393
|
+
#
|
|
394
|
+
def list_by_instance_async(resource_group_name, managed_instance_name, custom_headers:nil)
|
|
395
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
396
|
+
fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
|
|
397
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
398
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
request_headers = {}
|
|
402
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
403
|
+
|
|
404
|
+
# Set Headers
|
|
405
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
406
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
407
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments'
|
|
408
|
+
|
|
409
|
+
request_url = @base_url || @client.base_url
|
|
410
|
+
|
|
411
|
+
options = {
|
|
412
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
413
|
+
path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'subscriptionId' => @client.subscription_id},
|
|
414
|
+
query_params: {'api-version' => @client.api_version},
|
|
415
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
416
|
+
base_url: request_url
|
|
417
|
+
}
|
|
418
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
419
|
+
|
|
420
|
+
promise = promise.then do |result|
|
|
421
|
+
http_response = result.response
|
|
422
|
+
status_code = http_response.status
|
|
423
|
+
response_content = http_response.body
|
|
424
|
+
unless status_code == 200
|
|
425
|
+
error_model = JSON.load(response_content)
|
|
426
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
430
|
+
# Deserialize Response
|
|
431
|
+
if status_code == 200
|
|
432
|
+
begin
|
|
433
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
434
|
+
result_mapper = Azure::SQL::Mgmt::V2018_06_01_preview::Models::ManagedInstanceVulnerabilityAssessmentListResult.mapper()
|
|
435
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
436
|
+
rescue Exception => e
|
|
437
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
438
|
+
end
|
|
439
|
+
end
|
|
440
|
+
|
|
441
|
+
result
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
promise.execute
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
#
|
|
448
|
+
# Gets the managed instance's vulnerability assessment policies.
|
|
449
|
+
#
|
|
450
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
451
|
+
# to List operation.
|
|
452
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
453
|
+
# will be added to the HTTP request.
|
|
454
|
+
#
|
|
455
|
+
# @return [ManagedInstanceVulnerabilityAssessmentListResult] operation results.
|
|
456
|
+
#
|
|
457
|
+
def list_by_instance_next(next_page_link, custom_headers:nil)
|
|
458
|
+
response = list_by_instance_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
459
|
+
response.body unless response.nil?
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
#
|
|
463
|
+
# Gets the managed instance's vulnerability assessment policies.
|
|
464
|
+
#
|
|
465
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
466
|
+
# to List operation.
|
|
467
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
468
|
+
# will be added to the HTTP request.
|
|
469
|
+
#
|
|
470
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
471
|
+
#
|
|
472
|
+
def list_by_instance_next_with_http_info(next_page_link, custom_headers:nil)
|
|
473
|
+
list_by_instance_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
474
|
+
end
|
|
475
|
+
|
|
476
|
+
#
|
|
477
|
+
# Gets the managed instance's vulnerability assessment policies.
|
|
478
|
+
#
|
|
479
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
480
|
+
# to List operation.
|
|
481
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
482
|
+
# to the HTTP request.
|
|
483
|
+
#
|
|
484
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
485
|
+
#
|
|
486
|
+
def list_by_instance_next_async(next_page_link, custom_headers:nil)
|
|
487
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
request_headers = {}
|
|
491
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
492
|
+
|
|
493
|
+
# Set Headers
|
|
494
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
495
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
496
|
+
path_template = '{nextLink}'
|
|
497
|
+
|
|
498
|
+
request_url = @base_url || @client.base_url
|
|
499
|
+
|
|
500
|
+
options = {
|
|
501
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
502
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
|
503
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
504
|
+
base_url: request_url
|
|
505
|
+
}
|
|
506
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
507
|
+
|
|
508
|
+
promise = promise.then do |result|
|
|
509
|
+
http_response = result.response
|
|
510
|
+
status_code = http_response.status
|
|
511
|
+
response_content = http_response.body
|
|
512
|
+
unless status_code == 200
|
|
513
|
+
error_model = JSON.load(response_content)
|
|
514
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
515
|
+
end
|
|
516
|
+
|
|
517
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
518
|
+
# Deserialize Response
|
|
519
|
+
if status_code == 200
|
|
520
|
+
begin
|
|
521
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
522
|
+
result_mapper = Azure::SQL::Mgmt::V2018_06_01_preview::Models::ManagedInstanceVulnerabilityAssessmentListResult.mapper()
|
|
523
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
524
|
+
rescue Exception => e
|
|
525
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
526
|
+
end
|
|
527
|
+
end
|
|
528
|
+
|
|
529
|
+
result
|
|
530
|
+
end
|
|
531
|
+
|
|
532
|
+
promise.execute
|
|
533
|
+
end
|
|
534
|
+
|
|
535
|
+
#
|
|
536
|
+
# Gets the managed instance's vulnerability assessment policies.
|
|
537
|
+
#
|
|
538
|
+
# @param resource_group_name [String] The name of the resource group that
|
|
539
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
|
540
|
+
# Manager API or the portal.
|
|
541
|
+
# @param managed_instance_name [String] The name of the managed instance for
|
|
542
|
+
# which the vulnerability assessments is defined.
|
|
543
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
544
|
+
# will be added to the HTTP request.
|
|
545
|
+
#
|
|
546
|
+
# @return [ManagedInstanceVulnerabilityAssessmentListResult] which provide lazy
|
|
547
|
+
# access to pages of the response.
|
|
548
|
+
#
|
|
549
|
+
def list_by_instance_as_lazy(resource_group_name, managed_instance_name, custom_headers:nil)
|
|
550
|
+
response = list_by_instance_async(resource_group_name, managed_instance_name, custom_headers:custom_headers).value!
|
|
551
|
+
unless response.nil?
|
|
552
|
+
page = response.body
|
|
553
|
+
page.next_method = Proc.new do |next_page_link|
|
|
554
|
+
list_by_instance_next_async(next_page_link, custom_headers:custom_headers)
|
|
555
|
+
end
|
|
556
|
+
page
|
|
557
|
+
end
|
|
558
|
+
end
|
|
559
|
+
|
|
560
|
+
end
|
|
561
|
+
end
|