From 960d122ba53cb21b8211ba3b0f03bcd7c4bb2708 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 24 Jun 2019 08:56:14 +0000 Subject: [PATCH 1/3] Generated from 0a90b13aa3eeec05f438be7bbe0eb444a084e789 Update jitNetworkAccessPolicies.json --- .../models/jit_network_access_policy_virtual_machine.py | 5 +++++ .../jit_network_access_policy_virtual_machine_py3.py | 7 ++++++- .../security/models/jit_network_access_request_port.py | 5 +++++ .../security/models/jit_network_access_request_port_py3.py | 7 ++++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine.py index 49ce31c7f04e..acc1126e8732 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine.py @@ -22,6 +22,9 @@ class JitNetworkAccessPolicyVirtualMachine(Model): :type id: str :param ports: Required. Port configurations for the virtual machine :type ports: list[~azure.mgmt.security.models.JitNetworkAccessPortRule] + :param public_ip_address: Public IP address of the Azure Firewall that is + linked to this policy, if applicable + :type public_ip_address: str """ _validation = { @@ -32,9 +35,11 @@ class JitNetworkAccessPolicyVirtualMachine(Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'ports': {'key': 'ports', 'type': '[JitNetworkAccessPortRule]'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, } def __init__(self, **kwargs): super(JitNetworkAccessPolicyVirtualMachine, self).__init__(**kwargs) self.id = kwargs.get('id', None) self.ports = kwargs.get('ports', None) + self.public_ip_address = kwargs.get('public_ip_address', None) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine_py3.py index f315044fbc70..888a6833e2f0 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine_py3.py @@ -22,6 +22,9 @@ class JitNetworkAccessPolicyVirtualMachine(Model): :type id: str :param ports: Required. Port configurations for the virtual machine :type ports: list[~azure.mgmt.security.models.JitNetworkAccessPortRule] + :param public_ip_address: Public IP address of the Azure Firewall that is + linked to this policy, if applicable + :type public_ip_address: str """ _validation = { @@ -32,9 +35,11 @@ class JitNetworkAccessPolicyVirtualMachine(Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'ports': {'key': 'ports', 'type': '[JitNetworkAccessPortRule]'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, } - def __init__(self, *, id: str, ports, **kwargs) -> None: + def __init__(self, *, id: str, ports, public_ip_address: str=None, **kwargs) -> None: super(JitNetworkAccessPolicyVirtualMachine, self).__init__(**kwargs) self.id = id self.ports = ports + self.public_ip_address = public_ip_address diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port.py index 63212f65aae1..1ccf1b371740 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port.py @@ -36,6 +36,9 @@ class JitNetworkAccessRequestPort(Model): value. Possible values include: 'Expired', 'UserRequested', 'NewerRequestInitiated' :type status_reason: str or ~azure.mgmt.security.models.StatusReason + :param mapped_port: The port which is mapped to this port's `number` in + the Azure Firewall, if applicable + :type mapped_port: object """ _validation = { @@ -52,6 +55,7 @@ class JitNetworkAccessRequestPort(Model): 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'str'}, 'status_reason': {'key': 'statusReason', 'type': 'str'}, + 'mapped_port': {'key': 'mappedPort', 'type': 'object'}, } def __init__(self, **kwargs): @@ -62,3 +66,4 @@ def __init__(self, **kwargs): self.end_time_utc = kwargs.get('end_time_utc', None) self.status = kwargs.get('status', None) self.status_reason = kwargs.get('status_reason', None) + self.mapped_port = kwargs.get('mapped_port', None) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port_py3.py index 957d7b08bb7a..ac77c8d21e95 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port_py3.py @@ -36,6 +36,9 @@ class JitNetworkAccessRequestPort(Model): value. Possible values include: 'Expired', 'UserRequested', 'NewerRequestInitiated' :type status_reason: str or ~azure.mgmt.security.models.StatusReason + :param mapped_port: The port which is mapped to this port's `number` in + the Azure Firewall, if applicable + :type mapped_port: object """ _validation = { @@ -52,9 +55,10 @@ class JitNetworkAccessRequestPort(Model): 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'str'}, 'status_reason': {'key': 'statusReason', 'type': 'str'}, + 'mapped_port': {'key': 'mappedPort', 'type': 'object'}, } - def __init__(self, *, number: int, end_time_utc, status, status_reason, allowed_source_address_prefix: str=None, allowed_source_address_prefixes=None, **kwargs) -> None: + def __init__(self, *, number: int, end_time_utc, status, status_reason, allowed_source_address_prefix: str=None, allowed_source_address_prefixes=None, mapped_port=None, **kwargs) -> None: super(JitNetworkAccessRequestPort, self).__init__(**kwargs) self.number = number self.allowed_source_address_prefix = allowed_source_address_prefix @@ -62,3 +66,4 @@ def __init__(self, *, number: int, end_time_utc, status, status_reason, allowed_ self.end_time_utc = end_time_utc self.status = status self.status_reason = status_reason + self.mapped_port = mapped_port From 6569f7bfac57cff58c78aafeeb0401c516ccd5fd Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 25 Jun 2019 12:09:01 +0000 Subject: [PATCH 2/3] Generated from 77db60c613fff13703dc99ca4aaa81bfbd4900ef Update jitNetworkAccessPolicies.json --- .../mgmt/security/models/jit_network_access_request_port.py | 4 ++-- .../security/models/jit_network_access_request_port_py3.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port.py index 1ccf1b371740..29489e7ffa80 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port.py @@ -38,7 +38,7 @@ class JitNetworkAccessRequestPort(Model): :type status_reason: str or ~azure.mgmt.security.models.StatusReason :param mapped_port: The port which is mapped to this port's `number` in the Azure Firewall, if applicable - :type mapped_port: object + :type mapped_port: int """ _validation = { @@ -55,7 +55,7 @@ class JitNetworkAccessRequestPort(Model): 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'str'}, 'status_reason': {'key': 'statusReason', 'type': 'str'}, - 'mapped_port': {'key': 'mappedPort', 'type': 'object'}, + 'mapped_port': {'key': 'mappedPort', 'type': 'int'}, } def __init__(self, **kwargs): diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port_py3.py index ac77c8d21e95..b188238da0cc 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port_py3.py @@ -38,7 +38,7 @@ class JitNetworkAccessRequestPort(Model): :type status_reason: str or ~azure.mgmt.security.models.StatusReason :param mapped_port: The port which is mapped to this port's `number` in the Azure Firewall, if applicable - :type mapped_port: object + :type mapped_port: int """ _validation = { @@ -55,10 +55,10 @@ class JitNetworkAccessRequestPort(Model): 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'str'}, 'status_reason': {'key': 'statusReason', 'type': 'str'}, - 'mapped_port': {'key': 'mappedPort', 'type': 'object'}, + 'mapped_port': {'key': 'mappedPort', 'type': 'int'}, } - def __init__(self, *, number: int, end_time_utc, status, status_reason, allowed_source_address_prefix: str=None, allowed_source_address_prefixes=None, mapped_port=None, **kwargs) -> None: + def __init__(self, *, number: int, end_time_utc, status, status_reason, allowed_source_address_prefix: str=None, allowed_source_address_prefixes=None, mapped_port: int=None, **kwargs) -> None: super(JitNetworkAccessRequestPort, self).__init__(**kwargs) self.number = number self.allowed_source_address_prefix = allowed_source_address_prefix From 2ed56aeaf825158876399736bfde4d5b70de982d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 1 Jul 2019 20:22:55 +0000 Subject: [PATCH 3/3] Generated from 77db60c613fff13703dc99ca4aaa81bfbd4900ef Update jitNetworkAccessPolicies.json --- .../azure/mgmt/security/models/__init__.py | 6 + .../models/server_vulnerability_assessment.py | 49 +++ .../server_vulnerability_assessment_py3.py | 49 +++ .../server_vulnerability_assessments_list.py | 29 ++ ...rver_vulnerability_assessments_list_py3.py | 29 ++ .../mgmt/security/operations/__init__.py | 2 + ...ver_vulnerability_assessment_operations.py | 316 ++++++++++++++++++ .../azure/mgmt/security/security_center.py | 5 + 8 files changed, 485 insertions(+) create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessment.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessment_py3.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessments_list.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessments_list_py3.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/operations/server_vulnerability_assessment_operations.py diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py index eda1c7ded32f..72fb491ff0a1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py @@ -68,6 +68,8 @@ from .regulatory_compliance_standard_py3 import RegulatoryComplianceStandard from .regulatory_compliance_control_py3 import RegulatoryComplianceControl from .regulatory_compliance_assessment_py3 import RegulatoryComplianceAssessment + from .server_vulnerability_assessment_py3 import ServerVulnerabilityAssessment + from .server_vulnerability_assessments_list_py3 import ServerVulnerabilityAssessmentsList except (SyntaxError, ImportError): from .compliance_result import ComplianceResult from .asc_location import AscLocation @@ -127,6 +129,8 @@ from .regulatory_compliance_standard import RegulatoryComplianceStandard from .regulatory_compliance_control import RegulatoryComplianceControl from .regulatory_compliance_assessment import RegulatoryComplianceAssessment + from .server_vulnerability_assessment import ServerVulnerabilityAssessment + from .server_vulnerability_assessments_list import ServerVulnerabilityAssessmentsList from .compliance_result_paged import ComplianceResultPaged from .alert_paged import AlertPaged from .setting_paged import SettingPaged @@ -223,6 +227,8 @@ 'RegulatoryComplianceStandard', 'RegulatoryComplianceControl', 'RegulatoryComplianceAssessment', + 'ServerVulnerabilityAssessment', + 'ServerVulnerabilityAssessmentsList', 'ComplianceResultPaged', 'AlertPaged', 'SettingPaged', diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessment.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessment.py new file mode 100644 index 000000000000..be08a761a2c3 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessment.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ServerVulnerabilityAssessment(Resource): + """Describes the server vulnerability assessment details on a resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar provisioning_state: The provisioningState of the vulnerability + assessment capability on the VM. Possible values include: 'Succeeded', + 'Failed', 'Canceled', 'Provisioning', 'Deprovisioning' + :vartype provisioning_state: str or ~azure.mgmt.security.models.enum + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServerVulnerabilityAssessment, self).__init__(**kwargs) + self.provisioning_state = None diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessment_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessment_py3.py new file mode 100644 index 000000000000..a401ebf662c1 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessment_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class ServerVulnerabilityAssessment(Resource): + """Describes the server vulnerability assessment details on a resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :ivar provisioning_state: The provisioningState of the vulnerability + assessment capability on the VM. Possible values include: 'Succeeded', + 'Failed', 'Canceled', 'Provisioning', 'Deprovisioning' + :vartype provisioning_state: str or ~azure.mgmt.security.models.enum + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ServerVulnerabilityAssessment, self).__init__(**kwargs) + self.provisioning_state = None diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessments_list.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessments_list.py new file mode 100644 index 000000000000..9de12cd4ed9c --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessments_list.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerVulnerabilityAssessmentsList(Model): + """List of server vulnerability assessments. + + :param value: + :type value: + list[~azure.mgmt.security.models.ServerVulnerabilityAssessment] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServerVulnerabilityAssessment]'}, + } + + def __init__(self, **kwargs): + super(ServerVulnerabilityAssessmentsList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessments_list_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessments_list_py3.py new file mode 100644 index 000000000000..b3979d3f0e53 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/server_vulnerability_assessments_list_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerVulnerabilityAssessmentsList(Model): + """List of server vulnerability assessments. + + :param value: + :type value: + list[~azure.mgmt.security.models.ServerVulnerabilityAssessment] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServerVulnerabilityAssessment]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ServerVulnerabilityAssessmentsList, self).__init__(**kwargs) + self.value = value diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py index c065ad458a3e..ff76660402c5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py @@ -30,6 +30,7 @@ from .regulatory_compliance_standards_operations import RegulatoryComplianceStandardsOperations from .regulatory_compliance_controls_operations import RegulatoryComplianceControlsOperations from .regulatory_compliance_assessments_operations import RegulatoryComplianceAssessmentsOperations +from .server_vulnerability_assessment_operations import ServerVulnerabilityAssessmentOperations __all__ = [ 'ComplianceResultsOperations', @@ -53,4 +54,5 @@ 'RegulatoryComplianceStandardsOperations', 'RegulatoryComplianceControlsOperations', 'RegulatoryComplianceAssessmentsOperations', + 'ServerVulnerabilityAssessmentOperations', ] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/server_vulnerability_assessment_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/server_vulnerability_assessment_operations.py new file mode 100644 index 000000000000..7faff054f178 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/server_vulnerability_assessment_operations.py @@ -0,0 +1,316 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ServerVulnerabilityAssessmentOperations(object): + """ServerVulnerabilityAssessmentOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2019-01-01-preview". + :ivar server_vulnerability_assessment: ServerVulnerabilityAssessment status. only a 'default' value is supported. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01-preview" + self.server_vulnerability_assessment = "default" + + self.config = config + + def list_by_extended_resource( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of server vulnerability assessment onboarding statuses on a + given resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_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: ServerVulnerabilityAssessmentsList or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.security.models.ServerVulnerabilityAssessmentsList + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_extended_resource.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, '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') + + # 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 + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ServerVulnerabilityAssessmentsList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_extended_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments'} + + def get( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets a server vulnerability assessment onboarding statuses on a given + resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_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: ServerVulnerabilityAssessment or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.security.models.ServerVulnerabilityAssessment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'serverVulnerabilityAssessment': self._serialize.url("self.server_vulnerability_assessment", self.server_vulnerability_assessment, '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') + + # 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 + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ServerVulnerabilityAssessment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} + + def create_or_update( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): + """Creating a server vulnerability assessment on a resource, which will + onboard a resource for having a vulnerability assessment on it. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_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: ServerVulnerabilityAssessment or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.security.models.ServerVulnerabilityAssessment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'serverVulnerabilityAssessment': self._serialize.url("self.server_vulnerability_assessment", self.server_vulnerability_assessment, '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') + + # 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.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 202: + deserialized = self._deserialize('ServerVulnerabilityAssessment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} + + def delete( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): + """Removing server vulnerability assessment from a resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'serverVulnerabilityAssessment': self._serialize.url("self.server_vulnerability_assessment", self.server_vulnerability_assessment, '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') + + # Construct headers + header_parameters = {} + 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/security_center.py index b138a0a3d3bc..8b4c683fa799 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/security_center.py @@ -34,6 +34,7 @@ from .operations.regulatory_compliance_standards_operations import RegulatoryComplianceStandardsOperations from .operations.regulatory_compliance_controls_operations import RegulatoryComplianceControlsOperations from .operations.regulatory_compliance_assessments_operations import RegulatoryComplianceAssessmentsOperations +from .operations.server_vulnerability_assessment_operations import ServerVulnerabilityAssessmentOperations from . import models @@ -123,6 +124,8 @@ class SecurityCenter(SDKClient): :vartype regulatory_compliance_controls: azure.mgmt.security.operations.RegulatoryComplianceControlsOperations :ivar regulatory_compliance_assessments: RegulatoryComplianceAssessments operations :vartype regulatory_compliance_assessments: azure.mgmt.security.operations.RegulatoryComplianceAssessmentsOperations + :ivar server_vulnerability_assessment: ServerVulnerabilityAssessment operations + :vartype server_vulnerability_assessment: azure.mgmt.security.operations.ServerVulnerabilityAssessmentOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -187,3 +190,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.regulatory_compliance_assessments = RegulatoryComplianceAssessmentsOperations( self._client, self.config, self._serialize, self._deserialize) + self.server_vulnerability_assessment = ServerVulnerabilityAssessmentOperations( + self._client, self.config, self._serialize, self._deserialize)