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] cdn/resource-manager #3184

Merged
merged 10 commits into from
Mar 6, 2019
11 changes: 9 additions & 2 deletions azure-mgmt-cdn/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
Release History
===============

3.1.0 (2019-03-05)
++++++++++++++++++

**Features**

- Add custom_domain_https_parameters support

3.0.0 (2018-05-25)
++++++++++++++++++

Expand Down Expand Up @@ -31,7 +38,7 @@ This version uses a next-generation code generator that *might* introduce breaki

- Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same.
- Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used.
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`.
- New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`,
the response of the initial call will be returned without polling.
Expand Down Expand Up @@ -68,7 +75,7 @@ Api version changed from 2016-10-02 to 2017-04-02
**Breaking changes**

- Rename check_resource_usage to list_resource_usage
- list EdgeNode now returns an iterator of EdgeNode,
- list EdgeNode now returns an iterator of EdgeNode,
not a EdgenodeResult instance with an attribute "value" being a list of EdgeNode

0.30.3 (2017-05-15)
Expand Down
4 changes: 4 additions & 0 deletions azure-mgmt-cdn/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
recursive-include tests *.py *.yaml
include *.rst
include azure/__init__.py
include azure/mgmt/__init__.py

22 changes: 3 additions & 19 deletions azure-mgmt-cdn/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see
For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Compatibility
=============

**IMPORTANT**: If you have an earlier version of the azure package
(version < 1.0), you should uninstall it before installing this package.

You can check the version using pip:

.. code:: shell

pip freeze

If you see azure==0.11.0 (or any version below 1.0), uninstall it first:

.. code:: shell

pip uninstall azure


Usage
=====

Expand All @@ -47,3 +28,6 @@ Provide Feedback
If you encounter any bugs or have suggestions, please file an issue in the
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
section of the project.


.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-cdn%2FREADME.png
18 changes: 9 additions & 9 deletions azure-mgmt-cdn/azure/mgmt/cdn/cdn_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def check_name_availability(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
Expand All @@ -155,9 +156,8 @@ def check_name_availability(
body_content = self._serialize.body(check_name_availability_input, 'CheckNameAvailabilityInput')

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

if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
Expand Down Expand Up @@ -207,6 +207,7 @@ def check_name_availability_with_subscription(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
Expand All @@ -219,9 +220,8 @@ def check_name_availability_with_subscription(
body_content = self._serialize.body(check_name_availability_input, 'CheckNameAvailabilityInput')

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

if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
Expand Down Expand Up @@ -274,6 +274,7 @@ def validate_probe(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
Expand All @@ -286,9 +287,8 @@ def validate_probe(
body_content = self._serialize.body(validate_probe_input, 'ValidateProbeInput')

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

if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
Expand Down
19 changes: 19 additions & 0 deletions azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
from .origin_update_parameters_py3 import OriginUpdateParameters
from .custom_domain_py3 import CustomDomain
from .custom_domain_parameters_py3 import CustomDomainParameters
from .custom_domain_https_parameters_py3 import CustomDomainHttpsParameters
from .cdn_certificate_source_parameters_py3 import CdnCertificateSourceParameters
from .cdn_managed_https_parameters_py3 import CdnManagedHttpsParameters
from .key_vault_certificate_source_parameters_py3 import KeyVaultCertificateSourceParameters
from .user_managed_https_parameters_py3 import UserManagedHttpsParameters
from .validate_custom_domain_input_py3 import ValidateCustomDomainInput
from .validate_custom_domain_output_py3 import ValidateCustomDomainOutput
from .check_name_availability_input_py3 import CheckNameAvailabilityInput
Expand Down Expand Up @@ -77,6 +82,11 @@
from .origin_update_parameters import OriginUpdateParameters
from .custom_domain import CustomDomain
from .custom_domain_parameters import CustomDomainParameters
from .custom_domain_https_parameters import CustomDomainHttpsParameters
from .cdn_certificate_source_parameters import CdnCertificateSourceParameters
from .cdn_managed_https_parameters import CdnManagedHttpsParameters
from .key_vault_certificate_source_parameters import KeyVaultCertificateSourceParameters
from .user_managed_https_parameters import UserManagedHttpsParameters
from .validate_custom_domain_input import ValidateCustomDomainInput
from .validate_custom_domain_output import ValidateCustomDomainOutput
from .check_name_availability_input import CheckNameAvailabilityInput
Expand Down Expand Up @@ -111,6 +121,8 @@
CustomDomainResourceState,
CustomHttpsProvisioningState,
CustomHttpsProvisioningSubstate,
ProtocolType,
CertificateType,
ResourceType,
)

Expand Down Expand Up @@ -140,6 +152,11 @@
'OriginUpdateParameters',
'CustomDomain',
'CustomDomainParameters',
'CustomDomainHttpsParameters',
'CdnCertificateSourceParameters',
'CdnManagedHttpsParameters',
'KeyVaultCertificateSourceParameters',
'UserManagedHttpsParameters',
'ValidateCustomDomainInput',
'ValidateCustomDomainOutput',
'CheckNameAvailabilityInput',
Expand Down Expand Up @@ -173,5 +190,7 @@
'CustomDomainResourceState',
'CustomHttpsProvisioningState',
'CustomHttpsProvisioningSubstate',
'ProtocolType',
'CertificateType',
'ResourceType',
]
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CacheExpirationActionParameters(Model):
:ivar cache_type: Required. The level at which the content needs to be
cached. Default value: "All" .
:vartype cache_type: str
:param cache_duration: The duration for which the the content needs to be
:param cache_duration: The duration for which the content needs to be
cached. Allowed format is [d.]hh:mm:ss
:type cache_duration: str
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CacheExpirationActionParameters(Model):
:ivar cache_type: Required. The level at which the content needs to be
cached. Default value: "All" .
:vartype cache_type: str
:param cache_duration: The duration for which the the content needs to be
:param cache_duration: The duration for which the content needs to be
cached. Allowed format is [d.]hh:mm:ss
:type cache_duration: str
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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 CdnCertificateSourceParameters(Model):
"""Defines the parameters for using CDN managed certificate for securing
custom domain.

Variables are only populated by the server, and will be ignored when
sending a request.

All required parameters must be populated in order to send to Azure.

:ivar odatatype: Required. Default value:
"#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters" .
:vartype odatatype: str
:param certificate_type: Required. Type of certificate used. Possible
values include: 'Shared', 'Dedicated'
:type certificate_type: str or ~azure.mgmt.cdn.models.CertificateType
"""

_validation = {
'odatatype': {'required': True, 'constant': True},
'certificate_type': {'required': True},
}

_attribute_map = {
'odatatype': {'key': '@odata\\.type', 'type': 'str'},
'certificate_type': {'key': 'certificateType', 'type': 'str'},
}

odatatype = "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters"

def __init__(self, **kwargs):
super(CdnCertificateSourceParameters, self).__init__(**kwargs)
self.certificate_type = kwargs.get('certificate_type', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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 CdnCertificateSourceParameters(Model):
"""Defines the parameters for using CDN managed certificate for securing
custom domain.

Variables are only populated by the server, and will be ignored when
sending a request.

All required parameters must be populated in order to send to Azure.

:ivar odatatype: Required. Default value:
"#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters" .
:vartype odatatype: str
:param certificate_type: Required. Type of certificate used. Possible
values include: 'Shared', 'Dedicated'
:type certificate_type: str or ~azure.mgmt.cdn.models.CertificateType
"""

_validation = {
'odatatype': {'required': True, 'constant': True},
'certificate_type': {'required': True},
}

_attribute_map = {
'odatatype': {'key': '@odata\\.type', 'type': 'str'},
'certificate_type': {'key': 'certificateType', 'type': 'str'},
}

odatatype = "#Microsoft.Azure.Cdn.Models.CdnCertificateSourceParameters"

def __init__(self, *, certificate_type, **kwargs) -> None:
super(CdnCertificateSourceParameters, self).__init__(**kwargs)
self.certificate_type = certificate_type
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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 .custom_domain_https_parameters import CustomDomainHttpsParameters


class CdnManagedHttpsParameters(CustomDomainHttpsParameters):
"""Defines the certificate source parameters using CDN managed certificate for
enabling SSL.

All required parameters must be populated in order to send to Azure.

:param protocol_type: Required. Defines the TLS extension protocol that is
used for secure delivery. Possible values include: 'ServerNameIndication',
'IPBased'
:type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType
:param certificate_source: Required. Constant filled by server.
:type certificate_source: str
:param certificate_source_parameters: Required. Defines the certificate
source parameters using CDN managed certificate for enabling SSL.
:type certificate_source_parameters:
~azure.mgmt.cdn.models.CdnCertificateSourceParameters
"""

_validation = {
'protocol_type': {'required': True},
'certificate_source': {'required': True},
'certificate_source_parameters': {'required': True},
}

_attribute_map = {
'protocol_type': {'key': 'protocolType', 'type': 'str'},
'certificate_source': {'key': 'certificateSource', 'type': 'str'},
'certificate_source_parameters': {'key': 'certificateSourceParameters', 'type': 'CdnCertificateSourceParameters'},
}

def __init__(self, **kwargs):
super(CdnManagedHttpsParameters, self).__init__(**kwargs)
self.certificate_source_parameters = kwargs.get('certificate_source_parameters', None)
self.certificate_source = 'Cdn'
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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 .custom_domain_https_parameters_py3 import CustomDomainHttpsParameters


class CdnManagedHttpsParameters(CustomDomainHttpsParameters):
"""Defines the certificate source parameters using CDN managed certificate for
enabling SSL.

All required parameters must be populated in order to send to Azure.

:param protocol_type: Required. Defines the TLS extension protocol that is
used for secure delivery. Possible values include: 'ServerNameIndication',
'IPBased'
:type protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType
:param certificate_source: Required. Constant filled by server.
:type certificate_source: str
:param certificate_source_parameters: Required. Defines the certificate
source parameters using CDN managed certificate for enabling SSL.
:type certificate_source_parameters:
~azure.mgmt.cdn.models.CdnCertificateSourceParameters
"""

_validation = {
'protocol_type': {'required': True},
'certificate_source': {'required': True},
'certificate_source_parameters': {'required': True},
}

_attribute_map = {
'protocol_type': {'key': 'protocolType', 'type': 'str'},
'certificate_source': {'key': 'certificateSource', 'type': 'str'},
'certificate_source_parameters': {'key': 'certificateSourceParameters', 'type': 'CdnCertificateSourceParameters'},
}

def __init__(self, *, protocol_type, certificate_source_parameters, **kwargs) -> None:
super(CdnManagedHttpsParameters, self).__init__(protocol_type=protocol_type, **kwargs)
self.certificate_source_parameters = certificate_source_parameters
self.certificate_source = 'Cdn'
Loading