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
28 changes: 14 additions & 14 deletions azure-mgmt-automation/azure/mgmt/automation/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
# regenerated.
# --------------------------------------------------------------------------

from .error_response import ErrorResponse, ErrorResponseException
from .resource import Resource
from .tracked_resource import TrackedResource
from .proxy_resource import ProxyResource
from .sku import Sku
from .automation_account import AutomationAccount
from .automation_account_create_or_update_parameters import AutomationAccountCreateOrUpdateParameters
Expand All @@ -24,6 +20,10 @@
from .key import Key
from .key_list_result import KeyListResult
from .automation_account_update_parameters import AutomationAccountUpdateParameters
from .proxy_resource import ProxyResource
from .resource import Resource
from .tracked_resource import TrackedResource
from .error_response import ErrorResponse, ErrorResponseException
from .certificate_create_or_update_parameters import CertificateCreateOrUpdateParameters
from .certificate import Certificate
from .certificate_update_parameters import CertificateUpdateParameters
Expand Down Expand Up @@ -63,8 +63,6 @@
from .module_create_or_update_parameters import ModuleCreateOrUpdateParameters
from .module_update_parameters import ModuleUpdateParameters
from .type_field import TypeField
from .job_stream import JobStream
from .job_stream_list_result import JobStreamListResult
from .runbook_parameter import RunbookParameter
from .runbook_draft import RunbookDraft
from .runbook import Runbook
Expand All @@ -75,6 +73,8 @@
from .test_job import TestJob
from .runbook_create_or_update_draft_properties import RunbookCreateOrUpdateDraftProperties
from .runbook_create_or_update_draft_parameters import RunbookCreateOrUpdateDraftParameters
from .job_stream import JobStream
from .job_stream_list_result import JobStreamListResult
from .advanced_schedule_monthly_occurrence import AdvancedScheduleMonthlyOccurrence
from .advanced_schedule import AdvancedSchedule
from .schedule_create_or_update_parameters import ScheduleCreateOrUpdateParameters
Expand Down Expand Up @@ -171,11 +171,11 @@
DscConfigurationState,
GroupTypeEnum,
ModuleProvisioningState,
JobStreamType,
RunbookTypeEnum,
RunbookState,
RunbookProvisioningState,
HttpStatusCode,
JobStreamType,
ScheduleDay,
ScheduleFrequency,
OperatingSystemType,
Expand All @@ -192,10 +192,6 @@
)

__all__ = [
'ErrorResponse', 'ErrorResponseException',
'Resource',
'TrackedResource',
'ProxyResource',
'Sku',
'AutomationAccount',
'AutomationAccountCreateOrUpdateParameters',
Expand All @@ -207,6 +203,10 @@
'Key',
'KeyListResult',
'AutomationAccountUpdateParameters',
'ProxyResource',
'Resource',
'TrackedResource',
'ErrorResponse', 'ErrorResponseException',
'CertificateCreateOrUpdateParameters',
'Certificate',
'CertificateUpdateParameters',
Expand Down Expand Up @@ -246,8 +246,6 @@
'ModuleCreateOrUpdateParameters',
'ModuleUpdateParameters',
'TypeField',
'JobStream',
'JobStreamListResult',
'RunbookParameter',
'RunbookDraft',
'Runbook',
Expand All @@ -258,6 +256,8 @@
'TestJob',
'RunbookCreateOrUpdateDraftProperties',
'RunbookCreateOrUpdateDraftParameters',
'JobStream',
'JobStreamListResult',
'AdvancedScheduleMonthlyOccurrence',
'AdvancedSchedule',
'ScheduleCreateOrUpdateParameters',
Expand Down Expand Up @@ -353,11 +353,11 @@
'DscConfigurationState',
'GroupTypeEnum',
'ModuleProvisioningState',
'JobStreamType',
'RunbookTypeEnum',
'RunbookState',
'RunbookProvisioningState',
'HttpStatusCode',
'JobStreamType',
'ScheduleDay',
'ScheduleFrequency',
'OperatingSystemType',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,6 @@ class ModuleProvisioningState(Enum):
updating = "Updating"


class JobStreamType(Enum):

progress = "Progress"
output = "Output"
warning = "Warning"
error = "Error"
debug = "Debug"
verbose = "Verbose"
any = "Any"


class RunbookTypeEnum(Enum):

script = "Script"
Expand Down Expand Up @@ -165,6 +154,17 @@ class HttpStatusCode(Enum):
http_version_not_supported = "HttpVersionNotSupported"


class JobStreamType(Enum):

progress = "Progress"
output = "Output"
warning = "Warning"
error = "Error"
debug = "Debug"
verbose = "Verbose"
any = "Any"


class ScheduleDay(Enum):

monday = "Monday"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def get_output(
self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, callback=None, **operation_config):
"""Retrieve the job output identified by job name.

:param resource_group_name: Name of an Azure Resource group.
Expand All @@ -52,10 +52,15 @@ def get_output(
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param callback: When specified, will be called with each chunk of
data that is streamed. The callback should take two arguments, the
bytes of the current chunk of data and the response object. If the
data is uploading, response will be None.
:type callback: Callable[Bytes, response=None]
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:return: object or ClientRawResponse if raw=true
:rtype: Generator or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -86,7 +91,7 @@ def get_output(

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

if response.status_code not in [200]:
exp = CloudError(response)
Expand All @@ -96,7 +101,7 @@ def get_output(
deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('str', response)
deserialized = self._client.stream_download(response, callback)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
Expand All @@ -106,7 +111,7 @@ def get_output(
get_output.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/output'}

def get_runbook_content(
self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, callback=None, **operation_config):
"""Retrieve the runbook content of the job identified by job name.

:param resource_group_name: Name of an Azure Resource group.
Expand All @@ -120,11 +125,17 @@ def get_runbook_content(
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param callback: When specified, will be called with each chunk of
data that is streamed. The callback should take two arguments, the
bytes of the current chunk of data and the response object. If the
data is uploading, response will be None.
:type callback: Callable[Bytes, response=None]
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:return: object or ClientRawResponse if raw=true
:rtype: Generator or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_runbook_content.metadata['url']
Expand Down Expand Up @@ -154,17 +165,15 @@ def get_runbook_content(

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

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ErrorResponseException(self._deserialize, response)

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('str', response)
deserialized = self._client.stream_download(response, callback)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def get_content(
self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, callback=None, **operation_config):
"""Retrieve the content of runbook draft identified by runbook name.

:param resource_group_name: Name of an Azure Resource group.
Expand All @@ -52,10 +52,15 @@ def get_content(
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param callback: When specified, will be called with each chunk of
data that is streamed. The callback should take two arguments, the
bytes of the current chunk of data and the response object. If the
data is uploading, response will be None.
:type callback: Callable[Bytes, response=None]
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:return: object or ClientRawResponse if raw=true
:rtype: Generator or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -84,7 +89,7 @@ def get_content(

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

if response.status_code not in [200]:
exp = CloudError(response)
Expand All @@ -94,7 +99,7 @@ def get_content(
deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('str', response)
deserialized = self._client.stream_download(response, callback)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
Expand All @@ -105,7 +110,7 @@ def get_content(


def _replace_content_initial(
self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, callback=None, **operation_config):
# Construct URL
url = self.replace_content.metadata['url']
path_format_arguments = {
Expand Down Expand Up @@ -145,7 +150,7 @@ def _replace_content_initial(
header_dict = {}

if response.status_code == 200:
deserialized = self._deserialize('str', response)
deserialized = self._deserialize('object', response)
header_dict = {
'location': 'str',
}
Expand All @@ -161,7 +166,7 @@ def _replace_content_initial(
return deserialized

def replace_content(
self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, callback=None, **operation_config):
"""Replaces the runbook draft content.

:param resource_group_name: Name of an Azure Resource group.
Expand All @@ -170,15 +175,15 @@ def replace_content(
:type automation_account_name: str
:param runbook_name: The runbook name.
:type runbook_name: str
:param runbook_content: The runbook draft content.
:param runbook_content: The runbook draft content.
:type runbook_content: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns str or
:return: An instance of AzureOperationPoller that returns object or
ClientRawResponse if raw=true
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or
~msrest.pipeline.ClientRawResponse
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[Generator]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
"""
Expand Down Expand Up @@ -216,7 +221,7 @@ def get_long_running_output(response):
header_dict = {
'location': 'str',
}
deserialized = self._deserialize('str', response)
deserialized = self._deserialize('object', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def get_content(
self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, callback=None, **operation_config):
"""Retrieve the content of runbook identified by runbook name.

:param resource_group_name: Name of an Azure Resource group.
Expand All @@ -50,10 +50,15 @@ def get_content(
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param callback: When specified, will be called with each chunk of
data that is streamed. The callback should take two arguments, the
bytes of the current chunk of data and the response object. If the
data is uploading, response will be None.
:type callback: Callable[Bytes, response=None]
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:return: object or ClientRawResponse if raw=true
:rtype: Generator or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -82,7 +87,7 @@ def get_content(

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

if response.status_code not in [200]:
exp = CloudError(response)
Expand All @@ -92,7 +97,7 @@ def get_content(
deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('str', response)
deserialized = self._client.stream_download(response, callback)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
Expand Down