diff --git a/azure-mgmt-cdn/README.rst b/azure-mgmt-cdn/README.rst index a5684161b0d1..c7aba8961f6e 100644 --- a/azure-mgmt-cdn/README.rst +++ b/azure-mgmt-cdn/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `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 ===== diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py index 4c839265f66b..2e382b4c0864 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/__init__.py @@ -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 @@ -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 @@ -111,6 +121,8 @@ CustomDomainResourceState, CustomHttpsProvisioningState, CustomHttpsProvisioningSubstate, + ProtocolType, + CertificateType, ResourceType, ) @@ -140,6 +152,11 @@ 'OriginUpdateParameters', 'CustomDomain', 'CustomDomainParameters', + 'CustomDomainHttpsParameters', + 'CdnCertificateSourceParameters', + 'CdnManagedHttpsParameters', + 'KeyVaultCertificateSourceParameters', + 'UserManagedHttpsParameters', 'ValidateCustomDomainInput', 'ValidateCustomDomainOutput', 'CheckNameAvailabilityInput', @@ -173,5 +190,7 @@ 'CustomDomainResourceState', 'CustomHttpsProvisioningState', 'CustomHttpsProvisioningSubstate', + 'ProtocolType', + 'CertificateType', 'ResourceType', ] diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_certificate_source_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_certificate_source_parameters.py new file mode 100644 index 000000000000..295b8bf5aa1c --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_certificate_source_parameters.py @@ -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) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_certificate_source_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_certificate_source_parameters_py3.py new file mode 100644 index 000000000000..97875af4c74f --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_certificate_source_parameters_py3.py @@ -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 diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters.py new file mode 100644 index 000000000000..3c9a2bcca295 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters.py @@ -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' diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters_py3.py new file mode 100644 index 000000000000..909a93392f89 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_managed_https_parameters_py3.py @@ -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' diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_management_client_enums.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_management_client_enums.py index 1f363f80d872..0a15a6028eaf 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_management_client_enums.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/cdn_management_client_enums.py @@ -100,6 +100,18 @@ class CustomHttpsProvisioningSubstate(str, Enum): certificate_deleted = "CertificateDeleted" +class ProtocolType(str, Enum): + + server_name_indication = "ServerNameIndication" + ip_based = "IPBased" + + +class CertificateType(str, Enum): + + shared = "Shared" + dedicated = "Dedicated" + + class ResourceType(str, Enum): microsoft_cdn_profiles_endpoints = "Microsoft.Cdn/Profiles/Endpoints" diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters.py new file mode 100644 index 000000000000..c854a87ff851 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters.py @@ -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 msrest.serialization import Model + + +class CustomDomainHttpsParameters(Model): + """The JSON object that contains the properties to secure a custom domain. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CdnManagedHttpsParameters, UserManagedHttpsParameters + + 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 + """ + + _validation = { + 'protocol_type': {'required': True}, + 'certificate_source': {'required': True}, + } + + _attribute_map = { + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, + } + + _subtype_map = { + 'certificate_source': {'Cdn': 'CdnManagedHttpsParameters', 'AzureKeyVault': 'UserManagedHttpsParameters'} + } + + def __init__(self, **kwargs): + super(CustomDomainHttpsParameters, self).__init__(**kwargs) + self.protocol_type = kwargs.get('protocol_type', None) + self.certificate_source = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters_py3.py new file mode 100644 index 000000000000..97bfd1838cba --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/custom_domain_https_parameters_py3.py @@ -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 msrest.serialization import Model + + +class CustomDomainHttpsParameters(Model): + """The JSON object that contains the properties to secure a custom domain. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CdnManagedHttpsParameters, UserManagedHttpsParameters + + 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 + """ + + _validation = { + 'protocol_type': {'required': True}, + 'certificate_source': {'required': True}, + } + + _attribute_map = { + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, + } + + _subtype_map = { + 'certificate_source': {'Cdn': 'CdnManagedHttpsParameters', 'AzureKeyVault': 'UserManagedHttpsParameters'} + } + + def __init__(self, *, protocol_type, **kwargs) -> None: + super(CustomDomainHttpsParameters, self).__init__(**kwargs) + self.protocol_type = protocol_type + self.certificate_source = None diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/key_vault_certificate_source_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/key_vault_certificate_source_parameters.py new file mode 100644 index 000000000000..f005eda72e8b --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/key_vault_certificate_source_parameters.py @@ -0,0 +1,84 @@ +# 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 KeyVaultCertificateSourceParameters(Model): + """Describes the parameters for using a user's KeyVault 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.KeyVaultCertificateSourceParameters" . + :vartype odatatype: str + :param subscription_id: Required. Subscription Id of the user's Key Vault + containing the SSL certificate + :type subscription_id: str + :param resource_group_name: Required. Resource group of the user's Key + Vault containing the SSL certificate + :type resource_group_name: str + :param vault_name: Required. The name of the user's Key Vault containing + the SSL certificate + :type vault_name: str + :param secret_name: Required. The name of Key Vault Secret (representing + the full certificate PFX) in Key Vault. + :type secret_name: str + :param secret_version: Required. The version(GUID) of Key Vault Secret in + Key Vault. + :type secret_version: str + :ivar update_rule: Required. Describes the action that shall be taken when + the certificate is updated in Key Vault. Default value: "NoAction" . + :vartype update_rule: str + :ivar delete_rule: Required. Describes the action that shall be taken when + the certificate is removed from Key Vault. Default value: "NoAction" . + :vartype delete_rule: str + """ + + _validation = { + 'odatatype': {'required': True, 'constant': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'vault_name': {'required': True}, + 'secret_name': {'required': True}, + 'secret_version': {'required': True}, + 'update_rule': {'required': True, 'constant': True}, + 'delete_rule': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'vault_name': {'key': 'vaultName', 'type': 'str'}, + 'secret_name': {'key': 'secretName', 'type': 'str'}, + 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + 'update_rule': {'key': 'updateRule', 'type': 'str'}, + 'delete_rule': {'key': 'deleteRule', 'type': 'str'}, + } + + odatatype = "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters" + + update_rule = "NoAction" + + delete_rule = "NoAction" + + def __init__(self, **kwargs): + super(KeyVaultCertificateSourceParameters, self).__init__(**kwargs) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group_name = kwargs.get('resource_group_name', None) + self.vault_name = kwargs.get('vault_name', None) + self.secret_name = kwargs.get('secret_name', None) + self.secret_version = kwargs.get('secret_version', None) diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/key_vault_certificate_source_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/key_vault_certificate_source_parameters_py3.py new file mode 100644 index 000000000000..207415c27bd8 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/key_vault_certificate_source_parameters_py3.py @@ -0,0 +1,84 @@ +# 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 KeyVaultCertificateSourceParameters(Model): + """Describes the parameters for using a user's KeyVault 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.KeyVaultCertificateSourceParameters" . + :vartype odatatype: str + :param subscription_id: Required. Subscription Id of the user's Key Vault + containing the SSL certificate + :type subscription_id: str + :param resource_group_name: Required. Resource group of the user's Key + Vault containing the SSL certificate + :type resource_group_name: str + :param vault_name: Required. The name of the user's Key Vault containing + the SSL certificate + :type vault_name: str + :param secret_name: Required. The name of Key Vault Secret (representing + the full certificate PFX) in Key Vault. + :type secret_name: str + :param secret_version: Required. The version(GUID) of Key Vault Secret in + Key Vault. + :type secret_version: str + :ivar update_rule: Required. Describes the action that shall be taken when + the certificate is updated in Key Vault. Default value: "NoAction" . + :vartype update_rule: str + :ivar delete_rule: Required. Describes the action that shall be taken when + the certificate is removed from Key Vault. Default value: "NoAction" . + :vartype delete_rule: str + """ + + _validation = { + 'odatatype': {'required': True, 'constant': True}, + 'subscription_id': {'required': True}, + 'resource_group_name': {'required': True}, + 'vault_name': {'required': True}, + 'secret_name': {'required': True}, + 'secret_version': {'required': True}, + 'update_rule': {'required': True, 'constant': True}, + 'delete_rule': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'odatatype': {'key': '@odata\\.type', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'vault_name': {'key': 'vaultName', 'type': 'str'}, + 'secret_name': {'key': 'secretName', 'type': 'str'}, + 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + 'update_rule': {'key': 'updateRule', 'type': 'str'}, + 'delete_rule': {'key': 'deleteRule', 'type': 'str'}, + } + + odatatype = "#Microsoft.Azure.Cdn.Models.KeyVaultCertificateSourceParameters" + + update_rule = "NoAction" + + delete_rule = "NoAction" + + def __init__(self, *, subscription_id: str, resource_group_name: str, vault_name: str, secret_name: str, secret_version: str, **kwargs) -> None: + super(KeyVaultCertificateSourceParameters, self).__init__(**kwargs) + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.vault_name = vault_name + self.secret_name = secret_name + self.secret_version = secret_version diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters.py new file mode 100644 index 000000000000..1153a4f390d3 --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters.py @@ -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 UserManagedHttpsParameters(CustomDomainHttpsParameters): + """Defines the certificate source parameters using user's keyvault 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 user's keyvault certificate for enabling SSL. + :type certificate_source_parameters: + ~azure.mgmt.cdn.models.KeyVaultCertificateSourceParameters + """ + + _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': 'KeyVaultCertificateSourceParameters'}, + } + + def __init__(self, **kwargs): + super(UserManagedHttpsParameters, self).__init__(**kwargs) + self.certificate_source_parameters = kwargs.get('certificate_source_parameters', None) + self.certificate_source = 'AzureKeyVault' diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters_py3.py b/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters_py3.py new file mode 100644 index 000000000000..7a87fe51b92c --- /dev/null +++ b/azure-mgmt-cdn/azure/mgmt/cdn/models/user_managed_https_parameters_py3.py @@ -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 UserManagedHttpsParameters(CustomDomainHttpsParameters): + """Defines the certificate source parameters using user's keyvault 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 user's keyvault certificate for enabling SSL. + :type certificate_source_parameters: + ~azure.mgmt.cdn.models.KeyVaultCertificateSourceParameters + """ + + _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': 'KeyVaultCertificateSourceParameters'}, + } + + def __init__(self, *, protocol_type, certificate_source_parameters, **kwargs) -> None: + super(UserManagedHttpsParameters, self).__init__(protocol_type=protocol_type, **kwargs) + self.certificate_source_parameters = certificate_source_parameters + self.certificate_source = 'AzureKeyVault' diff --git a/azure-mgmt-cdn/azure/mgmt/cdn/operations/custom_domains_operations.py b/azure-mgmt-cdn/azure/mgmt/cdn/operations/custom_domains_operations.py index 2105bf40dd5c..554289209e1c 100644 --- a/azure-mgmt-cdn/azure/mgmt/cdn/operations/custom_domains_operations.py +++ b/azure-mgmt-cdn/azure/mgmt/cdn/operations/custom_domains_operations.py @@ -478,7 +478,7 @@ def disable_custom_https( disable_custom_https.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps'} def enable_custom_https( - self, resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_domain_https_parameters=None, custom_headers=None, raw=False, **operation_config): """Enable https delivery of the custom domain. :param resource_group_name: Name of the Resource group within the @@ -493,6 +493,12 @@ def enable_custom_https( :param custom_domain_name: Name of the custom domain within an endpoint. :type custom_domain_name: str + :param custom_domain_https_parameters: The configuration specifying + how to enable HTTPS for the custom domain - using CDN managed + certificate or user's own certificate. If not specified, enabling ssl + uses CDN managed certificate by default. + :type custom_domain_https_parameters: + ~azure.mgmt.cdn.models.CustomDomainHttpsParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -522,6 +528,7 @@ def enable_custom_https( # 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()) if custom_headers: @@ -529,8 +536,14 @@ def enable_custom_https( 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 body + if custom_domain_https_parameters is not None: + body_content = self._serialize.body(custom_domain_https_parameters, 'CustomDomainHttpsParameters') + else: + body_content = None + # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + 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, 202]: