Skip to content

Commit 5039332

Browse files
author
SDKAuto
committed
CodeGen from PR 16250 in Azure/azure-rest-api-specs
Merge 3ff6f1cdf049090dc56ffd3001c22de0bdd218b7 into a87e536
1 parent 2e92f43 commit 5039332

File tree

8 files changed

+169
-51
lines changed

8 files changed

+169
-51
lines changed

sdk/policyinsights/azure-mgmt-policyinsights/_meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"@autorest/[email protected]",
55
"@autorest/[email protected]"
66
],
7-
"commit": "e7682aa897902920f3a95b2f358b6f7729d18666",
7+
"commit": "995030f51bfa73c13e8d4dc36e270cae1ca33908",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
99
"autorest_command": "autorest specification/policyinsights/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.4.5",
1010
"readme": "specification/policyinsights/resource-manager/readme.md"

sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"chosen_version": "",
3-
"total_api_version_list": ["2018-07-01-preview", "2019-07-01", "2019-10-01", "2020-07-01", "2021-01-01"],
3+
"total_api_version_list": ["2018-07-01-preview", "2019-10-01", "2020-07-01", "2021-01-01", "2021-10-01"],
44
"client": {
55
"name": "PolicyInsightsClient",
66
"filename": "_policy_insights_client",

sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.1.0b1"
9+
VERSION = "1.0.0b1"

sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/aio/operations/_remediations_operations.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def list_deployments_at_management_group(
7171
if query_options is not None:
7272
_top = query_options.top
7373
management_groups_namespace = "Microsoft.Management"
74-
api_version = "2019-07-01"
74+
api_version = "2021-10-01"
7575
accept = "application/json"
7676

7777
def prepare_request(next_link=None):
@@ -149,7 +149,7 @@ async def cancel_at_management_group(
149149
}
150150
error_map.update(kwargs.pop('error_map', {}))
151151
management_groups_namespace = "Microsoft.Management"
152-
api_version = "2019-07-01"
152+
api_version = "2021-10-01"
153153
accept = "application/json"
154154

155155
# Construct URL
@@ -215,7 +215,7 @@ def list_for_management_group(
215215
_top = query_options.top
216216
_filter = query_options.filter
217217
management_groups_namespace = "Microsoft.Management"
218-
api_version = "2019-07-01"
218+
api_version = "2021-10-01"
219219
accept = "application/json"
220220

221221
def prepare_request(next_link=None):
@@ -297,7 +297,7 @@ async def create_or_update_at_management_group(
297297
}
298298
error_map.update(kwargs.pop('error_map', {}))
299299
management_groups_namespace = "Microsoft.Management"
300-
api_version = "2019-07-01"
300+
api_version = "2021-10-01"
301301
content_type = kwargs.pop("content_type", "application/json")
302302
accept = "application/json"
303303

@@ -366,7 +366,7 @@ async def get_at_management_group(
366366
}
367367
error_map.update(kwargs.pop('error_map', {}))
368368
management_groups_namespace = "Microsoft.Management"
369-
api_version = "2019-07-01"
369+
api_version = "2021-10-01"
370370
accept = "application/json"
371371

372372
# Construct URL
@@ -426,7 +426,7 @@ async def delete_at_management_group(
426426
}
427427
error_map.update(kwargs.pop('error_map', {}))
428428
management_groups_namespace = "Microsoft.Management"
429-
api_version = "2019-07-01"
429+
api_version = "2021-10-01"
430430
accept = "application/json"
431431

432432
# Construct URL
@@ -491,7 +491,7 @@ def list_deployments_at_subscription(
491491
_top = None
492492
if query_options is not None:
493493
_top = query_options.top
494-
api_version = "2019-07-01"
494+
api_version = "2021-10-01"
495495
accept = "application/json"
496496

497497
def prepare_request(next_link=None):
@@ -564,7 +564,7 @@ async def cancel_at_subscription(
564564
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
565565
}
566566
error_map.update(kwargs.pop('error_map', {}))
567-
api_version = "2019-07-01"
567+
api_version = "2021-10-01"
568568
accept = "application/json"
569569

570570
# Construct URL
@@ -625,7 +625,7 @@ def list_for_subscription(
625625
if query_options is not None:
626626
_top = query_options.top
627627
_filter = query_options.filter
628-
api_version = "2019-07-01"
628+
api_version = "2021-10-01"
629629
accept = "application/json"
630630

631631
def prepare_request(next_link=None):
@@ -702,7 +702,7 @@ async def create_or_update_at_subscription(
702702
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
703703
}
704704
error_map.update(kwargs.pop('error_map', {}))
705-
api_version = "2019-07-01"
705+
api_version = "2021-10-01"
706706
content_type = kwargs.pop("content_type", "application/json")
707707
accept = "application/json"
708708

@@ -766,7 +766,7 @@ async def get_at_subscription(
766766
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
767767
}
768768
error_map.update(kwargs.pop('error_map', {}))
769-
api_version = "2019-07-01"
769+
api_version = "2021-10-01"
770770
accept = "application/json"
771771

772772
# Construct URL
@@ -821,7 +821,7 @@ async def delete_at_subscription(
821821
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
822822
}
823823
error_map.update(kwargs.pop('error_map', {}))
824-
api_version = "2019-07-01"
824+
api_version = "2021-10-01"
825825
accept = "application/json"
826826

827827
# Construct URL
@@ -888,7 +888,7 @@ def list_deployments_at_resource_group(
888888
_top = None
889889
if query_options is not None:
890890
_top = query_options.top
891-
api_version = "2019-07-01"
891+
api_version = "2021-10-01"
892892
accept = "application/json"
893893

894894
def prepare_request(next_link=None):
@@ -965,7 +965,7 @@ async def cancel_at_resource_group(
965965
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
966966
}
967967
error_map.update(kwargs.pop('error_map', {}))
968-
api_version = "2019-07-01"
968+
api_version = "2021-10-01"
969969
accept = "application/json"
970970

971971
# Construct URL
@@ -1030,7 +1030,7 @@ def list_for_resource_group(
10301030
if query_options is not None:
10311031
_top = query_options.top
10321032
_filter = query_options.filter
1033-
api_version = "2019-07-01"
1033+
api_version = "2021-10-01"
10341034
accept = "application/json"
10351035

10361036
def prepare_request(next_link=None):
@@ -1111,7 +1111,7 @@ async def create_or_update_at_resource_group(
11111111
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
11121112
}
11131113
error_map.update(kwargs.pop('error_map', {}))
1114-
api_version = "2019-07-01"
1114+
api_version = "2021-10-01"
11151115
content_type = kwargs.pop("content_type", "application/json")
11161116
accept = "application/json"
11171117

@@ -1179,7 +1179,7 @@ async def get_at_resource_group(
11791179
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
11801180
}
11811181
error_map.update(kwargs.pop('error_map', {}))
1182-
api_version = "2019-07-01"
1182+
api_version = "2021-10-01"
11831183
accept = "application/json"
11841184

11851185
# Construct URL
@@ -1238,7 +1238,7 @@ async def delete_at_resource_group(
12381238
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
12391239
}
12401240
error_map.update(kwargs.pop('error_map', {}))
1241-
api_version = "2019-07-01"
1241+
api_version = "2021-10-01"
12421242
accept = "application/json"
12431243

12441244
# Construct URL
@@ -1306,7 +1306,7 @@ def list_deployments_at_resource(
13061306
_top = None
13071307
if query_options is not None:
13081308
_top = query_options.top
1309-
api_version = "2019-07-01"
1309+
api_version = "2021-10-01"
13101310
accept = "application/json"
13111311

13121312
def prepare_request(next_link=None):
@@ -1382,7 +1382,7 @@ async def cancel_at_resource(
13821382
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
13831383
}
13841384
error_map.update(kwargs.pop('error_map', {}))
1385-
api_version = "2019-07-01"
1385+
api_version = "2021-10-01"
13861386
accept = "application/json"
13871387

13881388
# Construct URL
@@ -1446,7 +1446,7 @@ def list_for_resource(
14461446
if query_options is not None:
14471447
_top = query_options.top
14481448
_filter = query_options.filter
1449-
api_version = "2019-07-01"
1449+
api_version = "2021-10-01"
14501450
accept = "application/json"
14511451

14521452
def prepare_request(next_link=None):
@@ -1526,7 +1526,7 @@ async def create_or_update_at_resource(
15261526
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
15271527
}
15281528
error_map.update(kwargs.pop('error_map', {}))
1529-
api_version = "2019-07-01"
1529+
api_version = "2021-10-01"
15301530
content_type = kwargs.pop("content_type", "application/json")
15311531
accept = "application/json"
15321532

@@ -1593,7 +1593,7 @@ async def get_at_resource(
15931593
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
15941594
}
15951595
error_map.update(kwargs.pop('error_map', {}))
1596-
api_version = "2019-07-01"
1596+
api_version = "2021-10-01"
15971597
accept = "application/json"
15981598

15991599
# Construct URL
@@ -1651,7 +1651,7 @@ async def delete_at_resource(
16511651
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
16521652
}
16531653
error_map.update(kwargs.pop('error_map', {}))
1654-
api_version = "2019-07-01"
1654+
api_version = "2021-10-01"
16551655
accept = "application/json"
16561656

16571657
# Construct URL

sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
from ._models_py3 import RemediationDeploymentsListResult
5858
from ._models_py3 import RemediationFilters
5959
from ._models_py3 import RemediationListResult
60+
from ._models_py3 import RemediationPropertiesFailureThreshold
6061
from ._models_py3 import Resource
6162
from ._models_py3 import SlimPolicyMetadata
6263
from ._models_py3 import SummarizeResults
@@ -116,6 +117,7 @@
116117
from ._models import RemediationDeploymentsListResult # type: ignore
117118
from ._models import RemediationFilters # type: ignore
118119
from ._models import RemediationListResult # type: ignore
120+
from ._models import RemediationPropertiesFailureThreshold # type: ignore
119121
from ._models import Resource # type: ignore
120122
from ._models import SlimPolicyMetadata # type: ignore
121123
from ._models import SummarizeResults # type: ignore
@@ -184,6 +186,7 @@
184186
'RemediationDeploymentsListResult',
185187
'RemediationFilters',
186188
'RemediationListResult',
189+
'RemediationPropertiesFailureThreshold',
187190
'Resource',
188191
'SlimPolicyMetadata',
189192
'SummarizeResults',

sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/_models.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,6 +1925,9 @@ class Remediation(msrest.serialization.Model):
19251925
:vartype type: str
19261926
:ivar name: The name of the remediation.
19271927
:vartype name: str
1928+
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
1929+
information.
1930+
:vartype system_data: ~azure.mgmt.policyinsights.models.SystemData
19281931
:param policy_assignment_id: The resource ID of the policy assignment that should be
19291932
remediated.
19301933
:type policy_assignment_id: str
@@ -1947,22 +1950,42 @@ class Remediation(msrest.serialization.Model):
19471950
:ivar deployment_status: The deployment status summary for all deployments created by the
19481951
remediation.
19491952
:vartype deployment_status: ~azure.mgmt.policyinsights.models.RemediationDeploymentSummary
1953+
:ivar status_message: The remediation status message. Provides additional details regarding the
1954+
state of the remediation.
1955+
:vartype status_message: str
1956+
:ivar correlation_id: The remediation correlation Id. Can be used to find events related to the
1957+
remediation in the activity log.
1958+
:vartype correlation_id: str
1959+
:param resource_count: Determines the max number of resources that can be remediated by the
1960+
remediation job. If not provided, the default resource count is used.
1961+
:type resource_count: int
1962+
:param parallel_deployments: Determines how many resources to remediate at any given time. Can
1963+
be used to increase or reduce the pace of the remediation. If not provided, the default
1964+
parallel deployments value is used.
1965+
:type parallel_deployments: int
1966+
:param failure_threshold: The remediation failure threshold settings.
1967+
:type failure_threshold:
1968+
~azure.mgmt.policyinsights.models.RemediationPropertiesFailureThreshold
19501969
"""
19511970

19521971
_validation = {
19531972
'id': {'readonly': True},
19541973
'type': {'readonly': True},
19551974
'name': {'readonly': True},
1975+
'system_data': {'readonly': True},
19561976
'provisioning_state': {'readonly': True},
19571977
'created_on': {'readonly': True},
19581978
'last_updated_on': {'readonly': True},
19591979
'deployment_status': {'readonly': True},
1980+
'status_message': {'readonly': True},
1981+
'correlation_id': {'readonly': True},
19601982
}
19611983

19621984
_attribute_map = {
19631985
'id': {'key': 'id', 'type': 'str'},
19641986
'type': {'key': 'type', 'type': 'str'},
19651987
'name': {'key': 'name', 'type': 'str'},
1988+
'system_data': {'key': 'systemData', 'type': 'SystemData'},
19661989
'policy_assignment_id': {'key': 'properties.policyAssignmentId', 'type': 'str'},
19671990
'policy_definition_reference_id': {'key': 'properties.policyDefinitionReferenceId', 'type': 'str'},
19681991
'resource_discovery_mode': {'key': 'properties.resourceDiscoveryMode', 'type': 'str'},
@@ -1971,6 +1994,11 @@ class Remediation(msrest.serialization.Model):
19711994
'last_updated_on': {'key': 'properties.lastUpdatedOn', 'type': 'iso-8601'},
19721995
'filters': {'key': 'properties.filters', 'type': 'RemediationFilters'},
19731996
'deployment_status': {'key': 'properties.deploymentStatus', 'type': 'RemediationDeploymentSummary'},
1997+
'status_message': {'key': 'properties.statusMessage', 'type': 'str'},
1998+
'correlation_id': {'key': 'properties.correlationId', 'type': 'str'},
1999+
'resource_count': {'key': 'properties.resourceCount', 'type': 'int'},
2000+
'parallel_deployments': {'key': 'properties.parallelDeployments', 'type': 'int'},
2001+
'failure_threshold': {'key': 'properties.failureThreshold', 'type': 'RemediationPropertiesFailureThreshold'},
19742002
}
19752003

19762004
def __init__(
@@ -1981,6 +2009,7 @@ def __init__(
19812009
self.id = None
19822010
self.type = None
19832011
self.name = None
2012+
self.system_data = None
19842013
self.policy_assignment_id = kwargs.get('policy_assignment_id', None)
19852014
self.policy_definition_reference_id = kwargs.get('policy_definition_reference_id', None)
19862015
self.resource_discovery_mode = kwargs.get('resource_discovery_mode', None)
@@ -1989,6 +2018,11 @@ def __init__(
19892018
self.last_updated_on = None
19902019
self.filters = kwargs.get('filters', None)
19912020
self.deployment_status = None
2021+
self.status_message = None
2022+
self.correlation_id = None
2023+
self.resource_count = kwargs.get('resource_count', None)
2024+
self.parallel_deployments = kwargs.get('parallel_deployments', None)
2025+
self.failure_threshold = kwargs.get('failure_threshold', None)
19922026

19932027

19942028
class RemediationDeployment(msrest.serialization.Model):
@@ -2163,6 +2197,27 @@ def __init__(
21632197
self.next_link = None
21642198

21652199

2200+
class RemediationPropertiesFailureThreshold(msrest.serialization.Model):
2201+
"""The remediation failure threshold settings.
2202+
2203+
:param percentage: A number between 0.0 to 1.0 representing the percentage failure threshold.
2204+
The remediation will fail if the percentage of failed remediation operations (i.e. failed
2205+
deployments) exceeds this threshold.
2206+
:type percentage: float
2207+
"""
2208+
2209+
_attribute_map = {
2210+
'percentage': {'key': 'percentage', 'type': 'float'},
2211+
}
2212+
2213+
def __init__(
2214+
self,
2215+
**kwargs
2216+
):
2217+
super(RemediationPropertiesFailureThreshold, self).__init__(**kwargs)
2218+
self.percentage = kwargs.get('percentage', None)
2219+
2220+
21662221
class SlimPolicyMetadata(msrest.serialization.Model):
21672222
"""Slim version of policy metadata resource definition, excluding properties with large strings.
21682223

0 commit comments

Comments
 (0)