Skip to content
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
19 changes: 19 additions & 0 deletions sdk/azure-mgmt-Maintenance/azure/mgmt/Maintenance/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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 ._configuration import MaintenanceManagementClientConfiguration
from ._maintenance_management_client import MaintenanceManagementClient
__all__ = ['MaintenanceManagementClient', 'MaintenanceManagementClientConfiguration']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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 msrestazure import AzureConfiguration

from .version import VERSION


class MaintenanceManagementClientConfiguration(AzureConfiguration):
"""Configuration for MaintenanceManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials that uniquely identify a
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(MaintenanceManagementClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

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

self.credentials = credentials
self.subscription_id = subscription_id
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 msrest.service_client import SDKClient
from msrest import Serializer, Deserializer

from ._configuration import MaintenanceManagementClientConfiguration
from .operations import ApplyUpdatesOperations
from .operations import ConfigurationAssignmentsOperations
from .operations import MaintenanceConfigurationsOperations
from .operations import Operations
from .operations import UpdatesOperations
from . import models


class MaintenanceManagementClient(SDKClient):
"""Azure Maintenance Management Client

:ivar config: Configuration for client.
:vartype config: MaintenanceManagementClientConfiguration

:ivar apply_updates: ApplyUpdates operations
:vartype apply_updates: azure.mgmt.maintenance.operations.ApplyUpdatesOperations
:ivar configuration_assignments: ConfigurationAssignments operations
:vartype configuration_assignments: azure.mgmt.maintenance.operations.ConfigurationAssignmentsOperations
:ivar maintenance_configurations: MaintenanceConfigurations operations
:vartype maintenance_configurations: azure.mgmt.maintenance.operations.MaintenanceConfigurationsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.maintenance.operations.Operations
:ivar updates: Updates operations
:vartype updates: azure.mgmt.maintenance.operations.UpdatesOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials that uniquely identify a
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = MaintenanceManagementClientConfiguration(credentials, subscription_id, base_url)
super(MaintenanceManagementClient, self).__init__(self.config.credentials, self.config)

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

self.apply_updates = ApplyUpdatesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.configuration_assignments = ConfigurationAssignmentsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.maintenance_configurations = MaintenanceConfigurationsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.updates = UpdatesOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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.
# --------------------------------------------------------------------------

try:
from ._models_py3 import ApplyUpdate
from ._models_py3 import ConfigurationAssignment
from ._models_py3 import ErrorDetails
from ._models_py3 import MaintenanceConfiguration
from ._models_py3 import MaintenanceError, MaintenanceErrorException
from ._models_py3 import Operation
from ._models_py3 import OperationInfo
from ._models_py3 import Resource
from ._models_py3 import Update
except (SyntaxError, ImportError):
from ._models import ApplyUpdate
from ._models import ConfigurationAssignment
from ._models import ErrorDetails
from ._models import MaintenanceConfiguration
from ._models import MaintenanceError, MaintenanceErrorException
from ._models import Operation
from ._models import OperationInfo
from ._models import Resource
from ._models import Update
from ._paged_models import ConfigurationAssignmentPaged
from ._paged_models import MaintenanceConfigurationPaged
from ._paged_models import OperationPaged
from ._paged_models import UpdatePaged
from ._maintenance_management_client_enums import (
UpdateStatus,
MaintenanceScope,
ImpactType,
)

__all__ = [
'ApplyUpdate',
'ConfigurationAssignment',
'ErrorDetails',
'MaintenanceConfiguration',
'MaintenanceError', 'MaintenanceErrorException',
'Operation',
'OperationInfo',
'Resource',
'Update',
'ConfigurationAssignmentPaged',
'MaintenanceConfigurationPaged',
'OperationPaged',
'UpdatePaged',
'UpdateStatus',
'MaintenanceScope',
'ImpactType',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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 enum import Enum


class UpdateStatus(str, Enum):

pending = "Pending"
in_progress = "InProgress"
completed = "Completed"
retry_now = "RetryNow"
retry_later = "RetryLater"


class MaintenanceScope(str, Enum):

all = "All"
host = "Host"
resource = "Resource"
in_resource = "InResource"


class ImpactType(str, Enum):

none = "None"
freeze = "Freeze"
restart = "Restart"
redeploy = "Redeploy"
Loading