Skip to content

Commit

Permalink
[AutoPR sql/resource-manager] New Cmdlets for Management.Sql to allow…
Browse files Browse the repository at this point in the history
… customers to add TDE keys and set TDE protector (#3227)

* Generated from bdb271f9fc7fa148176e6470e7e5b27cc2450c73

Changes for ManagedInstanceEncryptionProtectors

* Generated from 724082f8646ab05191f7eee135fd674fd26d1a94

Changing operation id to ListByInstance as per Jared's recommendation

* Generated from f5321fc054067d1d4e8937cfc92452bf4a6a4950

Addressed comments By @anuchandy
- Changed comment to created or updated
- changed operation if to listByInstance
  • Loading branch information
AutorestCI authored Sep 4, 2018
1 parent 8524bd9 commit e429c66
Show file tree
Hide file tree
Showing 11 changed files with 1,042 additions and 0 deletions.
10 changes: 10 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@
from .instance_failover_group_py3 import InstanceFailoverGroup
from .backup_short_term_retention_policy_py3 import BackupShortTermRetentionPolicy
from .tde_certificate_py3 import TdeCertificate
from .managed_instance_key_py3 import ManagedInstanceKey
from .managed_instance_encryption_protector_py3 import ManagedInstanceEncryptionProtector
except (SyntaxError, ImportError):
from .recoverable_database import RecoverableDatabase
from .restorable_dropped_database import RestorableDroppedDatabase
Expand Down Expand Up @@ -291,6 +293,8 @@
from .instance_failover_group import InstanceFailoverGroup
from .backup_short_term_retention_policy import BackupShortTermRetentionPolicy
from .tde_certificate import TdeCertificate
from .managed_instance_key import ManagedInstanceKey
from .managed_instance_encryption_protector import ManagedInstanceEncryptionProtector
from .recoverable_database_paged import RecoverableDatabasePaged
from .restorable_dropped_database_paged import RestorableDroppedDatabasePaged
from .server_paged import ServerPaged
Expand Down Expand Up @@ -344,6 +348,8 @@
from .vulnerability_assessment_scan_record_paged import VulnerabilityAssessmentScanRecordPaged
from .instance_failover_group_paged import InstanceFailoverGroupPaged
from .backup_short_term_retention_policy_paged import BackupShortTermRetentionPolicyPaged
from .managed_instance_key_paged import ManagedInstanceKeyPaged
from .managed_instance_encryption_protector_paged import ManagedInstanceEncryptionProtectorPaged
from .sql_management_client_enums import (
CheckNameAvailabilityReason,
ServerConnectionType,
Expand Down Expand Up @@ -565,6 +571,8 @@
'InstanceFailoverGroup',
'BackupShortTermRetentionPolicy',
'TdeCertificate',
'ManagedInstanceKey',
'ManagedInstanceEncryptionProtector',
'RecoverableDatabasePaged',
'RestorableDroppedDatabasePaged',
'ServerPaged',
Expand Down Expand Up @@ -618,6 +626,8 @@
'VulnerabilityAssessmentScanRecordPaged',
'InstanceFailoverGroupPaged',
'BackupShortTermRetentionPolicyPaged',
'ManagedInstanceKeyPaged',
'ManagedInstanceEncryptionProtectorPaged',
'CheckNameAvailabilityReason',
'ServerConnectionType',
'SecurityAlertPolicyState',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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 .proxy_resource import ProxyResource


class ManagedInstanceEncryptionProtector(ProxyResource):
"""The managed instance encryption protector.
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 id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:ivar kind: Kind of encryption protector. This is metadata used for the
Azure portal experience.
:vartype kind: str
:param server_key_name: The name of the managed instance key.
:type server_key_name: str
:param server_key_type: Required. The encryption protector type like
'ServiceManaged', 'AzureKeyVault'. Possible values include:
'ServiceManaged', 'AzureKeyVault'
:type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType
:ivar uri: The URI of the server key.
:vartype uri: str
:ivar thumbprint: Thumbprint of the server key.
:vartype thumbprint: str
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'kind': {'readonly': True},
'server_key_type': {'required': True},
'uri': {'readonly': True},
'thumbprint': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'kind': {'key': 'kind', 'type': 'str'},
'server_key_name': {'key': 'properties.serverKeyName', 'type': 'str'},
'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'},
'uri': {'key': 'properties.uri', 'type': 'str'},
'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ManagedInstanceEncryptionProtector, self).__init__(**kwargs)
self.kind = None
self.server_key_name = kwargs.get('server_key_name', None)
self.server_key_type = kwargs.get('server_key_type', None)
self.uri = None
self.thumbprint = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.paging import Paged


class ManagedInstanceEncryptionProtectorPaged(Paged):
"""
A paging container for iterating over a list of :class:`ManagedInstanceEncryptionProtector <azure.mgmt.sql.models.ManagedInstanceEncryptionProtector>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[ManagedInstanceEncryptionProtector]'}
}

def __init__(self, *args, **kwargs):

super(ManagedInstanceEncryptionProtectorPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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 .proxy_resource_py3 import ProxyResource


class ManagedInstanceEncryptionProtector(ProxyResource):
"""The managed instance encryption protector.
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 id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:ivar kind: Kind of encryption protector. This is metadata used for the
Azure portal experience.
:vartype kind: str
:param server_key_name: The name of the managed instance key.
:type server_key_name: str
:param server_key_type: Required. The encryption protector type like
'ServiceManaged', 'AzureKeyVault'. Possible values include:
'ServiceManaged', 'AzureKeyVault'
:type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType
:ivar uri: The URI of the server key.
:vartype uri: str
:ivar thumbprint: Thumbprint of the server key.
:vartype thumbprint: str
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'kind': {'readonly': True},
'server_key_type': {'required': True},
'uri': {'readonly': True},
'thumbprint': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'kind': {'key': 'kind', 'type': 'str'},
'server_key_name': {'key': 'properties.serverKeyName', 'type': 'str'},
'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'},
'uri': {'key': 'properties.uri', 'type': 'str'},
'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'},
}

def __init__(self, *, server_key_type, server_key_name: str=None, **kwargs) -> None:
super(ManagedInstanceEncryptionProtector, self).__init__(**kwargs)
self.kind = None
self.server_key_name = server_key_name
self.server_key_type = server_key_type
self.uri = None
self.thumbprint = None
72 changes: 72 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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 .proxy_resource import ProxyResource


class ManagedInstanceKey(ProxyResource):
"""A managed instance key.
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 id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:ivar kind: Kind of encryption protector. This is metadata used for the
Azure portal experience.
:vartype kind: str
:param server_key_type: Required. The key type like 'ServiceManaged',
'AzureKeyVault'. Possible values include: 'ServiceManaged',
'AzureKeyVault'
:type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType
:param uri: The URI of the key. If the ServerKeyType is AzureKeyVault,
then the URI is required.
:type uri: str
:ivar thumbprint: Thumbprint of the key.
:vartype thumbprint: str
:ivar creation_date: The key creation date.
:vartype creation_date: datetime
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'kind': {'readonly': True},
'server_key_type': {'required': True},
'thumbprint': {'readonly': True},
'creation_date': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'kind': {'key': 'kind', 'type': 'str'},
'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'},
'uri': {'key': 'properties.uri', 'type': 'str'},
'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'},
'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'},
}

def __init__(self, **kwargs):
super(ManagedInstanceKey, self).__init__(**kwargs)
self.kind = None
self.server_key_type = kwargs.get('server_key_type', None)
self.uri = kwargs.get('uri', None)
self.thumbprint = None
self.creation_date = None
27 changes: 27 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key_paged.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.paging import Paged


class ManagedInstanceKeyPaged(Paged):
"""
A paging container for iterating over a list of :class:`ManagedInstanceKey <azure.mgmt.sql.models.ManagedInstanceKey>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[ManagedInstanceKey]'}
}

def __init__(self, *args, **kwargs):

super(ManagedInstanceKeyPaged, self).__init__(*args, **kwargs)
72 changes: 72 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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 .proxy_resource_py3 import ProxyResource


class ManagedInstanceKey(ProxyResource):
"""A managed instance key.
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 id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:ivar kind: Kind of encryption protector. This is metadata used for the
Azure portal experience.
:vartype kind: str
:param server_key_type: Required. The key type like 'ServiceManaged',
'AzureKeyVault'. Possible values include: 'ServiceManaged',
'AzureKeyVault'
:type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType
:param uri: The URI of the key. If the ServerKeyType is AzureKeyVault,
then the URI is required.
:type uri: str
:ivar thumbprint: Thumbprint of the key.
:vartype thumbprint: str
:ivar creation_date: The key creation date.
:vartype creation_date: datetime
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'kind': {'readonly': True},
'server_key_type': {'required': True},
'thumbprint': {'readonly': True},
'creation_date': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'kind': {'key': 'kind', 'type': 'str'},
'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'},
'uri': {'key': 'properties.uri', 'type': 'str'},
'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'},
'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'},
}

def __init__(self, *, server_key_type, uri: str=None, **kwargs) -> None:
super(ManagedInstanceKey, self).__init__(**kwargs)
self.kind = None
self.server_key_type = server_key_type
self.uri = uri
self.thumbprint = None
self.creation_date = None
Loading

0 comments on commit e429c66

Please sign in to comment.