Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[AutoPR dns/resource-manager] Adding changes to support Private DNS Public Preview #2132

Merged
merged 5 commits into from
Mar 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure-mgmt-dns/azure/mgmt/dns/dns_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(
self._client = ServiceClient(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2017-10-01'
self.api_version = '2018-03-01-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
4 changes: 4 additions & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
from .caa_record import CaaRecord
from .record_set import RecordSet
from .record_set_update_parameters import RecordSetUpdateParameters
from .sub_resource import SubResource
from .zone import Zone
from .zone_update import ZoneUpdate
from .resource import Resource
from .record_set_paged import RecordSetPaged
from .zone_paged import ZonePaged
from .dns_management_client_enums import (
ZoneType,
RecordType,
)

Expand All @@ -43,10 +45,12 @@
'CaaRecord',
'RecordSet',
'RecordSetUpdateParameters',
'SubResource',
'Zone',
'ZoneUpdate',
'Resource',
'RecordSetPaged',
'ZonePaged',
'ZoneType',
'RecordType',
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
from enum import Enum


class ZoneType(Enum):

public = "Public"
private = "Private"


class RecordType(Enum):

a = "A"
Expand Down
28 changes: 28 additions & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/sub_resource.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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 msrest.serialization import Model


class SubResource(Model):
"""A reference to a another resource.

:param id: Resource Id.
:type id: str
"""

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
}

def __init__(self, id=None):
super(SubResource, self).__init__()
self.id = id
21 changes: 20 additions & 1 deletion azure-mgmt-dns/azure/mgmt/dns/models/zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ class Zone(Resource):
:ivar name_servers: The name servers for this DNS zone. This is a
read-only property and any attempt to set this value will be ignored.
:vartype name_servers: list[str]
:param zone_type: The type of this DNS zone (Public or Private). Possible
values include: 'Public', 'Private'. Default value: "Public" .
:type zone_type: str or ~azure.mgmt.dns.models.ZoneType
:param registration_virtual_networks: A list of references to virtual
networks that register hostnames in this DNS zone. This is a only when
ZoneType is Private.
:type registration_virtual_networks:
list[~azure.mgmt.dns.models.SubResource]
:param resolution_virtual_networks: A list of references to virtual
networks that resolve records in this DNS zone. This is a only when
ZoneType is Private.
:type resolution_virtual_networks:
list[~azure.mgmt.dns.models.SubResource]
"""

_validation = {
Expand All @@ -63,11 +76,17 @@ class Zone(Resource):
'max_number_of_record_sets': {'key': 'properties.maxNumberOfRecordSets', 'type': 'long'},
'number_of_record_sets': {'key': 'properties.numberOfRecordSets', 'type': 'long'},
'name_servers': {'key': 'properties.nameServers', 'type': '[str]'},
'zone_type': {'key': 'properties.zoneType', 'type': 'ZoneType'},
'registration_virtual_networks': {'key': 'properties.registrationVirtualNetworks', 'type': '[SubResource]'},
'resolution_virtual_networks': {'key': 'properties.resolutionVirtualNetworks', 'type': '[SubResource]'},
}

def __init__(self, location, tags=None, etag=None):
def __init__(self, location, tags=None, etag=None, zone_type="Public", registration_virtual_networks=None, resolution_virtual_networks=None):
super(Zone, self).__init__(location=location, tags=tags)
self.etag = etag
self.max_number_of_record_sets = None
self.number_of_record_sets = None
self.name_servers = None
self.zone_type = zone_type
self.registration_virtual_networks = registration_virtual_networks
self.resolution_virtual_networks = resolution_virtual_networks
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RecordSetsOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: Specifies the API version. Constant value: "2017-10-01".
:ivar api_version: Specifies the API version. Constant value: "2018-03-01-preview".
"""

models = models
Expand All @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2017-10-01"
self.api_version = "2018-03-01-preview"

self.config = config

Expand Down
4 changes: 2 additions & 2 deletions azure-mgmt-dns/azure/mgmt/dns/operations/zones_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ZonesOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: Specifies the API version. Constant value: "2017-10-01".
:ivar api_version: Specifies the API version. Constant value: "2018-03-01-preview".
"""

models = models
Expand All @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2017-10-01"
self.api_version = "2018-03-01-preview"

self.config = config

Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-dns/azure/mgmt/dns/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "2017-10-01"
VERSION = "2018-03-01-preview"

Loading