Skip to content

Commit 66d166d

Browse files
[AutoRelease] t2-servicenetworking-2025-04-23-64871(can only be merged by SDK owner) (Azure#40669)
* code and test * update testcases * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent a7dd48c commit 66d166d

File tree

53 files changed

+865
-334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+865
-334
lines changed

sdk/servicenetworking/azure-mgmt-servicenetworking/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Release History
22

3+
## 2.1.0b1 (2025-05-12)
4+
5+
### Features Added
6+
7+
- Model `FrontendProperties` added property `security_policy_configurations`
8+
- Model `FrontendUpdate` added property `properties`
9+
- Enum `PolicyType` added member `IP_ACCESS_RULES`
10+
- Model `SecurityPolicyConfigurations` added property `ip_access_rules_security_policy`
11+
- Model `SecurityPolicyProperties` added property `ip_access_rules_policy`
12+
- Model `SecurityPolicyUpdateProperties` added property `ip_access_rules_policy`
13+
- Added model `FrontendUpdateProperties`
14+
- Added model `IpAccessRule`
15+
- Added enum `IpAccessRuleAction`
16+
- Added model `IpAccessRulesPolicy`
17+
- Added model `IpAccessRulesSecurityPolicy`
18+
319
## 2.0.0 (2025-02-05)
420

521
### Features Added

sdk/servicenetworking/azure-mgmt-servicenetworking/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Servicenetworking Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "16eba0e39fedb21b9a7a3df5bec5524c78c72ba3",
2+
"commit": "8ab23bfef36dbedfe554f215d0771a4ef7d56d11",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/servicenetworking/ServiceNetworking.Management",
5-
"@azure-tools/typespec-python": "0.38.1"
5+
"@azure-tools/typespec-python": "0.43.0"
66
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.ServiceNetworking",
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.servicenetworking.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
5+
"azure.mgmt.servicenetworking.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource",
6+
"azure.mgmt.servicenetworking.models.Association": "Microsoft.ServiceNetworking.Association",
7+
"azure.mgmt.servicenetworking.models.AssociationProperties": "Microsoft.ServiceNetworking.AssociationProperties",
8+
"azure.mgmt.servicenetworking.models.AssociationSubnet": "Microsoft.ServiceNetworking.AssociationSubnet",
9+
"azure.mgmt.servicenetworking.models.AssociationSubnetUpdate": "Microsoft.ServiceNetworking.AssociationSubnetUpdate",
10+
"azure.mgmt.servicenetworking.models.AssociationUpdate": "Microsoft.ServiceNetworking.AssociationUpdate",
11+
"azure.mgmt.servicenetworking.models.AssociationUpdateProperties": "Microsoft.ServiceNetworking.AssociationUpdateProperties",
12+
"azure.mgmt.servicenetworking.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
13+
"azure.mgmt.servicenetworking.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
14+
"azure.mgmt.servicenetworking.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
15+
"azure.mgmt.servicenetworking.models.Frontend": "Microsoft.ServiceNetworking.Frontend",
16+
"azure.mgmt.servicenetworking.models.FrontendProperties": "Microsoft.ServiceNetworking.FrontendProperties",
17+
"azure.mgmt.servicenetworking.models.FrontendUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel",
18+
"azure.mgmt.servicenetworking.models.FrontendUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties",
19+
"azure.mgmt.servicenetworking.models.IpAccessRule": "Microsoft.ServiceNetworking.IpAccessRule",
20+
"azure.mgmt.servicenetworking.models.IpAccessRulesPolicy": "Microsoft.ServiceNetworking.IpAccessRulesPolicy",
21+
"azure.mgmt.servicenetworking.models.IpAccessRulesSecurityPolicy": "Microsoft.ServiceNetworking.IpAccessRulesSecurityPolicy",
22+
"azure.mgmt.servicenetworking.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
23+
"azure.mgmt.servicenetworking.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
24+
"azure.mgmt.servicenetworking.models.ResourceId": "Microsoft.ServiceNetworking.ResourceId",
25+
"azure.mgmt.servicenetworking.models.SecurityPolicy": "Microsoft.ServiceNetworking.SecurityPolicy",
26+
"azure.mgmt.servicenetworking.models.SecurityPolicyConfigurations": "Microsoft.ServiceNetworking.SecurityPolicyConfigurations",
27+
"azure.mgmt.servicenetworking.models.SecurityPolicyProperties": "Microsoft.ServiceNetworking.SecurityPolicyProperties",
28+
"azure.mgmt.servicenetworking.models.SecurityPolicyUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel",
29+
"azure.mgmt.servicenetworking.models.SecurityPolicyUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties",
30+
"azure.mgmt.servicenetworking.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
31+
"azure.mgmt.servicenetworking.models.TrafficController": "Microsoft.ServiceNetworking.TrafficController",
32+
"azure.mgmt.servicenetworking.models.TrafficControllerProperties": "Microsoft.ServiceNetworking.TrafficControllerProperties",
33+
"azure.mgmt.servicenetworking.models.TrafficControllerUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel",
34+
"azure.mgmt.servicenetworking.models.TrafficControllerUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties",
35+
"azure.mgmt.servicenetworking.models.WafPolicy": "Microsoft.ServiceNetworking.WafPolicy",
36+
"azure.mgmt.servicenetworking.models.WafSecurityPolicy": "Microsoft.ServiceNetworking.WafSecurityPolicy",
37+
"azure.mgmt.servicenetworking.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
38+
"azure.mgmt.servicenetworking.models.AssociationType": "Microsoft.ServiceNetworking.AssociationType",
39+
"azure.mgmt.servicenetworking.models.ProvisioningState": "Microsoft.ServiceNetworking.ProvisioningState",
40+
"azure.mgmt.servicenetworking.models.PolicyType": "Microsoft.ServiceNetworking.PolicyType",
41+
"azure.mgmt.servicenetworking.models.IpAccessRuleAction": "Microsoft.ServiceNetworking.IpAccessRuleAction",
42+
"azure.mgmt.servicenetworking.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
43+
"azure.mgmt.servicenetworking.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
44+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.associations_interface.get": "Microsoft.ServiceNetworking.AssociationsInterface.get",
45+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.associations_interface.begin_create_or_update": "Microsoft.ServiceNetworking.AssociationsInterface.createOrUpdate",
46+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.associations_interface.update": "Microsoft.ServiceNetworking.AssociationsInterface.update",
47+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.associations_interface.begin_delete": "Microsoft.ServiceNetworking.AssociationsInterface.delete",
48+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.associations_interface.list_by_traffic_controller": "Microsoft.ServiceNetworking.AssociationsInterface.listByTrafficController",
49+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.frontends_interface.get": "Microsoft.ServiceNetworking.FrontendsInterface.get",
50+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.frontends_interface.begin_create_or_update": "Microsoft.ServiceNetworking.FrontendsInterface.createOrUpdate",
51+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.frontends_interface.update": "Microsoft.ServiceNetworking.FrontendsInterface.update",
52+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.frontends_interface.begin_delete": "Microsoft.ServiceNetworking.FrontendsInterface.delete",
53+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.frontends_interface.list_by_traffic_controller": "Microsoft.ServiceNetworking.FrontendsInterface.listByTrafficController",
54+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.security_policies_interface.get": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.get",
55+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.security_policies_interface.begin_create_or_update": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.createOrUpdate",
56+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.security_policies_interface.update": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.update",
57+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.security_policies_interface.begin_delete": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.delete",
58+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.security_policies_interface.list_by_traffic_controller": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.listByTrafficController",
59+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.traffic_controller_interface.get": "Microsoft.ServiceNetworking.TrafficControllerInterface.get",
60+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.traffic_controller_interface.begin_create_or_update": "Microsoft.ServiceNetworking.TrafficControllerInterface.createOrUpdate",
61+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.traffic_controller_interface.update": "Microsoft.ServiceNetworking.TrafficControllerInterface.update",
62+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.traffic_controller_interface.begin_delete": "Microsoft.ServiceNetworking.TrafficControllerInterface.delete",
63+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.traffic_controller_interface.list_by_resource_group": "Microsoft.ServiceNetworking.TrafficControllerInterface.listByResourceGroup",
64+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.traffic_controller_interface.list_by_subscription": "Microsoft.ServiceNetworking.TrafficControllerInterface.listBySubscription",
65+
"azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.operations.list": "Azure.ResourceManager.Operations.list"
66+
}
67+
}

sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_client.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
1111
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1516
from azure.mgmt.core import ARMPipelineClient
1617
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1719

1820
from ._configuration import ServiceNetworkingMgmtClientConfiguration
1921
from ._serialization import Deserializer, Serializer
@@ -50,26 +52,33 @@ class ServiceNetworkingMgmtClient:
5052
:type credential: ~azure.core.credentials.TokenCredential
5153
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5254
:type subscription_id: str
53-
:param base_url: Service host. Default value is "https://management.azure.com".
55+
:param base_url: Service host. Default value is None.
5456
:type base_url: str
55-
:keyword api_version: The API version to use for this operation. Default value is "2025-01-01".
56-
Note that overriding this default value may result in unsupported behavior.
57+
:keyword api_version: The API version to use for this operation. Default value is
58+
"2025-03-01-preview". Note that overriding this default value may result in unsupported
59+
behavior.
5760
:paramtype api_version: str
5861
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
5962
Retry-After header is present.
6063
"""
6164

6265
def __init__(
63-
self,
64-
credential: "TokenCredential",
65-
subscription_id: str,
66-
base_url: str = "https://management.azure.com",
67-
**kwargs: Any
66+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
6867
) -> None:
6968
_endpoint = "{endpoint}"
69+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
70+
_endpoints = get_arm_endpoints(_cloud)
71+
if not base_url:
72+
base_url = _endpoints["resource_manager"]
73+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
7074
self._config = ServiceNetworkingMgmtClientConfiguration(
71-
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
75+
credential=credential,
76+
subscription_id=subscription_id,
77+
base_url=cast(str, base_url),
78+
credential_scopes=credential_scopes,
79+
**kwargs
7280
)
81+
7382
_policies = kwargs.pop("policies", None)
7483
if _policies is None:
7584
_policies = [
@@ -88,7 +97,7 @@ def __init__(
8897
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
8998
self._config.http_logging_policy,
9099
]
91-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
100+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
92101

93102
self._serialize = Serializer()
94103
self._deserialize = Deserializer()

sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_configuration.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ class ServiceNetworkingMgmtClientConfiguration: # pylint: disable=too-many-inst
2929
:type subscription_id: str
3030
:param base_url: Service host. Default value is "https://management.azure.com".
3131
:type base_url: str
32-
:keyword api_version: The API version to use for this operation. Default value is "2025-01-01".
33-
Note that overriding this default value may result in unsupported behavior.
32+
:keyword api_version: The API version to use for this operation. Default value is
33+
"2025-03-01-preview". Note that overriding this default value may result in unsupported
34+
behavior.
3435
:paramtype api_version: str
3536
"""
3637

@@ -41,7 +42,7 @@ def __init__(
4142
base_url: str = "https://management.azure.com",
4243
**kwargs: Any
4344
) -> None:
44-
api_version: str = kwargs.pop("api_version", "2025-01-01")
45+
api_version: str = kwargs.pop("api_version", "2025-03-01-preview")
4546

4647
if credential is None:
4748
raise ValueError("Parameter 'credential' must not be None.")

0 commit comments

Comments
 (0)