diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/_meta.json b/sdk/servicenetworking/azure-mgmt-servicenetworking/_meta.json index 880904580bed..604db6c19c01 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/_meta.json +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/_meta.json @@ -1,6 +1,6 @@ { - "commit": "16eba0e39fedb21b9a7a3df5bec5524c78c72ba3", + "commit": "8f6744026f8f69f599f4713dadf1109f04e23a31", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/servicenetworking/ServiceNetworking.Management", - "@azure-tools/typespec-python": "0.38.1" + "@azure-tools/typespec-python": "0.39.1" } \ No newline at end of file diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/apiview-properties.json b/sdk/servicenetworking/azure-mgmt-servicenetworking/apiview-properties.json new file mode 100644 index 000000000000..882d102bf4c5 --- /dev/null +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/apiview-properties.json @@ -0,0 +1,67 @@ +{ + "CrossLanguagePackageId": "Microsoft.ServiceNetworking", + "CrossLanguageDefinitionId": { + "azure.mgmt.servicenetworking.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.servicenetworking.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.servicenetworking.models.Association": "Microsoft.ServiceNetworking.Association", + "azure.mgmt.servicenetworking.models.AssociationProperties": "Microsoft.ServiceNetworking.AssociationProperties", + "azure.mgmt.servicenetworking.models.AssociationSubnet": "Microsoft.ServiceNetworking.AssociationSubnet", + "azure.mgmt.servicenetworking.models.AssociationSubnetUpdate": "Microsoft.ServiceNetworking.AssociationSubnetUpdate", + "azure.mgmt.servicenetworking.models.AssociationUpdate": "Microsoft.ServiceNetworking.AssociationUpdate", + "azure.mgmt.servicenetworking.models.AssociationUpdateProperties": "Microsoft.ServiceNetworking.AssociationUpdateProperties", + "azure.mgmt.servicenetworking.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.servicenetworking.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.servicenetworking.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.servicenetworking.models.Frontend": "Microsoft.ServiceNetworking.Frontend", + "azure.mgmt.servicenetworking.models.FrontendProperties": "Microsoft.ServiceNetworking.FrontendProperties", + "azure.mgmt.servicenetworking.models.FrontendUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.servicenetworking.models.FrontendUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.servicenetworking.models.IpAccessRule": "Microsoft.ServiceNetworking.IpAccessRule", + "azure.mgmt.servicenetworking.models.IpAccessRulesPolicy": "Microsoft.ServiceNetworking.IpAccessRulesPolicy", + "azure.mgmt.servicenetworking.models.IpAccessRulesSecurityPolicy": "Microsoft.ServiceNetworking.IpAccessRulesSecurityPolicy", + "azure.mgmt.servicenetworking.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.servicenetworking.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.servicenetworking.models.ResourceId": "Microsoft.ServiceNetworking.ResourceId", + "azure.mgmt.servicenetworking.models.SecurityPolicy": "Microsoft.ServiceNetworking.SecurityPolicy", + "azure.mgmt.servicenetworking.models.SecurityPolicyConfigurations": "Microsoft.ServiceNetworking.SecurityPolicyConfigurations", + "azure.mgmt.servicenetworking.models.SecurityPolicyProperties": "Microsoft.ServiceNetworking.SecurityPolicyProperties", + "azure.mgmt.servicenetworking.models.SecurityPolicyUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.servicenetworking.models.SecurityPolicyUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.servicenetworking.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.servicenetworking.models.TrafficController": "Microsoft.ServiceNetworking.TrafficController", + "azure.mgmt.servicenetworking.models.TrafficControllerProperties": "Microsoft.ServiceNetworking.TrafficControllerProperties", + "azure.mgmt.servicenetworking.models.TrafficControllerUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.servicenetworking.models.TrafficControllerUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.servicenetworking.models.WafPolicy": "Microsoft.ServiceNetworking.WafPolicy", + "azure.mgmt.servicenetworking.models.WafSecurityPolicy": "Microsoft.ServiceNetworking.WafSecurityPolicy", + "azure.mgmt.servicenetworking.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.servicenetworking.models.AssociationType": "Microsoft.ServiceNetworking.AssociationType", + "azure.mgmt.servicenetworking.models.ProvisioningState": "Microsoft.ServiceNetworking.ProvisioningState", + "azure.mgmt.servicenetworking.models.PolicyType": "Microsoft.ServiceNetworking.PolicyType", + "azure.mgmt.servicenetworking.models.IpAccessRuleAction": "Microsoft.ServiceNetworking.IpAccessRuleAction", + "azure.mgmt.servicenetworking.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.servicenetworking.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.associations_interface.get": "Microsoft.ServiceNetworking.AssociationsInterface.get", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.associations_interface.begin_create_or_update": "Microsoft.ServiceNetworking.AssociationsInterface.createOrUpdate", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.associations_interface.update": "Microsoft.ServiceNetworking.AssociationsInterface.update", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.associations_interface.begin_delete": "Microsoft.ServiceNetworking.AssociationsInterface.delete", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.associations_interface.list_by_traffic_controller": "Microsoft.ServiceNetworking.AssociationsInterface.listByTrafficController", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.frontends_interface.get": "Microsoft.ServiceNetworking.FrontendsInterface.get", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.frontends_interface.begin_create_or_update": "Microsoft.ServiceNetworking.FrontendsInterface.createOrUpdate", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.frontends_interface.update": "Microsoft.ServiceNetworking.FrontendsInterface.update", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.frontends_interface.begin_delete": "Microsoft.ServiceNetworking.FrontendsInterface.delete", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.frontends_interface.list_by_traffic_controller": "Microsoft.ServiceNetworking.FrontendsInterface.listByTrafficController", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.security_policies_interface.get": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.get", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.security_policies_interface.begin_create_or_update": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.createOrUpdate", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.security_policies_interface.update": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.update", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.security_policies_interface.begin_delete": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.delete", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.security_policies_interface.list_by_traffic_controller": "Microsoft.ServiceNetworking.SecurityPoliciesInterface.listByTrafficController", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.traffic_controller_interface.get": "Microsoft.ServiceNetworking.TrafficControllerInterface.get", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.traffic_controller_interface.begin_create_or_update": "Microsoft.ServiceNetworking.TrafficControllerInterface.createOrUpdate", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.traffic_controller_interface.update": "Microsoft.ServiceNetworking.TrafficControllerInterface.update", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.traffic_controller_interface.begin_delete": "Microsoft.ServiceNetworking.TrafficControllerInterface.delete", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.traffic_controller_interface.list_by_resource_group": "Microsoft.ServiceNetworking.TrafficControllerInterface.listByResourceGroup", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.traffic_controller_interface.list_by_subscription": "Microsoft.ServiceNetworking.TrafficControllerInterface.listBySubscription", + "azure.mgmt.servicenetworking.ServiceNetworkingMgmtClient.operations.list": "Azure.ResourceManager.Operations.list" + } +} \ No newline at end of file diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_client.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_client.py index 19bd1b7c6960..e8e39e159aec 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_client.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_client.py @@ -52,8 +52,9 @@ class ServiceNetworkingMgmtClient: :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2025-01-01". - Note that overriding this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Default value is + "2025-03-01-preview". Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_configuration.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_configuration.py index a5574d6848ce..6e7414540292 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_configuration.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_configuration.py @@ -29,8 +29,9 @@ class ServiceNetworkingMgmtClientConfiguration: # pylint: disable=too-many-inst :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2025-01-01". - Note that overriding this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Default value is + "2025-03-01-preview". Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -41,7 +42,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-01-01") + api_version: str = kwargs.pop("api_version", "2025-03-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_model_base.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_model_base.py index 7f73b97b23ef..3072ee252ed9 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_model_base.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_model_base.py @@ -373,15 +373,34 @@ def __ne__(self, other: typing.Any) -> bool: return not self.__eq__(other) def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ return self._data.items() def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ try: return self[key] except KeyError: @@ -397,17 +416,38 @@ def pop(self, key: str, default: _T) -> _T: ... def pop(self, key: str, default: typing.Any) -> typing.Any: ... def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ if default is _UNSET: return self._data.pop(key) return self._data.pop(key, default) def popitem(self) -> typing.Tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ return self._data.popitem() def clear(self) -> None: + """ + Remove all items from D. + """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ self._data.update(*args, **kwargs) @typing.overload @@ -417,6 +457,13 @@ def setdefault(self, key: str, default: None = None) -> None: ... def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ if default is _UNSET: return self._data.setdefault(key) return self._data.setdefault(key, default) @@ -910,6 +957,19 @@ def _failsafe_deserialize( return None +def _failsafe_deserialize_xml( + deserializer: typing.Any, + value: typing.Any, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, value) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + class _RestField: def __init__( self, diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_serialization.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_serialization.py index 670738f0789c..7a0232de5ddc 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_serialization.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_serialization.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. @@ -48,9 +48,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, ) @@ -61,13 +59,13 @@ import xml.etree.ElementTree as ET import isodate # type: ignore +from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -384,25 +382,25 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -413,8 +411,8 @@ def from_dict( :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -560,7 +558,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) @@ -670,8 +668,8 @@ def body(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized request body """ @@ -715,8 +713,8 @@ def url(self, name, data, data_type, **kwargs): :param str data_type: The type to be serialized from. :rtype: str :returns: The serialized URL path - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -739,8 +737,8 @@ def query(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized query parameter """ try: @@ -769,8 +767,8 @@ def header(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized header """ try: @@ -789,9 +787,9 @@ def serialize_data(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. :returns: The serialized data. :rtype: str, int, float, bool, dict, list """ @@ -1126,7 +1124,7 @@ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. :return: serialized rfc """ try: @@ -1152,7 +1150,7 @@ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. :return: serialized iso """ if isinstance(attr, str): @@ -1185,7 +1183,7 @@ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid :return: serialied unix """ if isinstance(attr, int): @@ -1363,7 +1361,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument # Iter and wrapped, should have found one node only (the wrap one) if len(children) != 1: raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( xml_name ) ) @@ -1422,7 +1420,7 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1436,7 +1434,7 @@ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1651,7 +1649,7 @@ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return- :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1733,7 +1731,7 @@ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return :param dict attr: Dictionary to be deserialized. :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1779,7 +1777,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1870,7 +1868,7 @@ def deserialize_bytearray(attr): :param str attr: response string to be deserialized. :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1883,7 +1881,7 @@ def deserialize_base64(attr): :param str attr: response string to be deserialized. :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1898,7 +1896,7 @@ def deserialize_decimal(attr): :param str attr: response string to be deserialized. :return: Deserialized decimal - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. :rtype: decimal """ if isinstance(attr, ET.Element): @@ -1916,7 +1914,7 @@ def deserialize_long(attr): :param str attr: response string to be deserialized. :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1929,7 +1927,7 @@ def deserialize_duration(attr): :param str attr: response string to be deserialized. :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1947,7 +1945,7 @@ def deserialize_date(attr): :param str attr: response string to be deserialized. :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1963,7 +1961,7 @@ def deserialize_time(attr): :param str attr: response string to be deserialized. :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1978,7 +1976,7 @@ def deserialize_rfc(attr): :param str attr: response string to be deserialized. :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2001,7 +1999,7 @@ def deserialize_iso(attr): :param str attr: response string to be deserialized. :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2039,7 +2037,7 @@ def deserialize_unix(attr): :param int attr: Object to be serialized. :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_version.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_version.py index 8f2350dd3b0c..be71c81bd282 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_version.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_client.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_client.py index 657c56c35d3b..e58fd2bb35f4 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_client.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_client.py @@ -52,8 +52,9 @@ class ServiceNetworkingMgmtClient: :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2025-01-01". - Note that overriding this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Default value is + "2025-03-01-preview". Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_configuration.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_configuration.py index 08554628adc7..8bb56a9b2001 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_configuration.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/_configuration.py @@ -29,8 +29,9 @@ class ServiceNetworkingMgmtClientConfiguration: # pylint: disable=too-many-inst :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2025-01-01". - Note that overriding this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Default value is + "2025-03-01-preview". Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -41,7 +42,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-01-01") + api_version: str = kwargs.pop("api_version", "2025-03-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/__init__.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/__init__.py index 511884b818e4..2e6d3003c183 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/__init__.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/__init__.py @@ -26,6 +26,10 @@ Frontend, FrontendProperties, FrontendUpdate, + FrontendUpdateProperties, + IpAccessRule, + IpAccessRulesPolicy, + IpAccessRulesSecurityPolicy, Operation, OperationDisplay, Resource, @@ -49,6 +53,7 @@ ActionType, AssociationType, CreatedByType, + IpAccessRuleAction, Origin, PolicyType, ProvisioningState, @@ -70,6 +75,10 @@ "Frontend", "FrontendProperties", "FrontendUpdate", + "FrontendUpdateProperties", + "IpAccessRule", + "IpAccessRulesPolicy", + "IpAccessRulesSecurityPolicy", "Operation", "OperationDisplay", "Resource", @@ -90,6 +99,7 @@ "ActionType", "AssociationType", "CreatedByType", + "IpAccessRuleAction", "Origin", "PolicyType", "ProvisioningState", diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_enums.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_enums.py index d024b2fb3980..4cfa90ca8331 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_enums.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_enums.py @@ -39,6 +39,15 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The entity was created by a key.""" +class IpAccessRuleAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Action of Ip Access Rule.""" + + ALLOW = "allow" + """Allow Source Ip Prefixes""" + DENY = "deny" + """Deny Source Ip Prefixes""" + + class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". @@ -57,6 +66,8 @@ class PolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): WAF = "waf" """Policy of Type WAF""" + IP_ACCESS_RULES = "ipAccessRules" + """Policy of Type IpAccessRules""" class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_models.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_models.py index a5657035ac34..25746de88360 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_models.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/models/_models.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -21,10 +21,8 @@ class Resource(_model_base.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -38,7 +36,7 @@ class Resource(_model_base.Model): id: Optional[str] = rest_field(visibility=["read"]) """Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long""" + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" name: Optional[str] = rest_field(visibility=["read"]) """The name of the resource.""" type: Optional[str] = rest_field(visibility=["read"]) @@ -52,11 +50,8 @@ class TrackedResource(Resource): """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -72,7 +67,7 @@ class TrackedResource(Resource): :vartype location: str """ - tags: Optional[Dict[str, str]] = rest_field() + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" location: str = rest_field(visibility=["read", "create"]) """The geo-location where the resource lives. Required.""" @@ -99,11 +94,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Association(TrackedResource): """Association Subresource of Traffic Controller. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -121,7 +113,9 @@ class Association(TrackedResource): :vartype properties: ~azure.mgmt.servicenetworking.models.AssociationProperties """ - properties: Optional["_models.AssociationProperties"] = rest_field() + properties: Optional["_models.AssociationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -147,9 +141,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class AssociationProperties(_model_base.Model): """Association Properties. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar association_type: Association Type. Required. "subnets" :vartype association_type: str or ~azure.mgmt.servicenetworking.models.AssociationType :ivar subnet: Association Subnet. @@ -160,9 +151,13 @@ class AssociationProperties(_model_base.Model): :vartype provisioning_state: str or ~azure.mgmt.servicenetworking.models.ProvisioningState """ - association_type: Union[str, "_models.AssociationType"] = rest_field(name="associationType") + association_type: Union[str, "_models.AssociationType"] = rest_field( + name="associationType", visibility=["read", "create", "update", "delete", "query"] + ) """Association Type. Required. \"subnets\"""" - subnet: Optional["_models.AssociationSubnet"] = rest_field() + subnet: Optional["_models.AssociationSubnet"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Association Subnet.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] @@ -193,12 +188,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class AssociationSubnet(_model_base.Model): """Association Subnet. - :ivar id: Association ID. Required. :vartype id: str """ - id: str = rest_field() + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Association ID. Required.""" @overload @@ -222,20 +216,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class AssociationSubnetUpdate(_model_base.Model): """Association Subnet. - All required parameters must be populated in order to send to server. - - :ivar id: Association ID. Required. + :ivar id: Association ID. :vartype id: str """ - id: str = rest_field() - """Association ID. Required.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Association ID.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -258,9 +250,11 @@ class AssociationUpdate(_model_base.Model): :vartype properties: ~azure.mgmt.servicenetworking.models.AssociationUpdateProperties """ - tags: Optional[Dict[str, str]] = rest_field() + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" - properties: Optional["_models.AssociationUpdateProperties"] = rest_field() + properties: Optional["_models.AssociationUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -291,9 +285,13 @@ class AssociationUpdateProperties(_model_base.Model): :vartype subnet: ~azure.mgmt.servicenetworking.models.AssociationSubnetUpdate """ - association_type: Optional[Union[str, "_models.AssociationType"]] = rest_field(name="associationType") + association_type: Optional[Union[str, "_models.AssociationType"]] = rest_field( + name="associationType", visibility=["read", "create", "update", "delete", "query"] + ) """Association Type. \"subnets\"""" - subnet: Optional["_models.AssociationSubnetUpdate"] = rest_field() + subnet: Optional["_models.AssociationSubnetUpdate"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Association Subnet.""" @overload @@ -318,8 +316,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ErrorAdditionalInfo(_model_base.Model): """The resource management error additional info. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. @@ -335,8 +331,6 @@ class ErrorAdditionalInfo(_model_base.Model): class ErrorDetail(_model_base.Model): """The error detail. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar code: The error code. :vartype code: str :ivar message: The error message. @@ -371,7 +365,7 @@ class ErrorResponse(_model_base.Model): :vartype error: ~azure.mgmt.servicenetworking.models.ErrorDetail """ - error: Optional["_models.ErrorDetail"] = rest_field() + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The error object.""" @overload @@ -395,11 +389,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Frontend(TrackedResource): """Frontend Sub Resource of Traffic Controller. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -417,7 +408,9 @@ class Frontend(TrackedResource): :vartype properties: ~azure.mgmt.servicenetworking.models.FrontendProperties """ - properties: Optional["_models.FrontendProperties"] = rest_field() + properties: Optional["_models.FrontendProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -443,11 +436,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FrontendProperties(_model_base.Model): """Frontend Properties. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar fqdn: The Fully Qualified Domain Name of the DNS record associated to a Traffic Controller frontend. :vartype fqdn: str + :ivar security_policy_configurations: Frontend Security Policy Configuration. + :vartype security_policy_configurations: + ~azure.mgmt.servicenetworking.models.SecurityPolicyConfigurations :ivar provisioning_state: Provisioning State of Traffic Controller Frontend Resource. Known values are: "Provisioning", "Updating", "Deleting", "Accepted", "Succeeded", "Failed", and "Canceled". @@ -456,28 +450,198 @@ class FrontendProperties(_model_base.Model): fqdn: Optional[str] = rest_field(visibility=["read"]) """The Fully Qualified Domain Name of the DNS record associated to a Traffic Controller frontend.""" + security_policy_configurations: Optional["_models.SecurityPolicyConfigurations"] = rest_field( + name="securityPolicyConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """Frontend Security Policy Configuration.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) """Provisioning State of Traffic Controller Frontend Resource. Known values are: \"Provisioning\", \"Updating\", \"Deleting\", \"Accepted\", \"Succeeded\", \"Failed\", and \"Canceled\".""" + @overload + def __init__( + self, + *, + security_policy_configurations: Optional["_models.SecurityPolicyConfigurations"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + class FrontendUpdate(_model_base.Model): """The type used for update operations of the Frontend. :ivar tags: Resource tags. :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.servicenetworking.models.FrontendUpdateProperties """ - tags: Optional[Dict[str, str]] = rest_field() + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" + properties: Optional["_models.FrontendUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" @overload def __init__( self, *, tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.FrontendUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FrontendUpdateProperties(_model_base.Model): + """The updatable properties of the Frontend. + + :ivar security_policy_configurations: Frontend Security Policy Configuration. + :vartype security_policy_configurations: + ~azure.mgmt.servicenetworking.models.SecurityPolicyConfigurations + """ + + security_policy_configurations: Optional["_models.SecurityPolicyConfigurations"] = rest_field( + name="securityPolicyConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """Frontend Security Policy Configuration.""" + + @overload + def __init__( + self, + *, + security_policy_configurations: Optional["_models.SecurityPolicyConfigurations"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpAccessRule(_model_base.Model): + """Ip Access Policy Rules. + + :ivar name: Name of the Ip Access Rule. Required. + :vartype name: str + :ivar priority: The priority of the rule. The value can be between 1 and 500. The priority + number must be unique for each rule in the collection. The lower the priority number, the + higher the priority of the rule. Required. + :vartype priority: int + :ivar source_address_prefixes: Source Address Prefixed Applied by the Rule. Asterisk '*' can + also be used to match all source IPs. Required. + :vartype source_address_prefixes: list[str] + :ivar action: Action of the Rule. Required. Known values are: "allow" and "deny". + :vartype action: str or ~azure.mgmt.servicenetworking.models.IpAccessRuleAction + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the Ip Access Rule. Required.""" + priority: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The priority of the rule. The value can be between 1 and 500. The priority number must be + unique for each rule in the collection. The lower the priority number, the higher the priority + of the rule. Required.""" + source_address_prefixes: List[str] = rest_field( + name="sourceAddressPrefixes", visibility=["read", "create", "update", "delete", "query"] + ) + """Source Address Prefixed Applied by the Rule. Asterisk '*' can also be used to match all source + IPs. Required.""" + action: Union[str, "_models.IpAccessRuleAction"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Action of the Rule. Required. Known values are: \"allow\" and \"deny\".""" + + @overload + def __init__( + self, + *, + name: str, + priority: int, + source_address_prefixes: List[str], + action: Union[str, "_models.IpAccessRuleAction"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpAccessRulesPolicy(_model_base.Model): + """Ip Access Policy. + + :ivar rules: Ip Access Policy Rules List. + :vartype rules: list[~azure.mgmt.servicenetworking.models.IpAccessRule] + """ + + rules: Optional[List["_models.IpAccessRule"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Ip Access Policy Rules List.""" + + @overload + def __init__( + self, + *, + rules: Optional[List["_models.IpAccessRule"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpAccessRulesSecurityPolicy(_model_base.Model): + """IpAccessRules Security Policy. + + :ivar id: Resource ID of the Ip Access Rules Security Policy. Required. + :vartype id: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource ID of the Ip Access Rules Security Policy. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -494,8 +658,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Operation(_model_base.Model): """Details of a REST API operation, returned from the Resource Provider Operations API. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". :vartype name: str @@ -520,7 +682,9 @@ class Operation(_model_base.Model): is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.""" - display: Optional["_models.OperationDisplay"] = rest_field() + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Localized display information for this particular operation.""" origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit @@ -551,8 +715,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OperationDisplay(_model_base.Model): """Localized display information for and operation. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". :vartype provider: str @@ -584,12 +746,11 @@ class OperationDisplay(_model_base.Model): class ResourceId(_model_base.Model): """Resource ID definition used by parent to reference child resources. - :ivar id: Resource ID of child resource. Required. :vartype id: str """ - id: str = rest_field() + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource ID of child resource. Required.""" @overload @@ -613,11 +774,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SecurityPolicy(TrackedResource): """SecurityPolicy Subresource of Traffic Controller. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -635,7 +793,9 @@ class SecurityPolicy(TrackedResource): :vartype properties: ~azure.mgmt.servicenetworking.models.SecurityPolicyProperties """ - properties: Optional["_models.SecurityPolicyProperties"] = rest_field() + properties: Optional["_models.SecurityPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -661,20 +821,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SecurityPolicyConfigurations(_model_base.Model): """SecurityPolicyConfigurations Subresource of Traffic Controller. - :ivar waf_security_policy: Contains reference to a WAF-type security policy that is applied at - the Traffic Controller level. + :ivar waf_security_policy: Contains reference to a WAF-type security policy. :vartype waf_security_policy: ~azure.mgmt.servicenetworking.models.WafSecurityPolicy + :ivar ip_access_rules_security_policy: Contains reference to a IpAccessRules-type security + policy. + :vartype ip_access_rules_security_policy: + ~azure.mgmt.servicenetworking.models.IpAccessRulesSecurityPolicy """ - waf_security_policy: Optional["_models.WafSecurityPolicy"] = rest_field(name="wafSecurityPolicy") - """Contains reference to a WAF-type security policy that is applied at the Traffic Controller - level.""" + waf_security_policy: Optional["_models.WafSecurityPolicy"] = rest_field( + name="wafSecurityPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Contains reference to a WAF-type security policy.""" + ip_access_rules_security_policy: Optional["_models.IpAccessRulesSecurityPolicy"] = rest_field( + name="ipAccessRulesSecurityPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Contains reference to a IpAccessRules-type security policy.""" @overload def __init__( self, *, waf_security_policy: Optional["_models.WafSecurityPolicy"] = None, + ip_access_rules_security_policy: Optional["_models.IpAccessRulesSecurityPolicy"] = None, ) -> None: ... @overload @@ -691,12 +860,15 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SecurityPolicyProperties(_model_base.Model): """SecurityPolicy Properties. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar policy_type: Type of the Traffic Controller Security Policy. "waf" + :ivar policy_type: Type of the Traffic Controller Security Policy. Known values are: "waf" and + "ipAccessRules". :vartype policy_type: str or ~azure.mgmt.servicenetworking.models.PolicyType :ivar waf_policy: Web Application Firewall Policy of the Traffic Controller Security Policy. + Single Security Policy can have only one policy type set. :vartype waf_policy: ~azure.mgmt.servicenetworking.models.WafPolicy + :ivar ip_access_rules_policy: Ip Access Policy of the Traffic Controller Security Policy. + Single Security Policy can have only one policy type set. + :vartype ip_access_rules_policy: ~azure.mgmt.servicenetworking.models.IpAccessRulesPolicy :ivar provisioning_state: Provisioning State of Traffic Controller SecurityPolicy Resource. Known values are: "Provisioning", "Updating", "Deleting", "Accepted", "Succeeded", "Failed", and "Canceled". @@ -704,9 +876,18 @@ class SecurityPolicyProperties(_model_base.Model): """ policy_type: Optional[Union[str, "_models.PolicyType"]] = rest_field(name="policyType", visibility=["read"]) - """Type of the Traffic Controller Security Policy. \"waf\"""" - waf_policy: Optional["_models.WafPolicy"] = rest_field(name="wafPolicy") - """Web Application Firewall Policy of the Traffic Controller Security Policy.""" + """Type of the Traffic Controller Security Policy. Known values are: \"waf\" and + \"ipAccessRules\".""" + waf_policy: Optional["_models.WafPolicy"] = rest_field( + name="wafPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Web Application Firewall Policy of the Traffic Controller Security Policy. Single Security + Policy can have only one policy type set.""" + ip_access_rules_policy: Optional["_models.IpAccessRulesPolicy"] = rest_field( + name="ipAccessRulesPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Ip Access Policy of the Traffic Controller Security Policy. Single Security Policy can have + only one policy type set.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -719,6 +900,7 @@ def __init__( self, *, waf_policy: Optional["_models.WafPolicy"] = None, + ip_access_rules_policy: Optional["_models.IpAccessRulesPolicy"] = None, ) -> None: ... @overload @@ -741,9 +923,11 @@ class SecurityPolicyUpdate(_model_base.Model): :vartype properties: ~azure.mgmt.servicenetworking.models.SecurityPolicyUpdateProperties """ - tags: Optional[Dict[str, str]] = rest_field() + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" - properties: Optional["_models.SecurityPolicyUpdateProperties"] = rest_field() + properties: Optional["_models.SecurityPolicyUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -769,17 +953,30 @@ class SecurityPolicyUpdateProperties(_model_base.Model): """The updatable properties of the SecurityPolicy. :ivar waf_policy: Web Application Firewall Policy of the Traffic Controller Security Policy. + Single Security Policy can have only one policy type set. :vartype waf_policy: ~azure.mgmt.servicenetworking.models.WafPolicy + :ivar ip_access_rules_policy: Ip Access Policy of the Traffic Controller Security Policy. + Single Security Policy can have only one policy type set. + :vartype ip_access_rules_policy: ~azure.mgmt.servicenetworking.models.IpAccessRulesPolicy """ - waf_policy: Optional["_models.WafPolicy"] = rest_field(name="wafPolicy") - """Web Application Firewall Policy of the Traffic Controller Security Policy.""" + waf_policy: Optional["_models.WafPolicy"] = rest_field( + name="wafPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Web Application Firewall Policy of the Traffic Controller Security Policy. Single Security + Policy can have only one policy type set.""" + ip_access_rules_policy: Optional["_models.IpAccessRulesPolicy"] = rest_field( + name="ipAccessRulesPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Ip Access Policy of the Traffic Controller Security Policy. Single Security Policy can have + only one policy type set.""" @overload def __init__( self, *, waf_policy: Optional["_models.WafPolicy"] = None, + ip_access_rules_policy: Optional["_models.IpAccessRulesPolicy"] = None, ) -> None: ... @overload @@ -812,19 +1009,29 @@ class SystemData(_model_base.Model): :vartype last_modified_at: ~datetime.datetime """ - created_by: Optional[str] = rest_field(name="createdBy") + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) """The identity that created the resource.""" - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="createdByType") + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) """The type of identity that created the resource. Known values are: \"User\", \"Application\", \"ManagedIdentity\", and \"Key\".""" - created_at: Optional[datetime.datetime] = rest_field(name="createdAt", format="rfc3339") + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """The timestamp of resource creation (UTC).""" - last_modified_by: Optional[str] = rest_field(name="lastModifiedBy") + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) """The identity that last modified the resource.""" - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="lastModifiedByType") + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) """The type of identity that last modified the resource. Known values are: \"User\", \"Application\", \"ManagedIdentity\", and \"Key\".""" - last_modified_at: Optional[datetime.datetime] = rest_field(name="lastModifiedAt", format="rfc3339") + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """The timestamp of resource last modification (UTC).""" @overload @@ -854,11 +1061,8 @@ class TrafficController(TrackedResource): """Concrete tracked resource types can be created by aliasing this type using a specific property type. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -876,7 +1080,9 @@ class TrafficController(TrackedResource): :vartype properties: ~azure.mgmt.servicenetworking.models.TrafficControllerProperties """ - properties: Optional["_models.TrafficControllerProperties"] = rest_field() + properties: Optional["_models.TrafficControllerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -902,8 +1108,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class TrafficControllerProperties(_model_base.Model): """Traffic Controller Properties. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar configuration_endpoints: Configuration Endpoints. :vartype configuration_endpoints: list[str] :ivar frontends: Frontends References List. @@ -929,7 +1133,7 @@ class TrafficControllerProperties(_model_base.Model): security_policies: Optional[List["_models.ResourceId"]] = rest_field(name="securityPolicies", visibility=["read"]) """Security Policies References List.""" security_policy_configurations: Optional["_models.SecurityPolicyConfigurations"] = rest_field( - name="securityPolicyConfigurations" + name="securityPolicyConfigurations", visibility=["read", "create", "update", "delete", "query"] ) """Security Policy Configuration.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( @@ -965,9 +1169,11 @@ class TrafficControllerUpdate(_model_base.Model): :vartype properties: ~azure.mgmt.servicenetworking.models.TrafficControllerUpdateProperties """ - tags: Optional[Dict[str, str]] = rest_field() + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" - properties: Optional["_models.TrafficControllerUpdateProperties"] = rest_field() + properties: Optional["_models.TrafficControllerUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -998,7 +1204,7 @@ class TrafficControllerUpdateProperties(_model_base.Model): """ security_policy_configurations: Optional["_models.SecurityPolicyConfigurations"] = rest_field( - name="securityPolicyConfigurations" + name="securityPolicyConfigurations", visibility=["read", "create", "update", "delete", "query"] ) """Security Policy Configuration.""" @@ -1023,12 +1229,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class WafPolicy(_model_base.Model): """Web Application Firewall Policy. - :ivar id: Resource ID of the WAF. Required. :vartype id: str """ - id: str = rest_field() + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource ID of the WAF. Required.""" @overload @@ -1052,12 +1257,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class WafSecurityPolicy(_model_base.Model): """Web Application Firewall Security Policy. - :ivar id: Resource ID of the Waf Security Policy. Required. :vartype id: str """ - id: str = rest_field() + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource ID of the Waf Security Policy. Required.""" @overload diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_operations.py index 0a29bfe45b93..203c6dcef545 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_operations.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/operations/_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -56,11 +56,11 @@ def build_associations_interface_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -86,11 +86,11 @@ def build_associations_interface_create_or_update_request( # pylint: disable=na _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -118,11 +118,11 @@ def build_associations_interface_update_request( # pylint: disable=name-too-lon _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -149,11 +149,11 @@ def build_associations_interface_delete_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations/{associationName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -178,11 +178,11 @@ def build_associations_interface_list_by_traffic_controller_request( # pylint: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/associations" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -206,11 +206,11 @@ def build_frontends_interface_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -236,11 +236,11 @@ def build_frontends_interface_create_or_update_request( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -268,11 +268,11 @@ def build_frontends_interface_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -299,11 +299,11 @@ def build_frontends_interface_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends/{frontendName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -328,11 +328,11 @@ def build_frontends_interface_list_by_traffic_controller_request( # pylint: dis _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/frontends" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -360,11 +360,11 @@ def build_security_policies_interface_get_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -394,11 +394,11 @@ def build_security_policies_interface_create_or_update_request( # pylint: disab _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -430,11 +430,11 @@ def build_security_policies_interface_update_request( # pylint: disable=name-to _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -465,11 +465,11 @@ def build_security_policies_interface_delete_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies/{securityPolicyName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -494,11 +494,11 @@ def build_security_policies_interface_list_by_traffic_controller_request( # pyl _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}/securityPolicies" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -522,11 +522,11 @@ def build_traffic_controller_interface_get_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -551,11 +551,11 @@ def build_traffic_controller_interface_create_or_update_request( # pylint: disa _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -582,11 +582,11 @@ def build_traffic_controller_interface_update_request( # pylint: disable=name-t _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -612,11 +612,11 @@ def build_traffic_controller_interface_delete_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers/{trafficControllerName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -640,11 +640,11 @@ def build_traffic_controller_interface_list_by_resource_group_request( # pylint _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceNetworking/trafficControllers" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -667,7 +667,7 @@ def build_traffic_controller_interface_list_by_subscription_request( # pylint: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -691,7 +691,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_delete.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_delete.py index 90a0b30b5b83..a3d7fb6dfc1d 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_delete.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2025-01-01/AssociationDelete.json +# x-ms-original-file: 2025-03-01-preview/AssociationDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_get.py index 8dba22a36cef..52fe3a98f419 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-01-01/AssociationGet.json +# x-ms-original-file: 2025-03-01-preview/AssociationGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_patch.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_patch.py index 1cf5fa486e08..c8fbf1839f04 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_patch.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_patch.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -46,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2025-01-01/AssociationPatch.json +# x-ms-original-file: 2025-03-01-preview/AssociationPatch.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_put.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_put.py index 2bbb5049f047..816a84a78c8e 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_put.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/association_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2025-01-01/AssociationPut.json +# x-ms-original-file: 2025-03-01-preview/AssociationPut.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/associations_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/associations_get.py index 60dc4f9f3a12..8cd1ad19d319 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/associations_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/associations_get.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-01-01/AssociationsGet.json +# x-ms-original-file: 2025-03-01-preview/AssociationsGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_delete.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_delete.py index 981f4ed24cc9..95f8365119d2 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_delete.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2025-01-01/FrontendDelete.json +# x-ms-original-file: 2025-03-01-preview/FrontendDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_get.py index 30ac693aaf8d..eb3580f855b4 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-01-01/FrontendGet.json +# x-ms-original-file: 2025-03-01-preview/FrontendGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_put.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_put.py index 5265f4bfc612..390bdf1a36fc 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_put.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontend_put.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-01-01/FrontendPut.json +# x-ms-original-file: 2025-03-01-preview/FrontendPut.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontends_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontends_get.py index a3550099baf3..00e5667aa269 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontends_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/frontends_get.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-01-01/FrontendsGet.json +# x-ms-original-file: 2025-03-01-preview/FrontendsGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/ip_access_rules_security_policy_patch.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/ip_access_rules_security_policy_patch.py new file mode 100644 index 000000000000..c139621a9342 --- /dev/null +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/ip_access_rules_security_policy_patch.py @@ -0,0 +1,44 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.servicenetworking import ServiceNetworkingMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-servicenetworking +# USAGE + python ip_access_rules_security_policy_patch.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ServiceNetworkingMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.security_policies_interface.update( + resource_group_name="rg1", + traffic_controller_name="tc1", + security_policy_name="sp1", + properties={"properties": {"ipAccessRulesPolicy": {"rules": []}}}, + ) + print(response) + + +# x-ms-original-file: 2025-03-01-preview/IpAccessRulesSecurityPolicyPatch.json +if __name__ == "__main__": + main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/ip_access_rules_security_policy_put.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/ip_access_rules_security_policy_put.py new file mode 100644 index 000000000000..95202ac8bdba --- /dev/null +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/ip_access_rules_security_policy_put.py @@ -0,0 +1,44 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.servicenetworking import ServiceNetworkingMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-servicenetworking +# USAGE + python ip_access_rules_security_policy_put.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ServiceNetworkingMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.security_policies_interface.begin_create_or_update( + resource_group_name="rg1", + traffic_controller_name="tc1", + security_policy_name="sp1", + resource={"location": "NorthCentralUS", "properties": {"ipAccessRulesPolicy": {"rules": []}}}, + ).result() + print(response) + + +# x-ms-original-file: 2025-03-01-preview/IpAccessRulesSecurityPolicyPut.json +if __name__ == "__main__": + main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/operations_list.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/operations_list.py index 5c29ba292e68..ec1ff0af6aad 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/operations_list.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-01-01/OperationsList.json +# x-ms-original-file: 2025-03-01-preview/OperationsList.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policies_get_list.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policies_get_list.py index c19a8861e9c0..a3cda8bc5b7b 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policies_get_list.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policies_get_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-01-01/SecurityPoliciesGetList.json +# x-ms-original-file: 2025-03-01-preview/SecurityPoliciesGetList.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_delete.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_delete.py index de792a814bfa..745dfb83bbfc 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_delete.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2025-01-01/SecurityPolicyDelete.json +# x-ms-original-file: 2025-03-01-preview/SecurityPolicyDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_get.py index cbb8719eed79..e3055f6db25d 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-01-01/SecurityPolicyGet.json +# x-ms-original-file: 2025-03-01-preview/SecurityPolicyGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_delete.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_delete.py index 950779c6202e..0fbe680fd1b4 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_delete.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2025-01-01/TrafficControllerDelete.json +# x-ms-original-file: 2025-03-01-preview/TrafficControllerDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_get.py index e2c97b91a48e..d2bea4d6f838 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-01-01/TrafficControllerGet.json +# x-ms-original-file: 2025-03-01-preview/TrafficControllerGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_patch.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_patch.py index 2773208731d2..93859dcf77f1 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_patch.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-01-01/TrafficControllerPatch.json +# x-ms-original-file: 2025-03-01-preview/TrafficControllerPatch.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_put.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_put.py index 2ad3e045d54e..82eb7cba4a46 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_put.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controller_put.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-01-01/TrafficControllerPut.json +# x-ms-original-file: 2025-03-01-preview/TrafficControllerPut.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get.py index e6d838ff98cf..df7bc1b444a1 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-01-01/TrafficControllersGet.json +# x-ms-original-file: 2025-03-01-preview/TrafficControllersGet.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get_list.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get_list.py index 9d9d1231a46f..b4d87d774c65 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get_list.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/traffic_controllers_get_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-01-01/TrafficControllersGetList.json +# x-ms-original-file: 2025-03-01-preview/TrafficControllersGetList.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_patch.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/waf_security_policy_patch.py similarity index 91% rename from sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_patch.py rename to sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/waf_security_policy_patch.py index 8cd224c5e59d..6394b64f21ca 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_patch.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/waf_security_policy_patch.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -15,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-servicenetworking # USAGE - python security_policy_patch.py + python waf_security_policy_patch.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -45,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2025-01-01/SecurityPolicyPatch.json +# x-ms-original-file: 2025-03-01-preview/WafSecurityPolicyPatch.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_put.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/waf_security_policy_put.py similarity index 91% rename from sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_put.py rename to sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/waf_security_policy_put.py index 789d7cd1e75b..fc98d16fbbb1 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/security_policy_put.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_samples/waf_security_policy_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -15,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-servicenetworking # USAGE - python security_policy_put.py + python waf_security_policy_put.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -46,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2025-01-01/SecurityPolicyPut.json +# x-ms-original-file: 2025-03-01-preview/WafSecurityPolicyPut.json if __name__ == "__main__": main() diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations.py index 6a322e010bac..6b6caaf29e0b 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations.py @@ -41,7 +41,14 @@ def test_frontends_interface_begin_create_or_update(self, resource_group): "location": "str", "id": "str", "name": "str", - "properties": {"fqdn": "str", "provisioningState": "str"}, + "properties": { + "fqdn": "str", + "provisioningState": "str", + "securityPolicyConfigurations": { + "ipAccessRulesSecurityPolicy": {"id": "str"}, + "wafSecurityPolicy": {"id": "str"}, + }, + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -65,7 +72,15 @@ def test_frontends_interface_update(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", frontend_name="str", - properties={"tags": {"str": "str"}}, + properties={ + "properties": { + "securityPolicyConfigurations": { + "ipAccessRulesSecurityPolicy": {"id": "str"}, + "wafSecurityPolicy": {"id": "str"}, + } + }, + "tags": {"str": "str"}, + }, ) # please add some check logic here by yourself diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations_async.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations_async.py index a6501be8bb9e..e16a25decbb2 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations_async.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_frontends_interface_operations_async.py @@ -43,7 +43,14 @@ async def test_frontends_interface_begin_create_or_update(self, resource_group): "location": "str", "id": "str", "name": "str", - "properties": {"fqdn": "str", "provisioningState": "str"}, + "properties": { + "fqdn": "str", + "provisioningState": "str", + "securityPolicyConfigurations": { + "ipAccessRulesSecurityPolicy": {"id": "str"}, + "wafSecurityPolicy": {"id": "str"}, + }, + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -68,7 +75,15 @@ async def test_frontends_interface_update(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", frontend_name="str", - properties={"tags": {"str": "str"}}, + properties={ + "properties": { + "securityPolicyConfigurations": { + "ipAccessRulesSecurityPolicy": {"id": "str"}, + "wafSecurityPolicy": {"id": "str"}, + } + }, + "tags": {"str": "str"}, + }, ) # please add some check logic here by yourself diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations.py index 5cfcff1fef2b..e88f9594870c 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations.py @@ -41,7 +41,14 @@ def test_security_policies_interface_begin_create_or_update(self, resource_group "location": "str", "id": "str", "name": "str", - "properties": {"policyType": "str", "provisioningState": "str", "wafPolicy": {"id": "str"}}, + "properties": { + "ipAccessRulesPolicy": { + "rules": [{"action": "str", "name": "str", "priority": 0, "sourceAddressPrefixes": ["str"]}] + }, + "policyType": "str", + "provisioningState": "str", + "wafPolicy": {"id": "str"}, + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -65,7 +72,15 @@ def test_security_policies_interface_update(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", security_policy_name="str", - properties={"properties": {"wafPolicy": {"id": "str"}}, "tags": {"str": "str"}}, + properties={ + "properties": { + "ipAccessRulesPolicy": { + "rules": [{"action": "str", "name": "str", "priority": 0, "sourceAddressPrefixes": ["str"]}] + }, + "wafPolicy": {"id": "str"}, + }, + "tags": {"str": "str"}, + }, ) # please add some check logic here by yourself diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations_async.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations_async.py index 2d81d8331a1f..98f0db60a123 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations_async.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_security_policies_interface_operations_async.py @@ -43,7 +43,14 @@ async def test_security_policies_interface_begin_create_or_update(self, resource "location": "str", "id": "str", "name": "str", - "properties": {"policyType": "str", "provisioningState": "str", "wafPolicy": {"id": "str"}}, + "properties": { + "ipAccessRulesPolicy": { + "rules": [{"action": "str", "name": "str", "priority": 0, "sourceAddressPrefixes": ["str"]}] + }, + "policyType": "str", + "provisioningState": "str", + "wafPolicy": {"id": "str"}, + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -68,7 +75,15 @@ async def test_security_policies_interface_update(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", security_policy_name="str", - properties={"properties": {"wafPolicy": {"id": "str"}}, "tags": {"str": "str"}}, + properties={ + "properties": { + "ipAccessRulesPolicy": { + "rules": [{"action": "str", "name": "str", "priority": 0, "sourceAddressPrefixes": ["str"]}] + }, + "wafPolicy": {"id": "str"}, + }, + "tags": {"str": "str"}, + }, ) # please add some check logic here by yourself diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations.py index aa8da8b06b0f..ef27cec4fc1c 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations.py @@ -45,7 +45,10 @@ def test_traffic_controller_interface_begin_create_or_update(self, resource_grou "frontends": [{"id": "str"}], "provisioningState": "str", "securityPolicies": [{"id": "str"}], - "securityPolicyConfigurations": {"wafSecurityPolicy": {"id": "str"}}, + "securityPolicyConfigurations": { + "ipAccessRulesSecurityPolicy": {"id": "str"}, + "wafSecurityPolicy": {"id": "str"}, + }, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -70,7 +73,12 @@ def test_traffic_controller_interface_update(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", properties={ - "properties": {"securityPolicyConfigurations": {"wafSecurityPolicy": {"id": "str"}}}, + "properties": { + "securityPolicyConfigurations": { + "ipAccessRulesSecurityPolicy": {"id": "str"}, + "wafSecurityPolicy": {"id": "str"}, + } + }, "tags": {"str": "str"}, }, ) diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations_async.py b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations_async.py index b7dc2b3b0f77..f70fefdc9b4c 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations_async.py +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/generated_tests/test_service_networking_mgmt_traffic_controller_interface_operations_async.py @@ -47,7 +47,10 @@ async def test_traffic_controller_interface_begin_create_or_update(self, resourc "frontends": [{"id": "str"}], "provisioningState": "str", "securityPolicies": [{"id": "str"}], - "securityPolicyConfigurations": {"wafSecurityPolicy": {"id": "str"}}, + "securityPolicyConfigurations": { + "ipAccessRulesSecurityPolicy": {"id": "str"}, + "wafSecurityPolicy": {"id": "str"}, + }, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -73,7 +76,12 @@ async def test_traffic_controller_interface_update(self, resource_group): resource_group_name=resource_group.name, traffic_controller_name="str", properties={ - "properties": {"securityPolicyConfigurations": {"wafSecurityPolicy": {"id": "str"}}}, + "properties": { + "securityPolicyConfigurations": { + "ipAccessRulesSecurityPolicy": {"id": "str"}, + "wafSecurityPolicy": {"id": "str"}, + } + }, "tags": {"str": "str"}, }, ) diff --git a/sdk/servicenetworking/azure-mgmt-servicenetworking/tsp-location.yaml b/sdk/servicenetworking/azure-mgmt-servicenetworking/tsp-location.yaml index b5c99f0b0cc7..1ddd99060de0 100644 --- a/sdk/servicenetworking/azure-mgmt-servicenetworking/tsp-location.yaml +++ b/sdk/servicenetworking/azure-mgmt-servicenetworking/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/servicenetworking/ServiceNetworking.Management -commit: 16eba0e39fedb21b9a7a3df5bec5524c78c72ba3 +commit: 8f6744026f8f69f599f4713dadf1109f04e23a31 repo: Azure/azure-rest-api-specs additionalDirectories: