Skip to content

Commit

Permalink
CodeGen from PR 17924 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Dev securityinsights microsoft.security insights 2021 10 01 (Azure#17924)

* Adds base for updating Microsoft.SecurityInsights from version stable/2021-04-01 to version 2021-10-01

* Updates readme

* Updates API version in new specs and examples

* Add AlertRules to microsoft.security insights 2021 10 01 (Azure#15657)

* Adds base for updating Microsoft.SecurityInsight's AlertRules from version stable/2020-01-01 to version 2021-10-01

* Updates API version in AlertRules specs and examples

* Use common types in AlertRules.json and remove redundant SecurityInsights

* Add AlertRules to readme

* Copy action examples for alert rules

* Add type:object where missing

* Align CloudError with rest of the resources in this version

* Update readme

Co-authored-by: Anat Gilenson <anatgilenson@microsoft.com>

* Use newest common types to align with rest of Azure (Azure#16130)

* Use newest common types to align with rest of Azure

* Use ErrorResponse instead of CloudError in operations

Co-authored-by: Anat Gilenson <anatgilenson@microsoft.com>

* Add AlertRules Stable version to 2021-10-01 (Azure#16268)

* Add AlertRules Stable version to 2021-10-01

* Fix missing alignment in common types

* prettier fixes

* move tactics and severity to common

* fix common types file extension

* more prettier fixes

* Add template version field

* prettier

* added version to required fields

* dummy change to trigger checks again

* Add onboarding states to new stable version (Azure#16290)

* Add onboarding states to new stable version

* Update readme.md

* cr fix - remove unused params

* Add missing resources 2021 10 01 (Azure#16666)

* Add missing resources and examples from 2020-01-01

* Update version in added resources and examples

* Use existing common types

* Remove unnesessary SecurityInsights.json

* Update readme

* Use sentinel common types in Incidents and Watchlist

* Extract and common IncidentInfo and IncidentSeverity

* Extract EntityTypes

* Correct double allOf in EntityTypes

* update readme

* Remove eventGroupingSettings and entityMappings from GetAlertRuleTemplateById example.

* rename operations.json

Co-authored-by: Anat Gilenson <anatgilenson@microsoft.com>

* Fix analytics templates model (Azure#16689)

* add missing properties to scheduled template

* prettier fixes

* restore templates example after merge

* fix templates example after merge and run prettier

* Use CloudError instead of ErrorResponse to align with preview versions and our back-end. (Azure#17472)

* Automation - Stable Version (Azure#17491)

* First

* readMe

* cloudError

* CloudError

* schema

* prettier

* Fix

* test

* fix identifier

* fix description

* fix lable

* fix lable

* ownerInfo

* Fix

* types

* conditionMaxLength

Co-authored-by: Roy Reinhorn <roreinho@microsoft.com>

* Done (Azure#17728)

Co-authored-by: Roy Reinhorn <roreinho@microsoft.com>

* Correct 2021 10 01 (Azure#17830)

* Remove OperationalInsightsResourceProvider parameter in ThreatIntelligence

* Remove OperationalInsightProviderParameter from Watchlist

* Align stable operation names with preview

* Add missing disciminator property in ThreatIntelligence

* Done (Azure#17844)

Co-authored-by: Roy Reinhorn <roreinho@microsoft.com>

* Align enum names with preview (Azure#17831)

* Fix 2021 10 01 validation errors (Azure#17937)

* Add x-ms-identifiers to all arrays

* Add operations_list example

* Add x-ms-identifier in all arrays

* Run prettier

* Fix spelling error

* Add isDataAction to operation schema (Azure#18018)

Co-authored-by: Anat Gilenson <anatgilenson@microsoft.com>
Co-authored-by: laithhisham <49263932+laithhisham@users.noreply.github.com>
Co-authored-by: royrein <37300636+royrein@users.noreply.github.com>
Co-authored-by: Roy Reinhorn <roreinho@microsoft.com>
Co-authored-by: Arthur Ning <57385816+akning-ms@users.noreply.github.com>
  • Loading branch information
6 people committed Feb 28, 2022
1 parent fb4f795 commit a49da55
Show file tree
Hide file tree
Showing 81 changed files with 41,480 additions and 7,127 deletions.
11 changes: 11 additions & 0 deletions sdk/securityinsight/azure-mgmt-securityinsight/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.7.2",
"use": [
"@autorest/python@5.12.0",
"@autorest/modelerfour@4.19.3"
],
"commit": "3284dc9bdbda05f84e0fa0b1a2f7ba5d138c504b",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/securityinsights/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"readme": "specification/securityinsights/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
__version__ = VERSION
__all__ = ['SecurityInsights']

try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass
# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential


Expand All @@ -29,26 +27,25 @@ class SecurityInsightsConfiguration(Configuration):
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Azure subscription ID.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
**kwargs # type: Any
):
# type: (...) -> None
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
super(SecurityInsightsConfiguration, self).__init__(**kwargs)
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(SecurityInsightsConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-01-01"
self.api_version = "2021-10-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-securityinsight/{}'.format(VERSION))
self._configure(**kwargs)
Expand All @@ -68,4 +65,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line number Diff line number Diff line change
@@ -1,67 +1,133 @@
{
"chosen_version": "2020-01-01",
"total_api_version_list": ["2020-01-01"],
"chosen_version": "2021-10-01-preview",
"total_api_version_list": ["2021-10-01-preview"],
"client": {
"name": "SecurityInsights",
"filename": "_security_insights",
"description": "API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"host_value": "\"https://management.azure.com\"",
"parameterized_host_template": null,
"azure_arm": true,
"has_lro_operations": false
"has_lro_operations": false,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SecurityInsightsConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SecurityInsightsConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
},
"global_parameters": {
"sync_method": {
"sync": {
"credential": {
"method_signature": "credential, # type: \"TokenCredential\"",
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"method_signature": "subscription_id, # type: str",
"description": "Azure subscription ID.",
"signature": "subscription_id, # type: str",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
},
"async_method": {
"async": {
"credential": {
"method_signature": "credential, # type: \"AsyncTokenCredential\"",
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"method_signature": "subscription_id, # type: str",
"description": "Azure subscription ID.",
"signature": "subscription_id: str,",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id"
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=\"https://management.azure.com\", # type: str",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"operations": "Operations",
"alert_rules": "AlertRulesOperations",
"actions": "ActionsOperations",
"alert_rule_templates": "AlertRuleTemplatesOperations",
"automation_rules": "AutomationRulesOperations",
"incidents": "IncidentsOperations",
"bookmarks": "BookmarksOperations",
"bookmark_relations": "BookmarkRelationsOperations",
"bookmark": "BookmarkOperations",
"ip_geodata": "IPGeodataOperations",
"domain_whois": "DomainWhoisOperations",
"entities": "EntitiesOperations",
"entities_get_timeline": "EntitiesGetTimelineOperations",
"entities_relations": "EntitiesRelationsOperations",
"entity_relations": "EntityRelationsOperations",
"entity_queries": "EntityQueriesOperations",
"entity_query_templates": "EntityQueryTemplatesOperations",
"incident_comments": "IncidentCommentsOperations",
"incident_relations": "IncidentRelationsOperations",
"metadata": "MetadataOperations",
"office_consents": "OfficeConsentsOperations",
"sentinel_onboarding_states": "SentinelOnboardingStatesOperations",
"product_settings": "ProductSettingsOperations",
"source_control": "SourceControlOperations",
"source_controls": "SourceControlsOperations",
"threat_intelligence_indicator": "ThreatIntelligenceIndicatorOperations",
"threat_intelligence_indicators": "ThreatIntelligenceIndicatorsOperations",
"threat_intelligence_indicator_metrics": "ThreatIntelligenceIndicatorMetricsOperations",
"watchlists": "WatchlistsOperations",
"watchlist_items": "WatchlistItemsOperations",
"data_connectors": "DataConnectorsOperations",
"incidents": "IncidentsOperations",
"incident_comments": "IncidentCommentsOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
"data_connectors_check_requirements": "DataConnectorsCheckRequirementsOperations",
"operations": "Operations"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------

# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
Loading

0 comments on commit a49da55

Please sign in to comment.