diff --git a/azure-mgmt-securityinsight/MANIFEST.in b/azure-mgmt-securityinsight/MANIFEST.in index 6ceb27f7a96e..e4884efef41b 100644 --- a/azure-mgmt-securityinsight/MANIFEST.in +++ b/azure-mgmt-securityinsight/MANIFEST.in @@ -1,3 +1,4 @@ +recursive-include tests *.py *.yaml include *.rst include azure/__init__.py include azure/mgmt/__init__.py diff --git a/azure-mgmt-securityinsight/README.rst b/azure-mgmt-securityinsight/README.rst index d0429ebc7565..94ef30d6093b 100644 --- a/azure-mgmt-securityinsight/README.rst +++ b/azure-mgmt-securityinsight/README.rst @@ -28,3 +28,6 @@ Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the `Issues `__ section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-securityinsight%2FREADME.png diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py index f44962a7aeb5..c619ab787d2f 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py @@ -47,6 +47,8 @@ from .settings_kind_py3 import SettingsKind from .ueba_settings_py3 import UebaSettings from .toggle_settings_py3 import ToggleSettings + from .aggregations_py3 import Aggregations + from .aggregations_kind1_py3 import AggregationsKind1 except (SyntaxError, ImportError): from .operation_display import OperationDisplay from .operation import Operation @@ -85,6 +87,8 @@ from .settings_kind import SettingsKind from .ueba_settings import UebaSettings from .toggle_settings import ToggleSettings + from .aggregations import Aggregations + from .aggregations_kind1 import AggregationsKind1 from .operation_paged import OperationPaged from .alert_rule_paged import AlertRulePaged from .action_paged import ActionPaged @@ -106,6 +110,7 @@ OSFamily, SettingKind, StatusInMcas, + AggregationsKind, ) __all__ = [ @@ -146,6 +151,8 @@ 'SettingsKind', 'UebaSettings', 'ToggleSettings', + 'Aggregations', + 'AggregationsKind1', 'OperationPaged', 'AlertRulePaged', 'ActionPaged', @@ -166,4 +173,5 @@ 'OSFamily', 'SettingKind', 'StatusInMcas', + 'AggregationsKind', ] diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations.py new file mode 100644 index 000000000000..1725d1ad51af --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations.py @@ -0,0 +1,52 @@ +# 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 Aggregations(Model): + """The aggregation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Aggregations, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1.py new file mode 100644 index 000000000000..8af6327111f3 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1.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 AggregationsKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the setting. Possible values include: + 'CasesAggregation' + :type kind: str or ~azure.mgmt.securityinsight.models.AggregationsKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AggregationsKind1, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1_py3.py new file mode 100644 index 000000000000..13fe73cf6168 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1_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 AggregationsKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the setting. Possible values include: + 'CasesAggregation' + :type kind: str or ~azure.mgmt.securityinsight.models.AggregationsKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind=None, **kwargs) -> None: + super(AggregationsKind1, self).__init__(**kwargs) + self.kind = kind diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_py3.py new file mode 100644 index 000000000000..82ab1d137e2a --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_py3.py @@ -0,0 +1,52 @@ +# 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 Aggregations(Model): + """The aggregation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Aggregations, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py index 7f82e3f12db9..b36f9a1e1f89 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py @@ -97,3 +97,8 @@ class StatusInMcas(str, Enum): enabled = "Enabled" disabled = "Disabled" + + +class AggregationsKind(str, Enum): + + cases_aggregation = "CasesAggregation" diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py index 3fb060e77fd9..ae9a8cf31361 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py @@ -18,6 +18,7 @@ from .entities_operations import EntitiesOperations from .office_consents_operations import OfficeConsentsOperations from .product_settings_operations import ProductSettingsOperations +from .cases_aggregations_operations import CasesAggregationsOperations __all__ = [ 'Operations', @@ -29,4 +30,5 @@ 'EntitiesOperations', 'OfficeConsentsOperations', 'ProductSettingsOperations', + 'CasesAggregationsOperations', ] diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/cases_aggregations_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/cases_aggregations_operations.py new file mode 100644 index 000000000000..4a22e3374106 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/cases_aggregations_operations.py @@ -0,0 +1,109 @@ +# 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 CasesAggregationsOperations(object): + """CasesAggregationsOperations 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". + """ + + 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.config = config + + def get( + self, resource_group_name, operational_insights_resource_provider, workspace_name, aggregations_name, custom_headers=None, raw=False, **operation_config): + """Get aggregative result for the given resources under the defined + workspace. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param aggregations_name: The aggregation name. Supports - Cases + :type aggregations_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: Aggregations or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.Aggregations 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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'aggregationsName': self._serialize.url("aggregations_name", aggregations_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('Aggregations', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/aggregations/{aggregationsName}'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py index a8ed1d8179c5..37efb48bba3d 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py @@ -22,6 +22,7 @@ from .operations.entities_operations import EntitiesOperations from .operations.office_consents_operations import OfficeConsentsOperations from .operations.product_settings_operations import ProductSettingsOperations +from .operations.cases_aggregations_operations import CasesAggregationsOperations from . import models @@ -81,6 +82,8 @@ class SecurityInsights(SDKClient): :vartype office_consents: azure.mgmt.securityinsight.operations.OfficeConsentsOperations :ivar product_settings: ProductSettings operations :vartype product_settings: azure.mgmt.securityinsight.operations.ProductSettingsOperations + :ivar cases_aggregations: CasesAggregations operations + :vartype cases_aggregations: azure.mgmt.securityinsight.operations.CasesAggregationsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -119,3 +122,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.product_settings = ProductSettingsOperations( self._client, self.config, self._serialize, self._deserialize) + self.cases_aggregations = CasesAggregationsOperations( + self._client, self.config, self._serialize, self._deserialize)