Skip to content

Commit

Permalink
[AutoPR] network/resource-manager (#4141)
Browse files Browse the repository at this point in the history
* Generated from f4847630d0ac480f6c18a43cc92d3e5798ab14bb (#4133)

Fix duplicate path in old Network API version

* [AutoPR network/resource-manager] Fix errors with ddosCustomPolicy.json (#4143)

* Generated from f786e806eeb7e1217a996e89ba30fb7f230a4b8b

Add ddosCustomPolicy.json to readme.md and fix spec errors

* Generated from dbd13ad4dd6a402b16ce899c7c6915e147405b65

Add ddosCustomPolicy.json to readme.md and fix spec errors

* Generated from dbd13ad4dd6a402b16ce899c7c6915e147405b65

Add ddosCustomPolicy.json to readme.md and fix spec errors

* 2.5.1
  • Loading branch information
AutorestCI authored and lmazuel committed Jan 15, 2019
1 parent 53153e6 commit 84bfbde
Show file tree
Hide file tree
Showing 13 changed files with 765 additions and 68 deletions.
9 changes: 8 additions & 1 deletion azure-mgmt-network/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
Release History
===============

2.5.0 (2018-01-04)
2.5.1 (2019-01-15)
++++++++++++++++++

**Features**

- Add missing ddos_custom_policies operations

2.5.0 (2019-01-04)
++++++++++++++++++

**Features**
Expand Down
13 changes: 13 additions & 0 deletions azure-mgmt-network/azure/mgmt/network/network_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,19 @@ def connection_monitors(self):
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def ddos_custom_policies(self):
"""Instance depends on the API version:
* 2018-11-01: :class:`DdosCustomPoliciesOperations<azure.mgmt.network.v2018_11_01.operations.DdosCustomPoliciesOperations>`
"""
api_version = self._get_api_version('ddos_custom_policies')
if api_version == '2018-11-01':
from .v2018_11_01.operations import DdosCustomPoliciesOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def ddos_protection_plans(self):
"""Instance depends on the API version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,72 +292,6 @@ def get_long_running_output(response):
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'}

def get_shared_key(
self, resource_group_name, connection_shared_key_name, custom_headers=None, raw=False, **operation_config):
"""The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves
information about the specified virtual network gateway connection
shared key through Network resource provider.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param connection_shared_key_name: The virtual network gateway
connection shared key name.
:type connection_shared_key_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: ConnectionSharedKeyResult or ClientRawResponse if raw=true
:rtype:
~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKeyResult or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.get_shared_key.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'connectionSharedKeyName': self._serialize.url("connection_shared_key_name", connection_shared_key_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('ConnectionSharedKeyResult', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{connectionSharedKeyName}/sharedkey'}

def list(
self, resource_group_name, custom_headers=None, raw=False, **operation_config):
"""The List VirtualNetworkGatewayConnections operation retrieves all the
Expand Down Expand Up @@ -641,3 +575,69 @@ def get_long_running_output(response):
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'}

def get_shared_key(
self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config):
"""The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves
information about the specified virtual network gateway connection
shared key through Network resource provider.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param virtual_network_gateway_connection_name: The virtual network
gateway connection shared key name.
:type virtual_network_gateway_connection_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: ConnectionSharedKeyResult or ClientRawResponse if raw=true
:rtype:
~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKeyResult or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.get_shared_key.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
header_parameters.update(custom_headers)
if self.config.accept_language is not None:
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('ConnectionSharedKeyResult', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
from .azure_firewall_py3 import AzureFirewall
from .azure_firewall_fqdn_tag_py3 import AzureFirewallFqdnTag
from .dns_name_availability_result_py3 import DnsNameAvailabilityResult
from .protocol_custom_settings_format_py3 import ProtocolCustomSettingsFormat
from .ddos_custom_policy_py3 import DdosCustomPolicy
from .ddos_protection_plan_py3 import DdosProtectionPlan
from .endpoint_service_result_py3 import EndpointServiceResult
from .express_route_circuit_authorization_py3 import ExpressRouteCircuitAuthorization
Expand Down Expand Up @@ -386,6 +388,8 @@
from .azure_firewall import AzureFirewall
from .azure_firewall_fqdn_tag import AzureFirewallFqdnTag
from .dns_name_availability_result import DnsNameAvailabilityResult
from .protocol_custom_settings_format import ProtocolCustomSettingsFormat
from .ddos_custom_policy import DdosCustomPolicy
from .ddos_protection_plan import DdosProtectionPlan
from .endpoint_service_result import EndpointServiceResult
from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization
Expand Down Expand Up @@ -669,6 +673,8 @@
AzureFirewallApplicationRuleProtocolType,
AzureFirewallNatRCActionType,
AzureFirewallNetworkRuleProtocol,
DdosCustomPolicyProtocol,
DdosCustomPolicyTriggerSensitivityOverride,
AuthorizationUseStatus,
ExpressRouteCircuitPeeringAdvertisedPublicPrefixState,
Access,
Expand Down Expand Up @@ -827,6 +833,8 @@
'AzureFirewall',
'AzureFirewallFqdnTag',
'DnsNameAvailabilityResult',
'ProtocolCustomSettingsFormat',
'DdosCustomPolicy',
'DdosProtectionPlan',
'EndpointServiceResult',
'ExpressRouteCircuitAuthorization',
Expand Down Expand Up @@ -1109,6 +1117,8 @@
'AzureFirewallApplicationRuleProtocolType',
'AzureFirewallNatRCActionType',
'AzureFirewallNetworkRuleProtocol',
'DdosCustomPolicyProtocol',
'DdosCustomPolicyTriggerSensitivityOverride',
'AuthorizationUseStatus',
'ExpressRouteCircuitPeeringAdvertisedPublicPrefixState',
'Access',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource


class DdosCustomPolicy(Resource):
"""A DDoS custom policy in a resource group.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Resource location.
:type location: str
:param tags: Resource tags.
:type tags: dict[str, str]
:ivar resource_guid: The resource GUID property of the DDoS custom policy
resource. It uniquely identifies the resource, even if the user changes
its name or migrate the resource across subscriptions or resource groups.
:vartype resource_guid: str
:ivar provisioning_state: The provisioning state of the DDoS custom policy
resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and
'Failed'.
:vartype provisioning_state: str
:ivar public_ip_addresses: The list of public IPs associated with the DDoS
custom policy resource. This list is read-only.
:vartype public_ip_addresses:
list[~azure.mgmt.network.v2018_11_01.models.SubResource]
:param protocol_custom_settings: The protocol-specific DDoS policy
customization parameters.
:type protocol_custom_settings:
list[~azure.mgmt.network.v2018_11_01.models.ProtocolCustomSettingsFormat]
:ivar etag: A unique read-only string that changes whenever the resource
is updated.
:vartype etag: str
"""

_validation = {
'name': {'readonly': True},
'type': {'readonly': True},
'resource_guid': {'readonly': True},
'provisioning_state': {'readonly': True},
'public_ip_addresses': {'readonly': True},
'etag': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[SubResource]'},
'protocol_custom_settings': {'key': 'properties.protocolCustomSettings', 'type': '[ProtocolCustomSettingsFormat]'},
'etag': {'key': 'etag', 'type': 'str'},
}

def __init__(self, **kwargs):
super(DdosCustomPolicy, self).__init__(**kwargs)
self.resource_guid = None
self.provisioning_state = None
self.public_ip_addresses = None
self.protocol_custom_settings = kwargs.get('protocol_custom_settings', None)
self.etag = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .resource_py3 import Resource


class DdosCustomPolicy(Resource):
"""A DDoS custom policy in a resource group.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Resource location.
:type location: str
:param tags: Resource tags.
:type tags: dict[str, str]
:ivar resource_guid: The resource GUID property of the DDoS custom policy
resource. It uniquely identifies the resource, even if the user changes
its name or migrate the resource across subscriptions or resource groups.
:vartype resource_guid: str
:ivar provisioning_state: The provisioning state of the DDoS custom policy
resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and
'Failed'.
:vartype provisioning_state: str
:ivar public_ip_addresses: The list of public IPs associated with the DDoS
custom policy resource. This list is read-only.
:vartype public_ip_addresses:
list[~azure.mgmt.network.v2018_11_01.models.SubResource]
:param protocol_custom_settings: The protocol-specific DDoS policy
customization parameters.
:type protocol_custom_settings:
list[~azure.mgmt.network.v2018_11_01.models.ProtocolCustomSettingsFormat]
:ivar etag: A unique read-only string that changes whenever the resource
is updated.
:vartype etag: str
"""

_validation = {
'name': {'readonly': True},
'type': {'readonly': True},
'resource_guid': {'readonly': True},
'provisioning_state': {'readonly': True},
'public_ip_addresses': {'readonly': True},
'etag': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[SubResource]'},
'protocol_custom_settings': {'key': 'properties.protocolCustomSettings', 'type': '[ProtocolCustomSettingsFormat]'},
'etag': {'key': 'etag', 'type': 'str'},
}

def __init__(self, *, id: str=None, location: str=None, tags=None, protocol_custom_settings=None, **kwargs) -> None:
super(DdosCustomPolicy, self).__init__(id=id, location=location, tags=tags, **kwargs)
self.resource_guid = None
self.provisioning_state = None
self.public_ip_addresses = None
self.protocol_custom_settings = protocol_custom_settings
self.etag = None
Loading

0 comments on commit 84bfbde

Please sign in to comment.