From c2cae80b7e9c9d74398636cb725a30e4195ac980 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sun, 4 Nov 2018 13:12:53 +0000 Subject: [PATCH 1/2] Generated from 63e4176e8577c1abaf1a1496628dc432c7fa5479 Update Vulnerability Assessment swaggers Update Vulnerability Assessment swaggers --- ...lnerability_assessment_scans_operations.py | 154 +++++++++--------- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessment_scans_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessment_scans_operations.py index 624bf67fca16..97725d782e9e 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessment_scans_operations.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessment_scans_operations.py @@ -41,6 +41,83 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list_by_database( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Lists the vulnerability assessment scans of a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + VulnerabilityAssessmentScanRecord + :rtype: + ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecordPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.VulnerabilityAssessmentScanRecordPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VulnerabilityAssessmentScanRecordPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans'} + def get( self, resource_group_name, server_name, database_name, scan_id, custom_headers=None, raw=False, **operation_config): """Gets a vulnerability assessment scan record of a database. @@ -205,83 +282,6 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) initiate_scan.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan'} - def list_by_database( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Lists the vulnerability assessment scans of a database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of - VulnerabilityAssessmentScanRecord - :rtype: - ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecordPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_database.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.VulnerabilityAssessmentScanRecordPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.VulnerabilityAssessmentScanRecordPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans'} - def export( self, resource_group_name, server_name, database_name, scan_id, custom_headers=None, raw=False, **operation_config): """Convert an existing scan result to a human readable format. If already From 1c65dc0373d3a1f38e539eb68d5eb17dedb21716 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 6 Nov 2018 23:30:58 +0000 Subject: [PATCH 2/2] Generated from 63e4176e8577c1abaf1a1496628dc432c7fa5479 Update Vulnerability Assessment swaggers Update Vulnerability Assessment swaggers --- .../mgmt/sql/models/database_blob_auditing_policy.py | 8 ++++---- .../mgmt/sql/models/database_blob_auditing_policy_py3.py | 8 ++++---- .../sql/models/extended_database_blob_auditing_policy.py | 8 ++++---- .../models/extended_database_blob_auditing_policy_py3.py | 8 ++++---- .../sql/models/extended_server_blob_auditing_policy.py | 8 ++++---- .../models/extended_server_blob_auditing_policy_py3.py | 8 ++++---- .../azure/mgmt/sql/models/server_blob_auditing_policy.py | 8 ++++---- .../mgmt/sql/models/server_blob_auditing_policy_py3.py | 8 ++++---- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy.py index 57e85a7ffeef..6db06ede30ad 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy.py @@ -92,10 +92,10 @@ class DatabaseBlobAuditingPolicy(ProxyResource): RECEIVE REFERENCES The general form for defining an action to be audited is: - ON BY + {action} ON {object} BY {principal} Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the - latter cases, the forms DATABASE:: and SCHEMA:: are + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. For example: SELECT on dbo.myTable by public @@ -118,10 +118,10 @@ class DatabaseBlobAuditingPolicy(ProxyResource): 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as - . + {databaseName}. Diagnostic Settings URI format: PUT - https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Sql/servers//databases//providers/microsoft.insights/diagnosticSettings/?api-version=2017-05-01-preview + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) or [Diagnostic Settings diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py index ab7e08965ed6..2acc43dae952 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py @@ -92,10 +92,10 @@ class DatabaseBlobAuditingPolicy(ProxyResource): RECEIVE REFERENCES The general form for defining an action to be audited is: - ON BY + {action} ON {object} BY {principal} Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the - latter cases, the forms DATABASE:: and SCHEMA:: are + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. For example: SELECT on dbo.myTable by public @@ -118,10 +118,10 @@ class DatabaseBlobAuditingPolicy(ProxyResource): 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as - . + {databaseName}. Diagnostic Settings URI format: PUT - https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Sql/servers//databases//providers/microsoft.insights/diagnosticSettings/?api-version=2017-05-01-preview + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) or [Diagnostic Settings diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/extended_database_blob_auditing_policy.py b/azure-mgmt-sql/azure/mgmt/sql/models/extended_database_blob_auditing_policy.py index a7b143ea8b15..48c324aa3153 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/extended_database_blob_auditing_policy.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/extended_database_blob_auditing_policy.py @@ -93,10 +93,10 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): RECEIVE REFERENCES The general form for defining an action to be audited is: - ON BY + {action} ON {object} BY {principal} Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the - latter cases, the forms DATABASE:: and SCHEMA:: are + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. For example: SELECT on dbo.myTable by public @@ -119,10 +119,10 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as - . + {databaseName}. Diagnostic Settings URI format: PUT - https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Sql/servers//databases//providers/microsoft.insights/diagnosticSettings/?api-version=2017-05-01-preview + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) or [Diagnostic Settings diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/extended_database_blob_auditing_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/extended_database_blob_auditing_policy_py3.py index 5a4c8f173611..9550f279968c 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/extended_database_blob_auditing_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/extended_database_blob_auditing_policy_py3.py @@ -93,10 +93,10 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): RECEIVE REFERENCES The general form for defining an action to be audited is: - ON BY + {action} ON {object} BY {principal} Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the - latter cases, the forms DATABASE:: and SCHEMA:: are + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. For example: SELECT on dbo.myTable by public @@ -119,10 +119,10 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as - . + {databaseName}. Diagnostic Settings URI format: PUT - https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Sql/servers//databases//providers/microsoft.insights/diagnosticSettings/?api-version=2017-05-01-preview + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) or [Diagnostic Settings diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/extended_server_blob_auditing_policy.py b/azure-mgmt-sql/azure/mgmt/sql/models/extended_server_blob_auditing_policy.py index 68813994b0be..ac110357f4b8 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/extended_server_blob_auditing_policy.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/extended_server_blob_auditing_policy.py @@ -93,10 +93,10 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): RECEIVE REFERENCES The general form for defining an action to be audited is: - ON BY + {action} ON {object} BY {principal} Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the - latter cases, the forms DATABASE:: and SCHEMA:: are + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. For example: SELECT on dbo.myTable by public @@ -119,10 +119,10 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as - . + {databaseName}. Diagnostic Settings URI format: PUT - https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Sql/servers//databases//providers/microsoft.insights/diagnosticSettings/?api-version=2017-05-01-preview + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) or [Diagnostic Settings diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/extended_server_blob_auditing_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/extended_server_blob_auditing_policy_py3.py index 1f60403ce96c..89b96febe17d 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/extended_server_blob_auditing_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/extended_server_blob_auditing_policy_py3.py @@ -93,10 +93,10 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): RECEIVE REFERENCES The general form for defining an action to be audited is: - ON BY + {action} ON {object} BY {principal} Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the - latter cases, the forms DATABASE:: and SCHEMA:: are + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. For example: SELECT on dbo.myTable by public @@ -119,10 +119,10 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as - . + {databaseName}. Diagnostic Settings URI format: PUT - https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Sql/servers//databases//providers/microsoft.insights/diagnosticSettings/?api-version=2017-05-01-preview + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) or [Diagnostic Settings diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_blob_auditing_policy.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_blob_auditing_policy.py index e100e6d3b95c..9a7bc69b8c5d 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_blob_auditing_policy.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_blob_auditing_policy.py @@ -90,10 +90,10 @@ class ServerBlobAuditingPolicy(ProxyResource): RECEIVE REFERENCES The general form for defining an action to be audited is: - ON BY + {action} ON {object} BY {principal} Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the - latter cases, the forms DATABASE:: and SCHEMA:: are + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. For example: SELECT on dbo.myTable by public @@ -116,10 +116,10 @@ class ServerBlobAuditingPolicy(ProxyResource): 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as - . + {databaseName}. Diagnostic Settings URI format: PUT - https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Sql/servers//databases//providers/microsoft.insights/diagnosticSettings/?api-version=2017-05-01-preview + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) or [Diagnostic Settings diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_blob_auditing_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_blob_auditing_policy_py3.py index 183f99e50113..120d066e6427 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_blob_auditing_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_blob_auditing_policy_py3.py @@ -90,10 +90,10 @@ class ServerBlobAuditingPolicy(ProxyResource): RECEIVE REFERENCES The general form for defining an action to be audited is: - ON BY + {action} ON {object} BY {principal} Note that in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the - latter cases, the forms DATABASE:: and SCHEMA:: are + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. For example: SELECT on dbo.myTable by public @@ -116,10 +116,10 @@ class ServerBlobAuditingPolicy(ProxyResource): 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. Note that for server level audit you should use the 'master' database as - . + {databaseName}. Diagnostic Settings URI format: PUT - https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.Sql/servers//databases//providers/microsoft.insights/diagnosticSettings/?api-version=2017-05-01-preview + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) or [Diagnostic Settings