Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[AutoPR] dns/resource-manager #2110

Merged
merged 7 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
15 changes: 15 additions & 0 deletions azure-mgmt-dns/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
Release History
===============

2.0.0rc1 (2018-03-14)
+++++++++++++++++++++

**Features**

- Add public/private zone
- Add record_sets.list_all_by_dns_zone operation
- Add zones.update operation

**Breaking changes**

- 'zone_type' is now required when creating a zone ('Public' is equivalent as previous behavior)

New API version 2018-03-01-preview

1.2.0 (2017-10-26)
++++++++++++++++++

Expand Down
6 changes: 3 additions & 3 deletions azure-mgmt-dns/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the Microsoft Azure DNS Management Client Library.
Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.3, 3.4, 3.5 and 3.6.
This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down Expand Up @@ -37,8 +37,8 @@ Usage
=====

For code examples, see `DNS Management
<https://azure-sdk-for-python.readthedocs.org/en/latest/sample_azure-mgmt-dns.html>`__
on readthedocs.org.
<https://docs.microsoft.com/python/api/overview/azure/dns>`__
on docs.microsoft.com.


Provide Feedback
Expand Down
4 changes: 2 additions & 2 deletions azure-mgmt-dns/azure/mgmt/dns/dns_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(

super(DnsManagementClientConfiguration, self).__init__(base_url)

self.add_user_agent('dnsmanagementclient/{}'.format(VERSION))
self.add_user_agent('azure-mgmt-dns/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
Expand Down 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-09-01'
self.api_version = '2018-03-01-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
6 changes: 6 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,11 +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 @@ -42,9 +45,12 @@
'CaaRecord',
'RecordSet',
'RecordSetUpdateParameters',
'SubResource',
'Zone',
'ZoneUpdate',
'Resource',
'RecordSetPaged',
'ZonePaged',
'ZoneType',
'RecordType',
]
1 change: 1 addition & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/aaaa_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ class AaaaRecord(Model):
}

def __init__(self, ipv6_address=None):
super(AaaaRecord, self).__init__()
self.ipv6_address = ipv6_address
1 change: 1 addition & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/arecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ class ARecord(Model):
}

def __init__(self, ipv4_address=None):
super(ARecord, self).__init__()
self.ipv4_address = ipv4_address
1 change: 1 addition & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/caa_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class CaaRecord(Model):
}

def __init__(self, flags=None, tag=None, value=None):
super(CaaRecord, self).__init__()
self.flags = flags
self.tag = tag
self.value = value
1 change: 1 addition & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/cname_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ class CnameRecord(Model):
}

def __init__(self, cname=None):
super(CnameRecord, self).__init__()
self.cname = cname
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
1 change: 1 addition & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/mx_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ class MxRecord(Model):
}

def __init__(self, preference=None, exchange=None):
super(MxRecord, self).__init__()
self.preference = preference
self.exchange = exchange
1 change: 1 addition & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/ns_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ class NsRecord(Model):
}

def __init__(self, nsdname=None):
super(NsRecord, self).__init__()
self.nsdname = nsdname
1 change: 1 addition & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/ptr_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ class PtrRecord(Model):
}

def __init__(self, ptrdname=None):
super(PtrRecord, self).__init__()
self.ptrdname = ptrdname
1 change: 1 addition & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/record_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class RecordSet(Model):
}

def __init__(self, etag=None, metadata=None, ttl=None, arecords=None, aaaa_records=None, mx_records=None, ns_records=None, ptr_records=None, srv_records=None, txt_records=None, cname_record=None, soa_record=None, caa_records=None):
super(RecordSet, self).__init__()
self.id = None
self.name = None
self.type = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ class RecordSetUpdateParameters(Model):
}

def __init__(self, record_set=None):
super(RecordSetUpdateParameters, self).__init__()
self.record_set = record_set
1 change: 1 addition & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Resource(Model):
}

def __init__(self, location, tags=None):
super(Resource, self).__init__()
self.id = None
self.name = None
self.type = None
Expand Down
1 change: 1 addition & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/soa_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class SoaRecord(Model):
}

def __init__(self, host=None, email=None, serial_number=None, refresh_time=None, retry_time=None, expire_time=None, minimum_ttl=None):
super(SoaRecord, self).__init__()
self.host = host
self.email = email
self.serial_number = serial_number
Expand Down
1 change: 1 addition & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/srv_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class SrvRecord(Model):
}

def __init__(self, priority=None, weight=None, port=None, target=None):
super(SrvRecord, self).__init__()
self.priority = priority
self.weight = weight
self.port = port
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
1 change: 1 addition & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/txt_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ class TxtRecord(Model):
}

def __init__(self, value=None):
super(TxtRecord, self).__init__()
self.value = value
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
28 changes: 28 additions & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/zone_update.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 ZoneUpdate(Model):
"""Describes a request to update a DNS zone.

:param tags: Resource tags.
:type tags: dict[str, str]
"""

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

def __init__(self, tags=None):
super(ZoneUpdate, self).__init__()
self.tags = tags
Loading