From ba5b7cba009cee53180f5ec5c3cfbfdf64a94404 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 7 Dec 2020 09:38:45 +0000 Subject: [PATCH] CodeGen from PR 11939 in Azure/azure-rest-api-specs [Hub Generated] Public private branch 'credscan-fix' (#11939) * Fix credscan * Fix more credentials --- .../_app_platform_management_client.py | 16 + .../azure/mgmt/automation/__init__.py | 7 +- .../mgmt/automation/_automation_client.py | 250 + .../azure/mgmt/automation/_configuration.py | 50 + .../azure/mgmt/automation/models/__init__.py | 796 +-- .../models/_automation_client_enums.py | 288 + .../azure/mgmt/automation/models/_models.py | 5338 +++++++++++++++++ .../mgmt/automation/models/_models_py3.py | 5338 +++++++++++++++++ .../mgmt/automation/models/_paged_models.py | 378 ++ .../mgmt/automation/operations/__init__.py | 82 +- .../operations/_activity_operations.py | 180 + ...ent_registration_information_operations.py | 169 + .../_automation_account_operations.py | 424 ++ .../operations/_certificate_operations.py | 376 ++ .../operations/_connection_operations.py | 382 ++ .../operations/_connection_type_operations.py | 302 + .../operations/_credential_operations.py | 376 ++ .../_dsc_compilation_job_operations.py | 350 ++ .../_dsc_compilation_job_stream_operations.py | 102 + .../_dsc_configuration_operations.py | 458 ++ .../_dsc_node_configuration_operations.py | 350 ++ .../operations/_dsc_node_operations.py | 326 + .../operations/_fields_operations.py | 116 + ..._hybrid_runbook_worker_group_operations.py | 307 + .../automation/operations/_job_operations.py | 576 ++ .../operations/_job_schedule_operations.py | 303 + .../operations/_job_stream_operations.py | 191 + .../automation/operations/_keys_operations.py | 99 + .../_linked_workspace_operations.py | 99 + .../operations/_module_operations.py | 369 ++ .../_node_count_information_operations.py | 103 + .../operations/_node_reports_operations.py | 248 + .../_object_data_types_operations.py | 191 + .../mgmt/automation/operations/_operations.py | 100 + .../operations/_python2_package_operations.py | 374 ++ .../operations/_runbook_draft_operations.py | 346 ++ .../operations/_runbook_operations.py | 531 ++ .../operations/_schedule_operations.py | 372 ++ ...e_configuration_machine_runs_operations.py | 191 + ...re_update_configuration_runs_operations.py | 190 + ...ftware_update_configurations_operations.py | 315 + .../operations/_source_control_operations.py | 376 ++ .../_source_control_sync_job_operations.py | 258 + ...rce_control_sync_job_streams_operations.py | 190 + .../operations/_statistics_operations.py | 114 + .../operations/_test_job_operations.py | 342 ++ .../_test_job_streams_operations.py | 184 + .../operations/_usages_operations.py | 110 + .../operations/_variable_operations.py | 372 ++ .../operations/_watcher_operations.py | 487 ++ .../operations/_webhook_operations.py | 433 ++ 51 files changed, 23783 insertions(+), 442 deletions(-) create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_automation_client.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_configuration.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_automation_client_enums.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_models.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_models_py3.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_paged_models.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_activity_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_agent_registration_information_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_automation_account_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_certificate_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_type_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_credential_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_stream_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_configuration_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_configuration_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_fields_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_hybrid_runbook_worker_group_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_schedule_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_stream_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_keys_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_linked_workspace_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_module_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_count_information_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_reports_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_object_data_types_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_python2_package_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_draft_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_schedule_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_machine_runs_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_runs_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configurations_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_streams_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_statistics_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_streams_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_usages_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_variable_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_watcher_operations.py create mode 100644 sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_webhook_operations.py diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_app_platform_management_client.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_app_platform_management_client.py index 565924158358..d737dcdb6d28 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_app_platform_management_client.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_app_platform_management_client.py @@ -206,6 +206,22 @@ def operations(self): raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def runtime_versions(self): + """Instance depends on the API version: + + * 2019-05-01-preview: :class:`RuntimeVersionsOperations` + * 2020-07-01: :class:`RuntimeVersionsOperations` + """ + api_version = self._get_api_version('runtime_versions') + if api_version == '2019-05-01-preview': + from .v2019_05_01_preview.operations import RuntimeVersionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import RuntimeVersionsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def services(self): """Instance depends on the API version: diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/__init__.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/__init__.py index 583531e6aca2..99cae003c7a0 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/__init__.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .automation_client import AutomationClient -from .version import VERSION +from ._configuration import AutomationClientConfiguration +from ._automation_client import AutomationClient +__all__ = ['AutomationClient', 'AutomationClientConfiguration'] -__all__ = ['AutomationClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_automation_client.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_automation_client.py new file mode 100644 index 000000000000..f269c7cfdf92 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_automation_client.py @@ -0,0 +1,250 @@ +# 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 AutomationClientConfiguration +from .operations import AutomationAccountOperations +from .operations import Operations +from .operations import StatisticsOperations +from .operations import UsagesOperations +from .operations import KeysOperations +from .operations import CertificateOperations +from .operations import ConnectionOperations +from .operations import ConnectionTypeOperations +from .operations import CredentialOperations +from .operations import DscConfigurationOperations +from .operations import HybridRunbookWorkerGroupOperations +from .operations import JobScheduleOperations +from .operations import LinkedWorkspaceOperations +from .operations import ActivityOperations +from .operations import ModuleOperations +from .operations import ObjectDataTypesOperations +from .operations import FieldsOperations +from .operations import ScheduleOperations +from .operations import VariableOperations +from .operations import WebhookOperations +from .operations import WatcherOperations +from .operations import SoftwareUpdateConfigurationsOperations +from .operations import SoftwareUpdateConfigurationRunsOperations +from .operations import SoftwareUpdateConfigurationMachineRunsOperations +from .operations import SourceControlOperations +from .operations import SourceControlSyncJobOperations +from .operations import SourceControlSyncJobStreamsOperations +from .operations import JobOperations +from .operations import JobStreamOperations +from .operations import AgentRegistrationInformationOperations +from .operations import DscNodeOperations +from .operations import NodeReportsOperations +from .operations import DscCompilationJobOperations +from .operations import DscCompilationJobStreamOperations +from .operations import DscNodeConfigurationOperations +from .operations import NodeCountInformationOperations +from .operations import RunbookDraftOperations +from .operations import RunbookOperations +from .operations import TestJobStreamsOperations +from .operations import TestJobOperations +from .operations import Python2PackageOperations +from . import models + + +class AutomationClient(SDKClient): + """Automation Client + + :ivar config: Configuration for client. + :vartype config: AutomationClientConfiguration + + :ivar automation_account: AutomationAccount operations + :vartype automation_account: azure.mgmt.automation.operations.AutomationAccountOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.automation.operations.Operations + :ivar statistics: Statistics operations + :vartype statistics: azure.mgmt.automation.operations.StatisticsOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.automation.operations.UsagesOperations + :ivar keys: Keys operations + :vartype keys: azure.mgmt.automation.operations.KeysOperations + :ivar certificate: Certificate operations + :vartype certificate: azure.mgmt.automation.operations.CertificateOperations + :ivar connection: Connection operations + :vartype connection: azure.mgmt.automation.operations.ConnectionOperations + :ivar connection_type: ConnectionType operations + :vartype connection_type: azure.mgmt.automation.operations.ConnectionTypeOperations + :ivar credential: Credential operations + :vartype credential: azure.mgmt.automation.operations.CredentialOperations + :ivar dsc_configuration: DscConfiguration operations + :vartype dsc_configuration: azure.mgmt.automation.operations.DscConfigurationOperations + :ivar hybrid_runbook_worker_group: HybridRunbookWorkerGroup operations + :vartype hybrid_runbook_worker_group: azure.mgmt.automation.operations.HybridRunbookWorkerGroupOperations + :ivar job_schedule: JobSchedule operations + :vartype job_schedule: azure.mgmt.automation.operations.JobScheduleOperations + :ivar linked_workspace: LinkedWorkspace operations + :vartype linked_workspace: azure.mgmt.automation.operations.LinkedWorkspaceOperations + :ivar activity: Activity operations + :vartype activity: azure.mgmt.automation.operations.ActivityOperations + :ivar module: Module operations + :vartype module: azure.mgmt.automation.operations.ModuleOperations + :ivar object_data_types: ObjectDataTypes operations + :vartype object_data_types: azure.mgmt.automation.operations.ObjectDataTypesOperations + :ivar fields: Fields operations + :vartype fields: azure.mgmt.automation.operations.FieldsOperations + :ivar schedule: Schedule operations + :vartype schedule: azure.mgmt.automation.operations.ScheduleOperations + :ivar variable: Variable operations + :vartype variable: azure.mgmt.automation.operations.VariableOperations + :ivar webhook: Webhook operations + :vartype webhook: azure.mgmt.automation.operations.WebhookOperations + :ivar watcher: Watcher operations + :vartype watcher: azure.mgmt.automation.operations.WatcherOperations + :ivar software_update_configurations: SoftwareUpdateConfigurations operations + :vartype software_update_configurations: azure.mgmt.automation.operations.SoftwareUpdateConfigurationsOperations + :ivar software_update_configuration_runs: SoftwareUpdateConfigurationRuns operations + :vartype software_update_configuration_runs: azure.mgmt.automation.operations.SoftwareUpdateConfigurationRunsOperations + :ivar software_update_configuration_machine_runs: SoftwareUpdateConfigurationMachineRuns operations + :vartype software_update_configuration_machine_runs: azure.mgmt.automation.operations.SoftwareUpdateConfigurationMachineRunsOperations + :ivar source_control: SourceControl operations + :vartype source_control: azure.mgmt.automation.operations.SourceControlOperations + :ivar source_control_sync_job: SourceControlSyncJob operations + :vartype source_control_sync_job: azure.mgmt.automation.operations.SourceControlSyncJobOperations + :ivar source_control_sync_job_streams: SourceControlSyncJobStreams operations + :vartype source_control_sync_job_streams: azure.mgmt.automation.operations.SourceControlSyncJobStreamsOperations + :ivar job: Job operations + :vartype job: azure.mgmt.automation.operations.JobOperations + :ivar job_stream: JobStream operations + :vartype job_stream: azure.mgmt.automation.operations.JobStreamOperations + :ivar agent_registration_information: AgentRegistrationInformation operations + :vartype agent_registration_information: azure.mgmt.automation.operations.AgentRegistrationInformationOperations + :ivar dsc_node: DscNode operations + :vartype dsc_node: azure.mgmt.automation.operations.DscNodeOperations + :ivar node_reports: NodeReports operations + :vartype node_reports: azure.mgmt.automation.operations.NodeReportsOperations + :ivar dsc_compilation_job: DscCompilationJob operations + :vartype dsc_compilation_job: azure.mgmt.automation.operations.DscCompilationJobOperations + :ivar dsc_compilation_job_stream: DscCompilationJobStream operations + :vartype dsc_compilation_job_stream: azure.mgmt.automation.operations.DscCompilationJobStreamOperations + :ivar dsc_node_configuration: DscNodeConfiguration operations + :vartype dsc_node_configuration: azure.mgmt.automation.operations.DscNodeConfigurationOperations + :ivar node_count_information: NodeCountInformation operations + :vartype node_count_information: azure.mgmt.automation.operations.NodeCountInformationOperations + :ivar runbook_draft: RunbookDraft operations + :vartype runbook_draft: azure.mgmt.automation.operations.RunbookDraftOperations + :ivar runbook: Runbook operations + :vartype runbook: azure.mgmt.automation.operations.RunbookOperations + :ivar test_job_streams: TestJobStreams operations + :vartype test_job_streams: azure.mgmt.automation.operations.TestJobStreamsOperations + :ivar test_job: TestJob operations + :vartype test_job: azure.mgmt.automation.operations.TestJobOperations + :ivar python2_package: Python2Package operations + :vartype python2_package: azure.mgmt.automation.operations.Python2PackageOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription credentials which uniquely + identify 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 = AutomationClientConfiguration(credentials, subscription_id, base_url) + super(AutomationClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.automation_account = AutomationAccountOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.statistics = StatisticsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.keys = KeysOperations( + self._client, self.config, self._serialize, self._deserialize) + self.certificate = CertificateOperations( + self._client, self.config, self._serialize, self._deserialize) + self.connection = ConnectionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.connection_type = ConnectionTypeOperations( + self._client, self.config, self._serialize, self._deserialize) + self.credential = CredentialOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dsc_configuration = DscConfigurationOperations( + self._client, self.config, self._serialize, self._deserialize) + self.hybrid_runbook_worker_group = HybridRunbookWorkerGroupOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_schedule = JobScheduleOperations( + self._client, self.config, self._serialize, self._deserialize) + self.linked_workspace = LinkedWorkspaceOperations( + self._client, self.config, self._serialize, self._deserialize) + self.activity = ActivityOperations( + self._client, self.config, self._serialize, self._deserialize) + self.module = ModuleOperations( + self._client, self.config, self._serialize, self._deserialize) + self.object_data_types = ObjectDataTypesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.fields = FieldsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.schedule = ScheduleOperations( + self._client, self.config, self._serialize, self._deserialize) + self.variable = VariableOperations( + self._client, self.config, self._serialize, self._deserialize) + self.webhook = WebhookOperations( + self._client, self.config, self._serialize, self._deserialize) + self.watcher = WatcherOperations( + self._client, self.config, self._serialize, self._deserialize) + self.software_update_configurations = SoftwareUpdateConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.software_update_configuration_runs = SoftwareUpdateConfigurationRunsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.software_update_configuration_machine_runs = SoftwareUpdateConfigurationMachineRunsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.source_control = SourceControlOperations( + self._client, self.config, self._serialize, self._deserialize) + self.source_control_sync_job = SourceControlSyncJobOperations( + self._client, self.config, self._serialize, self._deserialize) + self.source_control_sync_job_streams = SourceControlSyncJobStreamsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job = JobOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_stream = JobStreamOperations( + self._client, self.config, self._serialize, self._deserialize) + self.agent_registration_information = AgentRegistrationInformationOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dsc_node = DscNodeOperations( + self._client, self.config, self._serialize, self._deserialize) + self.node_reports = NodeReportsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dsc_compilation_job = DscCompilationJobOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dsc_compilation_job_stream = DscCompilationJobStreamOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dsc_node_configuration = DscNodeConfigurationOperations( + self._client, self.config, self._serialize, self._deserialize) + self.node_count_information = NodeCountInformationOperations( + self._client, self.config, self._serialize, self._deserialize) + self.runbook_draft = RunbookDraftOperations( + self._client, self.config, self._serialize, self._deserialize) + self.runbook = RunbookOperations( + self._client, self.config, self._serialize, self._deserialize) + self.test_job_streams = TestJobStreamsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.test_job = TestJobOperations( + self._client, self.config, self._serialize, self._deserialize) + self.python2_package = Python2PackageOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_configuration.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_configuration.py new file mode 100644 index 000000000000..bcef8043b321 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_configuration.py @@ -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 AutomationClientConfiguration(AzureConfiguration): + """Configuration for AutomationClient + 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` + :param subscription_id: Gets subscription credentials which uniquely + identify 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(AutomationClientConfiguration, 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-automation/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py index 5efb70ad2540..f41f26eb5bfe 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py @@ -10,306 +10,306 @@ # -------------------------------------------------------------------------- try: - from .sku_py3 import Sku - from .automation_account_py3 import AutomationAccount - from .automation_account_create_or_update_parameters_py3 import AutomationAccountCreateOrUpdateParameters - from .operation_display_py3 import OperationDisplay - from .operation_py3 import Operation - from .statistics_py3 import Statistics - from .usage_counter_name_py3 import UsageCounterName - from .usage_py3 import Usage - from .key_py3 import Key - from .key_list_result_py3 import KeyListResult - from .automation_account_update_parameters_py3 import AutomationAccountUpdateParameters - from .proxy_resource_py3 import ProxyResource - from .resource_py3 import Resource - from .tracked_resource_py3 import TrackedResource - from .error_response_py3 import ErrorResponse, ErrorResponseException - from .certificate_create_or_update_parameters_py3 import CertificateCreateOrUpdateParameters - from .certificate_py3 import Certificate - from .certificate_update_parameters_py3 import CertificateUpdateParameters - from .connection_type_association_property_py3 import ConnectionTypeAssociationProperty - from .connection_create_or_update_parameters_py3 import ConnectionCreateOrUpdateParameters - from .connection_py3 import Connection - from .connection_update_parameters_py3 import ConnectionUpdateParameters - from .field_definition_py3 import FieldDefinition - from .connection_type_py3 import ConnectionType - from .connection_type_create_or_update_parameters_py3 import ConnectionTypeCreateOrUpdateParameters - from .credential_create_or_update_parameters_py3 import CredentialCreateOrUpdateParameters - from .credential_py3 import Credential - from .credential_update_parameters_py3 import CredentialUpdateParameters - from .content_hash_py3 import ContentHash - from .content_source_py3 import ContentSource - from .dsc_configuration_parameter_py3 import DscConfigurationParameter - from .dsc_configuration_create_or_update_parameters_py3 import DscConfigurationCreateOrUpdateParameters - from .dsc_configuration_py3 import DscConfiguration - from .dsc_configuration_update_parameters_py3 import DscConfigurationUpdateParameters - from .run_as_credential_association_property_py3 import RunAsCredentialAssociationProperty - from .hybrid_runbook_worker_py3 import HybridRunbookWorker - from .hybrid_runbook_worker_group_py3 import HybridRunbookWorkerGroup - from .hybrid_runbook_worker_group_update_parameters_py3 import HybridRunbookWorkerGroupUpdateParameters - from .schedule_association_property_py3 import ScheduleAssociationProperty - from .runbook_association_property_py3 import RunbookAssociationProperty - from .job_schedule_py3 import JobSchedule - from .job_schedule_create_parameters_py3 import JobScheduleCreateParameters - from .linked_workspace_py3 import LinkedWorkspace - from .activity_parameter_validation_set_py3 import ActivityParameterValidationSet - from .activity_parameter_py3 import ActivityParameter - from .activity_parameter_set_py3 import ActivityParameterSet - from .activity_output_type_py3 import ActivityOutputType - from .activity_py3 import Activity - from .module_error_info_py3 import ModuleErrorInfo - from .content_link_py3 import ContentLink - from .module_py3 import Module - from .module_create_or_update_parameters_py3 import ModuleCreateOrUpdateParameters - from .module_update_parameters_py3 import ModuleUpdateParameters - from .type_field_py3 import TypeField - from .advanced_schedule_monthly_occurrence_py3 import AdvancedScheduleMonthlyOccurrence - from .advanced_schedule_py3 import AdvancedSchedule - from .schedule_create_or_update_parameters_py3 import ScheduleCreateOrUpdateParameters - from .schedule_properties_py3 import ScheduleProperties - from .schedule_py3 import Schedule - from .schedule_update_parameters_py3 import ScheduleUpdateParameters - from .variable_create_or_update_parameters_py3 import VariableCreateOrUpdateParameters - from .variable_py3 import Variable - from .variable_update_parameters_py3 import VariableUpdateParameters - from .webhook_py3 import Webhook - from .webhook_update_parameters_py3 import WebhookUpdateParameters - from .webhook_create_or_update_parameters_py3 import WebhookCreateOrUpdateParameters - from .watcher_py3 import Watcher - from .watcher_update_parameters_py3 import WatcherUpdateParameters - from .windows_properties_py3 import WindowsProperties - from .linux_properties_py3 import LinuxProperties - from .tag_settings_properties_py3 import TagSettingsProperties - from .azure_query_properties_py3 import AzureQueryProperties - from .non_azure_query_properties_py3 import NonAzureQueryProperties - from .target_properties_py3 import TargetProperties - from .update_configuration_py3 import UpdateConfiguration - from .task_properties_py3 import TaskProperties - from .software_update_configuration_tasks_py3 import SoftwareUpdateConfigurationTasks - from .software_update_configuration_py3 import SoftwareUpdateConfiguration - from .collection_item_update_configuration_py3 import CollectionItemUpdateConfiguration - from .software_update_configuration_collection_item_py3 import SoftwareUpdateConfigurationCollectionItem - from .software_update_configuration_list_result_py3 import SoftwareUpdateConfigurationListResult - from .update_configuration_navigation_py3 import UpdateConfigurationNavigation - from .softare_update_configuration_run_task_properties_py3 import SoftareUpdateConfigurationRunTaskProperties - from .softare_update_configuration_run_tasks_py3 import SoftareUpdateConfigurationRunTasks - from .software_update_configuration_run_py3 import SoftwareUpdateConfigurationRun - from .software_update_configuration_run_list_result_py3 import SoftwareUpdateConfigurationRunListResult - from .job_navigation_py3 import JobNavigation - from .software_update_configuration_machine_run_py3 import SoftwareUpdateConfigurationMachineRun - from .software_update_configuration_machine_run_list_result_py3 import SoftwareUpdateConfigurationMachineRunListResult - from .source_control_py3 import SourceControl - from .source_control_security_token_properties_py3 import SourceControlSecurityTokenProperties - from .source_control_update_parameters_py3 import SourceControlUpdateParameters - from .source_control_create_or_update_parameters_py3 import SourceControlCreateOrUpdateParameters - from .source_control_sync_job_py3 import SourceControlSyncJob - from .source_control_sync_job_create_parameters_py3 import SourceControlSyncJobCreateParameters - from .source_control_sync_job_by_id_py3 import SourceControlSyncJobById - from .source_control_sync_job_stream_py3 import SourceControlSyncJobStream - from .source_control_sync_job_stream_by_id_py3 import SourceControlSyncJobStreamById - from .job_stream_py3 import JobStream - from .job_stream_list_result_py3 import JobStreamListResult - from .job_py3 import Job - from .job_collection_item_py3 import JobCollectionItem - from .job_create_parameters_py3 import JobCreateParameters - from .dsc_report_error_py3 import DscReportError - from .dsc_report_resource_navigation_py3 import DscReportResourceNavigation - from .dsc_report_resource_py3 import DscReportResource - from .dsc_meta_configuration_py3 import DscMetaConfiguration - from .dsc_node_report_py3 import DscNodeReport - from .agent_registration_keys_py3 import AgentRegistrationKeys - from .agent_registration_py3 import AgentRegistration - from .dsc_node_extension_handler_association_property_py3 import DscNodeExtensionHandlerAssociationProperty - from .dsc_node_py3 import DscNode - from .agent_registration_regenerate_key_parameter_py3 import AgentRegistrationRegenerateKeyParameter - from .dsc_node_update_parameters_properties_py3 import DscNodeUpdateParametersProperties - from .dsc_node_update_parameters_py3 import DscNodeUpdateParameters - from .dsc_configuration_association_property_py3 import DscConfigurationAssociationProperty - from .dsc_compilation_job_py3 import DscCompilationJob - from .dsc_compilation_job_create_parameters_py3 import DscCompilationJobCreateParameters - from .dsc_node_configuration_py3 import DscNodeConfiguration - from .dsc_node_configuration_create_or_update_parameters_py3 import DscNodeConfigurationCreateOrUpdateParameters - from .node_count_properties_py3 import NodeCountProperties - from .node_count_py3 import NodeCount - from .node_counts_py3 import NodeCounts - from .runbook_parameter_py3 import RunbookParameter - from .runbook_draft_py3 import RunbookDraft - from .runbook_py3 import Runbook - from .runbook_create_or_update_parameters_py3 import RunbookCreateOrUpdateParameters - from .runbook_update_parameters_py3 import RunbookUpdateParameters - from .runbook_draft_undo_edit_result_py3 import RunbookDraftUndoEditResult - from .test_job_create_parameters_py3 import TestJobCreateParameters - from .test_job_py3 import TestJob - from .runbook_create_or_update_draft_properties_py3 import RunbookCreateOrUpdateDraftProperties - from .runbook_create_or_update_draft_parameters_py3 import RunbookCreateOrUpdateDraftParameters - from .python_package_create_parameters_py3 import PythonPackageCreateParameters - from .python_package_update_parameters_py3 import PythonPackageUpdateParameters + from ._models_py3 import Activity + from ._models_py3 import ActivityOutputType + from ._models_py3 import ActivityParameter + from ._models_py3 import ActivityParameterSet + from ._models_py3 import ActivityParameterValidationSet + from ._models_py3 import AdvancedSchedule + from ._models_py3 import AdvancedScheduleMonthlyOccurrence + from ._models_py3 import AgentRegistration + from ._models_py3 import AgentRegistrationKeys + from ._models_py3 import AgentRegistrationRegenerateKeyParameter + from ._models_py3 import AutomationAccount + from ._models_py3 import AutomationAccountCreateOrUpdateParameters + from ._models_py3 import AutomationAccountUpdateParameters + from ._models_py3 import AzureQueryProperties + from ._models_py3 import Certificate + from ._models_py3 import CertificateCreateOrUpdateParameters + from ._models_py3 import CertificateUpdateParameters + from ._models_py3 import CollectionItemUpdateConfiguration + from ._models_py3 import Connection + from ._models_py3 import ConnectionCreateOrUpdateParameters + from ._models_py3 import ConnectionType + from ._models_py3 import ConnectionTypeAssociationProperty + from ._models_py3 import ConnectionTypeCreateOrUpdateParameters + from ._models_py3 import ConnectionUpdateParameters + from ._models_py3 import ContentHash + from ._models_py3 import ContentLink + from ._models_py3 import ContentSource + from ._models_py3 import Credential + from ._models_py3 import CredentialCreateOrUpdateParameters + from ._models_py3 import CredentialUpdateParameters + from ._models_py3 import DscCompilationJob + from ._models_py3 import DscCompilationJobCreateParameters + from ._models_py3 import DscConfiguration + from ._models_py3 import DscConfigurationAssociationProperty + from ._models_py3 import DscConfigurationCreateOrUpdateParameters + from ._models_py3 import DscConfigurationParameter + from ._models_py3 import DscConfigurationUpdateParameters + from ._models_py3 import DscMetaConfiguration + from ._models_py3 import DscNode + from ._models_py3 import DscNodeConfiguration + from ._models_py3 import DscNodeConfigurationCreateOrUpdateParameters + from ._models_py3 import DscNodeExtensionHandlerAssociationProperty + from ._models_py3 import DscNodeReport + from ._models_py3 import DscNodeUpdateParameters + from ._models_py3 import DscNodeUpdateParametersProperties + from ._models_py3 import DscReportError + from ._models_py3 import DscReportResource + from ._models_py3 import DscReportResourceNavigation + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import FieldDefinition + from ._models_py3 import HybridRunbookWorker + from ._models_py3 import HybridRunbookWorkerGroup + from ._models_py3 import HybridRunbookWorkerGroupUpdateParameters + from ._models_py3 import Job + from ._models_py3 import JobCollectionItem + from ._models_py3 import JobCreateParameters + from ._models_py3 import JobNavigation + from ._models_py3 import JobSchedule + from ._models_py3 import JobScheduleCreateParameters + from ._models_py3 import JobStream + from ._models_py3 import JobStreamListResult + from ._models_py3 import Key + from ._models_py3 import KeyListResult + from ._models_py3 import LinkedWorkspace + from ._models_py3 import LinuxProperties + from ._models_py3 import Module + from ._models_py3 import ModuleCreateOrUpdateParameters + from ._models_py3 import ModuleErrorInfo + from ._models_py3 import ModuleUpdateParameters + from ._models_py3 import NodeCount + from ._models_py3 import NodeCountProperties + from ._models_py3 import NodeCounts + from ._models_py3 import NonAzureQueryProperties + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ProxyResource + from ._models_py3 import PythonPackageCreateParameters + from ._models_py3 import PythonPackageUpdateParameters + from ._models_py3 import Resource + from ._models_py3 import RunAsCredentialAssociationProperty + from ._models_py3 import Runbook + from ._models_py3 import RunbookAssociationProperty + from ._models_py3 import RunbookCreateOrUpdateDraftParameters + from ._models_py3 import RunbookCreateOrUpdateDraftProperties + from ._models_py3 import RunbookCreateOrUpdateParameters + from ._models_py3 import RunbookDraft + from ._models_py3 import RunbookDraftUndoEditResult + from ._models_py3 import RunbookParameter + from ._models_py3 import RunbookUpdateParameters + from ._models_py3 import Schedule + from ._models_py3 import ScheduleAssociationProperty + from ._models_py3 import ScheduleCreateOrUpdateParameters + from ._models_py3 import ScheduleProperties + from ._models_py3 import ScheduleUpdateParameters + from ._models_py3 import Sku + from ._models_py3 import SoftareUpdateConfigurationRunTaskProperties + from ._models_py3 import SoftareUpdateConfigurationRunTasks + from ._models_py3 import SoftwareUpdateConfiguration + from ._models_py3 import SoftwareUpdateConfigurationCollectionItem + from ._models_py3 import SoftwareUpdateConfigurationListResult + from ._models_py3 import SoftwareUpdateConfigurationMachineRun + from ._models_py3 import SoftwareUpdateConfigurationMachineRunListResult + from ._models_py3 import SoftwareUpdateConfigurationRun + from ._models_py3 import SoftwareUpdateConfigurationRunListResult + from ._models_py3 import SoftwareUpdateConfigurationTasks + from ._models_py3 import SourceControl + from ._models_py3 import SourceControlCreateOrUpdateParameters + from ._models_py3 import SourceControlSecurityTokenProperties + from ._models_py3 import SourceControlSyncJob + from ._models_py3 import SourceControlSyncJobById + from ._models_py3 import SourceControlSyncJobCreateParameters + from ._models_py3 import SourceControlSyncJobStream + from ._models_py3 import SourceControlSyncJobStreamById + from ._models_py3 import SourceControlUpdateParameters + from ._models_py3 import Statistics + from ._models_py3 import TagSettingsProperties + from ._models_py3 import TargetProperties + from ._models_py3 import TaskProperties + from ._models_py3 import TestJob + from ._models_py3 import TestJobCreateParameters + from ._models_py3 import TrackedResource + from ._models_py3 import TypeField + from ._models_py3 import UpdateConfiguration + from ._models_py3 import UpdateConfigurationNavigation + from ._models_py3 import Usage + from ._models_py3 import UsageCounterName + from ._models_py3 import Variable + from ._models_py3 import VariableCreateOrUpdateParameters + from ._models_py3 import VariableUpdateParameters + from ._models_py3 import Watcher + from ._models_py3 import WatcherUpdateParameters + from ._models_py3 import Webhook + from ._models_py3 import WebhookCreateOrUpdateParameters + from ._models_py3 import WebhookUpdateParameters + from ._models_py3 import WindowsProperties except (SyntaxError, ImportError): - from .sku import Sku - from .automation_account import AutomationAccount - from .automation_account_create_or_update_parameters import AutomationAccountCreateOrUpdateParameters - from .operation_display import OperationDisplay - from .operation import Operation - from .statistics import Statistics - from .usage_counter_name import UsageCounterName - from .usage import Usage - 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 - from .connection_type_association_property import ConnectionTypeAssociationProperty - from .connection_create_or_update_parameters import ConnectionCreateOrUpdateParameters - from .connection import Connection - from .connection_update_parameters import ConnectionUpdateParameters - from .field_definition import FieldDefinition - from .connection_type import ConnectionType - from .connection_type_create_or_update_parameters import ConnectionTypeCreateOrUpdateParameters - from .credential_create_or_update_parameters import CredentialCreateOrUpdateParameters - from .credential import Credential - from .credential_update_parameters import CredentialUpdateParameters - from .content_hash import ContentHash - from .content_source import ContentSource - from .dsc_configuration_parameter import DscConfigurationParameter - from .dsc_configuration_create_or_update_parameters import DscConfigurationCreateOrUpdateParameters - from .dsc_configuration import DscConfiguration - from .dsc_configuration_update_parameters import DscConfigurationUpdateParameters - from .run_as_credential_association_property import RunAsCredentialAssociationProperty - from .hybrid_runbook_worker import HybridRunbookWorker - from .hybrid_runbook_worker_group import HybridRunbookWorkerGroup - from .hybrid_runbook_worker_group_update_parameters import HybridRunbookWorkerGroupUpdateParameters - from .schedule_association_property import ScheduleAssociationProperty - from .runbook_association_property import RunbookAssociationProperty - from .job_schedule import JobSchedule - from .job_schedule_create_parameters import JobScheduleCreateParameters - from .linked_workspace import LinkedWorkspace - from .activity_parameter_validation_set import ActivityParameterValidationSet - from .activity_parameter import ActivityParameter - from .activity_parameter_set import ActivityParameterSet - from .activity_output_type import ActivityOutputType - from .activity import Activity - from .module_error_info import ModuleErrorInfo - from .content_link import ContentLink - from .module import Module - from .module_create_or_update_parameters import ModuleCreateOrUpdateParameters - from .module_update_parameters import ModuleUpdateParameters - from .type_field import TypeField - from .advanced_schedule_monthly_occurrence import AdvancedScheduleMonthlyOccurrence - from .advanced_schedule import AdvancedSchedule - from .schedule_create_or_update_parameters import ScheduleCreateOrUpdateParameters - from .schedule_properties import ScheduleProperties - from .schedule import Schedule - from .schedule_update_parameters import ScheduleUpdateParameters - from .variable_create_or_update_parameters import VariableCreateOrUpdateParameters - from .variable import Variable - from .variable_update_parameters import VariableUpdateParameters - from .webhook import Webhook - from .webhook_update_parameters import WebhookUpdateParameters - from .webhook_create_or_update_parameters import WebhookCreateOrUpdateParameters - from .watcher import Watcher - from .watcher_update_parameters import WatcherUpdateParameters - from .windows_properties import WindowsProperties - from .linux_properties import LinuxProperties - from .tag_settings_properties import TagSettingsProperties - from .azure_query_properties import AzureQueryProperties - from .non_azure_query_properties import NonAzureQueryProperties - from .target_properties import TargetProperties - from .update_configuration import UpdateConfiguration - from .task_properties import TaskProperties - from .software_update_configuration_tasks import SoftwareUpdateConfigurationTasks - from .software_update_configuration import SoftwareUpdateConfiguration - from .collection_item_update_configuration import CollectionItemUpdateConfiguration - from .software_update_configuration_collection_item import SoftwareUpdateConfigurationCollectionItem - from .software_update_configuration_list_result import SoftwareUpdateConfigurationListResult - from .update_configuration_navigation import UpdateConfigurationNavigation - from .softare_update_configuration_run_task_properties import SoftareUpdateConfigurationRunTaskProperties - from .softare_update_configuration_run_tasks import SoftareUpdateConfigurationRunTasks - from .software_update_configuration_run import SoftwareUpdateConfigurationRun - from .software_update_configuration_run_list_result import SoftwareUpdateConfigurationRunListResult - from .job_navigation import JobNavigation - from .software_update_configuration_machine_run import SoftwareUpdateConfigurationMachineRun - from .software_update_configuration_machine_run_list_result import SoftwareUpdateConfigurationMachineRunListResult - from .source_control import SourceControl - from .source_control_security_token_properties import SourceControlSecurityTokenProperties - from .source_control_update_parameters import SourceControlUpdateParameters - from .source_control_create_or_update_parameters import SourceControlCreateOrUpdateParameters - from .source_control_sync_job import SourceControlSyncJob - from .source_control_sync_job_create_parameters import SourceControlSyncJobCreateParameters - from .source_control_sync_job_by_id import SourceControlSyncJobById - from .source_control_sync_job_stream import SourceControlSyncJobStream - from .source_control_sync_job_stream_by_id import SourceControlSyncJobStreamById - from .job_stream import JobStream - from .job_stream_list_result import JobStreamListResult - from .job import Job - from .job_collection_item import JobCollectionItem - from .job_create_parameters import JobCreateParameters - from .dsc_report_error import DscReportError - from .dsc_report_resource_navigation import DscReportResourceNavigation - from .dsc_report_resource import DscReportResource - from .dsc_meta_configuration import DscMetaConfiguration - from .dsc_node_report import DscNodeReport - from .agent_registration_keys import AgentRegistrationKeys - from .agent_registration import AgentRegistration - from .dsc_node_extension_handler_association_property import DscNodeExtensionHandlerAssociationProperty - from .dsc_node import DscNode - from .agent_registration_regenerate_key_parameter import AgentRegistrationRegenerateKeyParameter - from .dsc_node_update_parameters_properties import DscNodeUpdateParametersProperties - from .dsc_node_update_parameters import DscNodeUpdateParameters - from .dsc_configuration_association_property import DscConfigurationAssociationProperty - from .dsc_compilation_job import DscCompilationJob - from .dsc_compilation_job_create_parameters import DscCompilationJobCreateParameters - from .dsc_node_configuration import DscNodeConfiguration - from .dsc_node_configuration_create_or_update_parameters import DscNodeConfigurationCreateOrUpdateParameters - from .node_count_properties import NodeCountProperties - from .node_count import NodeCount - from .node_counts import NodeCounts - from .runbook_parameter import RunbookParameter - from .runbook_draft import RunbookDraft - from .runbook import Runbook - from .runbook_create_or_update_parameters import RunbookCreateOrUpdateParameters - from .runbook_update_parameters import RunbookUpdateParameters - from .runbook_draft_undo_edit_result import RunbookDraftUndoEditResult - from .test_job_create_parameters import TestJobCreateParameters - from .test_job import TestJob - from .runbook_create_or_update_draft_properties import RunbookCreateOrUpdateDraftProperties - from .runbook_create_or_update_draft_parameters import RunbookCreateOrUpdateDraftParameters - from .python_package_create_parameters import PythonPackageCreateParameters - from .python_package_update_parameters import PythonPackageUpdateParameters -from .automation_account_paged import AutomationAccountPaged -from .operation_paged import OperationPaged -from .statistics_paged import StatisticsPaged -from .usage_paged import UsagePaged -from .certificate_paged import CertificatePaged -from .connection_paged import ConnectionPaged -from .connection_type_paged import ConnectionTypePaged -from .credential_paged import CredentialPaged -from .dsc_configuration_paged import DscConfigurationPaged -from .hybrid_runbook_worker_group_paged import HybridRunbookWorkerGroupPaged -from .job_schedule_paged import JobSchedulePaged -from .activity_paged import ActivityPaged -from .module_paged import ModulePaged -from .type_field_paged import TypeFieldPaged -from .schedule_paged import SchedulePaged -from .variable_paged import VariablePaged -from .webhook_paged import WebhookPaged -from .watcher_paged import WatcherPaged -from .source_control_paged import SourceControlPaged -from .source_control_sync_job_paged import SourceControlSyncJobPaged -from .source_control_sync_job_stream_paged import SourceControlSyncJobStreamPaged -from .job_collection_item_paged import JobCollectionItemPaged -from .job_stream_paged import JobStreamPaged -from .dsc_node_paged import DscNodePaged -from .dsc_node_report_paged import DscNodeReportPaged -from .dsc_compilation_job_paged import DscCompilationJobPaged -from .dsc_node_configuration_paged import DscNodeConfigurationPaged -from .runbook_paged import RunbookPaged -from .automation_client_enums import ( + from ._models import Activity + from ._models import ActivityOutputType + from ._models import ActivityParameter + from ._models import ActivityParameterSet + from ._models import ActivityParameterValidationSet + from ._models import AdvancedSchedule + from ._models import AdvancedScheduleMonthlyOccurrence + from ._models import AgentRegistration + from ._models import AgentRegistrationKeys + from ._models import AgentRegistrationRegenerateKeyParameter + from ._models import AutomationAccount + from ._models import AutomationAccountCreateOrUpdateParameters + from ._models import AutomationAccountUpdateParameters + from ._models import AzureQueryProperties + from ._models import Certificate + from ._models import CertificateCreateOrUpdateParameters + from ._models import CertificateUpdateParameters + from ._models import CollectionItemUpdateConfiguration + from ._models import Connection + from ._models import ConnectionCreateOrUpdateParameters + from ._models import ConnectionType + from ._models import ConnectionTypeAssociationProperty + from ._models import ConnectionTypeCreateOrUpdateParameters + from ._models import ConnectionUpdateParameters + from ._models import ContentHash + from ._models import ContentLink + from ._models import ContentSource + from ._models import Credential + from ._models import CredentialCreateOrUpdateParameters + from ._models import CredentialUpdateParameters + from ._models import DscCompilationJob + from ._models import DscCompilationJobCreateParameters + from ._models import DscConfiguration + from ._models import DscConfigurationAssociationProperty + from ._models import DscConfigurationCreateOrUpdateParameters + from ._models import DscConfigurationParameter + from ._models import DscConfigurationUpdateParameters + from ._models import DscMetaConfiguration + from ._models import DscNode + from ._models import DscNodeConfiguration + from ._models import DscNodeConfigurationCreateOrUpdateParameters + from ._models import DscNodeExtensionHandlerAssociationProperty + from ._models import DscNodeReport + from ._models import DscNodeUpdateParameters + from ._models import DscNodeUpdateParametersProperties + from ._models import DscReportError + from ._models import DscReportResource + from ._models import DscReportResourceNavigation + from ._models import ErrorResponse, ErrorResponseException + from ._models import FieldDefinition + from ._models import HybridRunbookWorker + from ._models import HybridRunbookWorkerGroup + from ._models import HybridRunbookWorkerGroupUpdateParameters + from ._models import Job + from ._models import JobCollectionItem + from ._models import JobCreateParameters + from ._models import JobNavigation + from ._models import JobSchedule + from ._models import JobScheduleCreateParameters + from ._models import JobStream + from ._models import JobStreamListResult + from ._models import Key + from ._models import KeyListResult + from ._models import LinkedWorkspace + from ._models import LinuxProperties + from ._models import Module + from ._models import ModuleCreateOrUpdateParameters + from ._models import ModuleErrorInfo + from ._models import ModuleUpdateParameters + from ._models import NodeCount + from ._models import NodeCountProperties + from ._models import NodeCounts + from ._models import NonAzureQueryProperties + from ._models import Operation + from ._models import OperationDisplay + from ._models import ProxyResource + from ._models import PythonPackageCreateParameters + from ._models import PythonPackageUpdateParameters + from ._models import Resource + from ._models import RunAsCredentialAssociationProperty + from ._models import Runbook + from ._models import RunbookAssociationProperty + from ._models import RunbookCreateOrUpdateDraftParameters + from ._models import RunbookCreateOrUpdateDraftProperties + from ._models import RunbookCreateOrUpdateParameters + from ._models import RunbookDraft + from ._models import RunbookDraftUndoEditResult + from ._models import RunbookParameter + from ._models import RunbookUpdateParameters + from ._models import Schedule + from ._models import ScheduleAssociationProperty + from ._models import ScheduleCreateOrUpdateParameters + from ._models import ScheduleProperties + from ._models import ScheduleUpdateParameters + from ._models import Sku + from ._models import SoftareUpdateConfigurationRunTaskProperties + from ._models import SoftareUpdateConfigurationRunTasks + from ._models import SoftwareUpdateConfiguration + from ._models import SoftwareUpdateConfigurationCollectionItem + from ._models import SoftwareUpdateConfigurationListResult + from ._models import SoftwareUpdateConfigurationMachineRun + from ._models import SoftwareUpdateConfigurationMachineRunListResult + from ._models import SoftwareUpdateConfigurationRun + from ._models import SoftwareUpdateConfigurationRunListResult + from ._models import SoftwareUpdateConfigurationTasks + from ._models import SourceControl + from ._models import SourceControlCreateOrUpdateParameters + from ._models import SourceControlSecurityTokenProperties + from ._models import SourceControlSyncJob + from ._models import SourceControlSyncJobById + from ._models import SourceControlSyncJobCreateParameters + from ._models import SourceControlSyncJobStream + from ._models import SourceControlSyncJobStreamById + from ._models import SourceControlUpdateParameters + from ._models import Statistics + from ._models import TagSettingsProperties + from ._models import TargetProperties + from ._models import TaskProperties + from ._models import TestJob + from ._models import TestJobCreateParameters + from ._models import TrackedResource + from ._models import TypeField + from ._models import UpdateConfiguration + from ._models import UpdateConfigurationNavigation + from ._models import Usage + from ._models import UsageCounterName + from ._models import Variable + from ._models import VariableCreateOrUpdateParameters + from ._models import VariableUpdateParameters + from ._models import Watcher + from ._models import WatcherUpdateParameters + from ._models import Webhook + from ._models import WebhookCreateOrUpdateParameters + from ._models import WebhookUpdateParameters + from ._models import WindowsProperties +from ._paged_models import ActivityPaged +from ._paged_models import AutomationAccountPaged +from ._paged_models import CertificatePaged +from ._paged_models import ConnectionPaged +from ._paged_models import ConnectionTypePaged +from ._paged_models import CredentialPaged +from ._paged_models import DscCompilationJobPaged +from ._paged_models import DscConfigurationPaged +from ._paged_models import DscNodeConfigurationPaged +from ._paged_models import DscNodePaged +from ._paged_models import DscNodeReportPaged +from ._paged_models import HybridRunbookWorkerGroupPaged +from ._paged_models import JobCollectionItemPaged +from ._paged_models import JobSchedulePaged +from ._paged_models import JobStreamPaged +from ._paged_models import ModulePaged +from ._paged_models import OperationPaged +from ._paged_models import RunbookPaged +from ._paged_models import SchedulePaged +from ._paged_models import SourceControlPaged +from ._paged_models import SourceControlSyncJobPaged +from ._paged_models import SourceControlSyncJobStreamPaged +from ._paged_models import StatisticsPaged +from ._paged_models import TypeFieldPaged +from ._paged_models import UsagePaged +from ._paged_models import VariablePaged +from ._paged_models import WatcherPaged +from ._paged_models import WebhookPaged +from ._automation_client_enums import ( SkuNameEnum, AutomationAccountState, AutomationKeyName, @@ -342,141 +342,141 @@ ) __all__ = [ - 'Sku', + 'Activity', + 'ActivityOutputType', + 'ActivityParameter', + 'ActivityParameterSet', + 'ActivityParameterValidationSet', + 'AdvancedSchedule', + 'AdvancedScheduleMonthlyOccurrence', + 'AgentRegistration', + 'AgentRegistrationKeys', + 'AgentRegistrationRegenerateKeyParameter', 'AutomationAccount', 'AutomationAccountCreateOrUpdateParameters', - 'OperationDisplay', - 'Operation', - 'Statistics', - 'UsageCounterName', - 'Usage', - 'Key', - 'KeyListResult', 'AutomationAccountUpdateParameters', - 'ProxyResource', - 'Resource', - 'TrackedResource', - 'ErrorResponse', 'ErrorResponseException', - 'CertificateCreateOrUpdateParameters', + 'AzureQueryProperties', 'Certificate', + 'CertificateCreateOrUpdateParameters', 'CertificateUpdateParameters', - 'ConnectionTypeAssociationProperty', - 'ConnectionCreateOrUpdateParameters', + 'CollectionItemUpdateConfiguration', 'Connection', - 'ConnectionUpdateParameters', - 'FieldDefinition', + 'ConnectionCreateOrUpdateParameters', 'ConnectionType', + 'ConnectionTypeAssociationProperty', 'ConnectionTypeCreateOrUpdateParameters', - 'CredentialCreateOrUpdateParameters', - 'Credential', - 'CredentialUpdateParameters', + 'ConnectionUpdateParameters', 'ContentHash', + 'ContentLink', 'ContentSource', - 'DscConfigurationParameter', - 'DscConfigurationCreateOrUpdateParameters', + 'Credential', + 'CredentialCreateOrUpdateParameters', + 'CredentialUpdateParameters', + 'DscCompilationJob', + 'DscCompilationJobCreateParameters', 'DscConfiguration', + 'DscConfigurationAssociationProperty', + 'DscConfigurationCreateOrUpdateParameters', + 'DscConfigurationParameter', 'DscConfigurationUpdateParameters', - 'RunAsCredentialAssociationProperty', + 'DscMetaConfiguration', + 'DscNode', + 'DscNodeConfiguration', + 'DscNodeConfigurationCreateOrUpdateParameters', + 'DscNodeExtensionHandlerAssociationProperty', + 'DscNodeReport', + 'DscNodeUpdateParameters', + 'DscNodeUpdateParametersProperties', + 'DscReportError', + 'DscReportResource', + 'DscReportResourceNavigation', + 'ErrorResponse', 'ErrorResponseException', + 'FieldDefinition', 'HybridRunbookWorker', 'HybridRunbookWorkerGroup', 'HybridRunbookWorkerGroupUpdateParameters', - 'ScheduleAssociationProperty', - 'RunbookAssociationProperty', + 'Job', + 'JobCollectionItem', + 'JobCreateParameters', + 'JobNavigation', 'JobSchedule', 'JobScheduleCreateParameters', + 'JobStream', + 'JobStreamListResult', + 'Key', + 'KeyListResult', 'LinkedWorkspace', - 'ActivityParameterValidationSet', - 'ActivityParameter', - 'ActivityParameterSet', - 'ActivityOutputType', - 'Activity', - 'ModuleErrorInfo', - 'ContentLink', + 'LinuxProperties', 'Module', 'ModuleCreateOrUpdateParameters', + 'ModuleErrorInfo', 'ModuleUpdateParameters', - 'TypeField', - 'AdvancedScheduleMonthlyOccurrence', - 'AdvancedSchedule', + 'NodeCount', + 'NodeCountProperties', + 'NodeCounts', + 'NonAzureQueryProperties', + 'Operation', + 'OperationDisplay', + 'ProxyResource', + 'PythonPackageCreateParameters', + 'PythonPackageUpdateParameters', + 'Resource', + 'RunAsCredentialAssociationProperty', + 'Runbook', + 'RunbookAssociationProperty', + 'RunbookCreateOrUpdateDraftParameters', + 'RunbookCreateOrUpdateDraftProperties', + 'RunbookCreateOrUpdateParameters', + 'RunbookDraft', + 'RunbookDraftUndoEditResult', + 'RunbookParameter', + 'RunbookUpdateParameters', + 'Schedule', + 'ScheduleAssociationProperty', 'ScheduleCreateOrUpdateParameters', 'ScheduleProperties', - 'Schedule', 'ScheduleUpdateParameters', - 'VariableCreateOrUpdateParameters', - 'Variable', - 'VariableUpdateParameters', - 'Webhook', - 'WebhookUpdateParameters', - 'WebhookCreateOrUpdateParameters', - 'Watcher', - 'WatcherUpdateParameters', - 'WindowsProperties', - 'LinuxProperties', - 'TagSettingsProperties', - 'AzureQueryProperties', - 'NonAzureQueryProperties', - 'TargetProperties', - 'UpdateConfiguration', - 'TaskProperties', - 'SoftwareUpdateConfigurationTasks', + 'Sku', + 'SoftareUpdateConfigurationRunTaskProperties', + 'SoftareUpdateConfigurationRunTasks', 'SoftwareUpdateConfiguration', - 'CollectionItemUpdateConfiguration', 'SoftwareUpdateConfigurationCollectionItem', 'SoftwareUpdateConfigurationListResult', - 'UpdateConfigurationNavigation', - 'SoftareUpdateConfigurationRunTaskProperties', - 'SoftareUpdateConfigurationRunTasks', - 'SoftwareUpdateConfigurationRun', - 'SoftwareUpdateConfigurationRunListResult', - 'JobNavigation', 'SoftwareUpdateConfigurationMachineRun', 'SoftwareUpdateConfigurationMachineRunListResult', + 'SoftwareUpdateConfigurationRun', + 'SoftwareUpdateConfigurationRunListResult', + 'SoftwareUpdateConfigurationTasks', 'SourceControl', - 'SourceControlSecurityTokenProperties', - 'SourceControlUpdateParameters', 'SourceControlCreateOrUpdateParameters', + 'SourceControlSecurityTokenProperties', 'SourceControlSyncJob', - 'SourceControlSyncJobCreateParameters', 'SourceControlSyncJobById', + 'SourceControlSyncJobCreateParameters', 'SourceControlSyncJobStream', 'SourceControlSyncJobStreamById', - 'JobStream', - 'JobStreamListResult', - 'Job', - 'JobCollectionItem', - 'JobCreateParameters', - 'DscReportError', - 'DscReportResourceNavigation', - 'DscReportResource', - 'DscMetaConfiguration', - 'DscNodeReport', - 'AgentRegistrationKeys', - 'AgentRegistration', - 'DscNodeExtensionHandlerAssociationProperty', - 'DscNode', - 'AgentRegistrationRegenerateKeyParameter', - 'DscNodeUpdateParametersProperties', - 'DscNodeUpdateParameters', - 'DscConfigurationAssociationProperty', - 'DscCompilationJob', - 'DscCompilationJobCreateParameters', - 'DscNodeConfiguration', - 'DscNodeConfigurationCreateOrUpdateParameters', - 'NodeCountProperties', - 'NodeCount', - 'NodeCounts', - 'RunbookParameter', - 'RunbookDraft', - 'Runbook', - 'RunbookCreateOrUpdateParameters', - 'RunbookUpdateParameters', - 'RunbookDraftUndoEditResult', - 'TestJobCreateParameters', + 'SourceControlUpdateParameters', + 'Statistics', + 'TagSettingsProperties', + 'TargetProperties', + 'TaskProperties', 'TestJob', - 'RunbookCreateOrUpdateDraftProperties', - 'RunbookCreateOrUpdateDraftParameters', - 'PythonPackageCreateParameters', - 'PythonPackageUpdateParameters', + 'TestJobCreateParameters', + 'TrackedResource', + 'TypeField', + 'UpdateConfiguration', + 'UpdateConfigurationNavigation', + 'Usage', + 'UsageCounterName', + 'Variable', + 'VariableCreateOrUpdateParameters', + 'VariableUpdateParameters', + 'Watcher', + 'WatcherUpdateParameters', + 'Webhook', + 'WebhookCreateOrUpdateParameters', + 'WebhookUpdateParameters', + 'WindowsProperties', 'AutomationAccountPaged', 'OperationPaged', 'StatisticsPaged', diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_automation_client_enums.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_automation_client_enums.py new file mode 100644 index 000000000000..a602ca251857 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_automation_client_enums.py @@ -0,0 +1,288 @@ +# 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 SkuNameEnum(str, Enum): + + free = "Free" + basic = "Basic" + + +class AutomationAccountState(str, Enum): + + ok = "Ok" + unavailable = "Unavailable" + suspended = "Suspended" + + +class AutomationKeyName(str, Enum): + + primary = "Primary" + secondary = "Secondary" + + +class AutomationKeyPermissions(str, Enum): + + read = "Read" + full = "Full" + + +class ContentSourceType(str, Enum): + + embedded_content = "embeddedContent" + uri = "uri" + + +class DscConfigurationProvisioningState(str, Enum): + + succeeded = "Succeeded" + + +class DscConfigurationState(str, Enum): + + new = "New" + edit = "Edit" + published = "Published" + + +class GroupTypeEnum(str, Enum): + + user = "User" + system = "System" + + +class ModuleProvisioningState(str, Enum): + + created = "Created" + creating = "Creating" + starting_import_module_runbook = "StartingImportModuleRunbook" + running_import_module_runbook = "RunningImportModuleRunbook" + content_retrieved = "ContentRetrieved" + content_downloaded = "ContentDownloaded" + content_validated = "ContentValidated" + connection_type_imported = "ConnectionTypeImported" + content_stored = "ContentStored" + module_data_stored = "ModuleDataStored" + activities_stored = "ActivitiesStored" + module_import_runbook_complete = "ModuleImportRunbookComplete" + succeeded = "Succeeded" + failed = "Failed" + cancelled = "Cancelled" + updating = "Updating" + + +class ScheduleDay(str, Enum): + + monday = "Monday" + tuesday = "Tuesday" + wednesday = "Wednesday" + thursday = "Thursday" + friday = "Friday" + saturday = "Saturday" + sunday = "Sunday" + + +class ScheduleFrequency(str, Enum): + + one_time = "OneTime" + day = "Day" + hour = "Hour" + week = "Week" + month = "Month" + minute = "Minute" #: The minimum allowed interval for Minute schedules is 15 minutes. + + +class OperatingSystemType(str, Enum): + + windows = "Windows" + linux = "Linux" + + +class WindowsUpdateClasses(str, Enum): + + unclassified = "Unclassified" + critical = "Critical" + security = "Security" + update_rollup = "UpdateRollup" + feature_pack = "FeaturePack" + service_pack = "ServicePack" + definition = "Definition" + tools = "Tools" + updates = "Updates" + + +class LinuxUpdateClasses(str, Enum): + + unclassified = "Unclassified" + critical = "Critical" + security = "Security" + other = "Other" + + +class TagOperators(str, Enum): + + all = "All" + any = "Any" + + +class SourceType(str, Enum): + + vso_git = "VsoGit" + vso_tfvc = "VsoTfvc" + git_hub = "GitHub" + + +class TokenType(str, Enum): + + personal_access_token = "PersonalAccessToken" + oauth = "Oauth" + + +class ProvisioningState(str, Enum): + + completed = "Completed" + failed = "Failed" + running = "Running" + + +class SyncType(str, Enum): + + partial_sync = "PartialSync" + full_sync = "FullSync" + + +class StreamType(str, Enum): + + error = "Error" + output = "Output" + + +class JobStreamType(str, Enum): + + progress = "Progress" + output = "Output" + warning = "Warning" + error = "Error" + debug = "Debug" + verbose = "Verbose" + any = "Any" + + +class JobStatus(str, Enum): + + new = "New" + activating = "Activating" + running = "Running" + completed = "Completed" + failed = "Failed" + stopped = "Stopped" + blocked = "Blocked" + suspended = "Suspended" + disconnected = "Disconnected" + suspending = "Suspending" + stopping = "Stopping" + resuming = "Resuming" + removing = "Removing" + + +class JobProvisioningState(str, Enum): + + failed = "Failed" + succeeded = "Succeeded" + suspended = "Suspended" + processing = "Processing" + + +class AgentRegistrationKeyName(str, Enum): + + primary = "primary" + secondary = "secondary" + + +class RunbookTypeEnum(str, Enum): + + script = "Script" + graph = "Graph" + power_shell_workflow = "PowerShellWorkflow" + power_shell = "PowerShell" + graph_power_shell_workflow = "GraphPowerShellWorkflow" + graph_power_shell = "GraphPowerShell" + + +class RunbookState(str, Enum): + + new = "New" + edit = "Edit" + published = "Published" + + +class RunbookProvisioningState(str, Enum): + + succeeded = "Succeeded" + + +class HttpStatusCode(str, Enum): + + continue_enum = "Continue" + switching_protocols = "SwitchingProtocols" + ok = "OK" + created = "Created" + accepted = "Accepted" + non_authoritative_information = "NonAuthoritativeInformation" + no_content = "NoContent" + reset_content = "ResetContent" + partial_content = "PartialContent" + multiple_choices = "MultipleChoices" + ambiguous = "Ambiguous" + moved_permanently = "MovedPermanently" + moved = "Moved" + found = "Found" + redirect = "Redirect" + see_other = "SeeOther" + redirect_method = "RedirectMethod" + not_modified = "NotModified" + use_proxy = "UseProxy" + unused = "Unused" + temporary_redirect = "TemporaryRedirect" + redirect_keep_verb = "RedirectKeepVerb" + bad_request = "BadRequest" + unauthorized = "Unauthorized" + payment_required = "PaymentRequired" + forbidden = "Forbidden" + not_found = "NotFound" + method_not_allowed = "MethodNotAllowed" + not_acceptable = "NotAcceptable" + proxy_authentication_required = "ProxyAuthenticationRequired" + request_timeout = "RequestTimeout" + conflict = "Conflict" + gone = "Gone" + length_required = "LengthRequired" + precondition_failed = "PreconditionFailed" + request_entity_too_large = "RequestEntityTooLarge" + request_uri_too_long = "RequestUriTooLong" + unsupported_media_type = "UnsupportedMediaType" + requested_range_not_satisfiable = "RequestedRangeNotSatisfiable" + expectation_failed = "ExpectationFailed" + upgrade_required = "UpgradeRequired" + internal_server_error = "InternalServerError" + not_implemented = "NotImplemented" + bad_gateway = "BadGateway" + service_unavailable = "ServiceUnavailable" + gateway_timeout = "GatewayTimeout" + http_version_not_supported = "HttpVersionNotSupported" + + +class CountType(str, Enum): + + status = "status" + nodeconfiguration = "nodeconfiguration" diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_models.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_models.py new file mode 100644 index 000000000000..df0280455843 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_models.py @@ -0,0 +1,5338 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class Activity(Model): + """Definition of the activity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Gets or sets the id of the resource. + :type id: str + :ivar name: Gets the name of the activity. + :vartype name: str + :param definition: Gets or sets the user name of the activity. + :type definition: str + :param parameter_sets: Gets or sets the parameter sets of the activity. + :type parameter_sets: + list[~azure.mgmt.automation.models.ActivityParameterSet] + :param output_types: Gets or sets the output types of the activity. + :type output_types: list[~azure.mgmt.automation.models.ActivityOutputType] + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'definition': {'key': 'properties.definition', 'type': 'str'}, + 'parameter_sets': {'key': 'properties.parameterSets', 'type': '[ActivityParameterSet]'}, + 'output_types': {'key': 'properties.outputTypes', 'type': '[ActivityOutputType]'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Activity, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.definition = kwargs.get('definition', None) + self.parameter_sets = kwargs.get('parameter_sets', None) + self.output_types = kwargs.get('output_types', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + + +class ActivityOutputType(Model): + """Definition of the activity output type. + + :param name: Gets or sets the name of the activity output type. + :type name: str + :param type: Gets or sets the type of the activity output type. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ActivityOutputType, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class ActivityParameter(Model): + """Definition of the activity parameter. + + :param name: Gets or sets the name of the activity parameter. + :type name: str + :param type: Gets or sets the type of the activity parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value that indicates true if + the parameter is required. If the value is false, the parameter is + optional. + :type is_mandatory: bool + :param is_dynamic: Gets or sets a Boolean value that indicates true if the + parameter is dynamic. + :type is_dynamic: bool + :param position: Gets or sets the position of the activity parameter. + :type position: long + :param value_from_pipeline: Gets or sets a Boolean value that indicates + true if the parameter can take values from the incoming pipeline objects. + This setting is used if the cmdlet must access the complete input object. + false indicates that the parameter cannot take values from the complete + input object. + :type value_from_pipeline: bool + :param value_from_pipeline_by_property_name: Gets or sets a Boolean value + that indicates true if the parameter can be filled from a property of the + incoming pipeline object that has the same name as this parameter. false + indicates that the parameter cannot be filled from the incoming pipeline + object property with the same name. + :type value_from_pipeline_by_property_name: bool + :param value_from_remaining_arguments: Gets or sets a Boolean value that + indicates true if the cmdlet parameter accepts all the remaining + command-line arguments that are associated with this parameter in the form + of an array. false if the cmdlet parameter does not accept all the + remaining argument values. + :type value_from_remaining_arguments: bool + :param description: Gets or sets the description of the activity + parameter. + :type description: str + :param validation_set: Gets or sets the validation set of activity + parameter. + :type validation_set: + list[~azure.mgmt.automation.models.ActivityParameterValidationSet] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'is_dynamic': {'key': 'isDynamic', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'long'}, + 'value_from_pipeline': {'key': 'valueFromPipeline', 'type': 'bool'}, + 'value_from_pipeline_by_property_name': {'key': 'valueFromPipelineByPropertyName', 'type': 'bool'}, + 'value_from_remaining_arguments': {'key': 'valueFromRemainingArguments', 'type': 'bool'}, + 'description': {'key': 'description', 'type': 'str'}, + 'validation_set': {'key': 'validationSet', 'type': '[ActivityParameterValidationSet]'}, + } + + def __init__(self, **kwargs): + super(ActivityParameter, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.is_mandatory = kwargs.get('is_mandatory', None) + self.is_dynamic = kwargs.get('is_dynamic', None) + self.position = kwargs.get('position', None) + self.value_from_pipeline = kwargs.get('value_from_pipeline', None) + self.value_from_pipeline_by_property_name = kwargs.get('value_from_pipeline_by_property_name', None) + self.value_from_remaining_arguments = kwargs.get('value_from_remaining_arguments', None) + self.description = kwargs.get('description', None) + self.validation_set = kwargs.get('validation_set', None) + + +class ActivityParameterSet(Model): + """Definition of the activity parameter set. + + :param name: Gets or sets the name of the activity parameter set. + :type name: str + :param parameters: Gets or sets the parameters of the activity parameter + set. + :type parameters: list[~azure.mgmt.automation.models.ActivityParameter] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[ActivityParameter]'}, + } + + def __init__(self, **kwargs): + super(ActivityParameterSet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.parameters = kwargs.get('parameters', None) + + +class ActivityParameterValidationSet(Model): + """Definition of the activity parameter validation set. + + :param member_value: Gets or sets the name of the activity parameter + validation set member. + :type member_value: str + """ + + _attribute_map = { + 'member_value': {'key': 'memberValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ActivityParameterValidationSet, self).__init__(**kwargs) + self.member_value = kwargs.get('member_value', None) + + +class AdvancedSchedule(Model): + """The properties of the create Advanced Schedule. + + :param week_days: Days of the week that the job should execute on. + :type week_days: list[str] + :param month_days: Days of the month that the job should execute on. Must + be between 1 and 31. + :type month_days: list[int] + :param monthly_occurrences: Occurrences of days within a month. + :type monthly_occurrences: + list[~azure.mgmt.automation.models.AdvancedScheduleMonthlyOccurrence] + """ + + _attribute_map = { + 'week_days': {'key': 'weekDays', 'type': '[str]'}, + 'month_days': {'key': 'monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'monthlyOccurrences', 'type': '[AdvancedScheduleMonthlyOccurrence]'}, + } + + def __init__(self, **kwargs): + super(AdvancedSchedule, self).__init__(**kwargs) + self.week_days = kwargs.get('week_days', None) + self.month_days = kwargs.get('month_days', None) + self.monthly_occurrences = kwargs.get('monthly_occurrences', None) + + +class AdvancedScheduleMonthlyOccurrence(Model): + """The properties of the create advanced schedule monthly occurrence. + + :param occurrence: Occurrence of the week within the month. Must be + between 1 and 5 + :type occurrence: int + :param day: Day of the occurrence. Must be one of monday, tuesday, + wednesday, thursday, friday, saturday, sunday. Possible values include: + 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', + 'Sunday' + :type day: str or ~azure.mgmt.automation.models.ScheduleDay + """ + + _attribute_map = { + 'occurrence': {'key': 'occurrence', 'type': 'int'}, + 'day': {'key': 'day', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AdvancedScheduleMonthlyOccurrence, self).__init__(**kwargs) + self.occurrence = kwargs.get('occurrence', None) + self.day = kwargs.get('day', None) + + +class AgentRegistration(Model): + """Definition of the agent registration information type. + + :param dsc_meta_configuration: Gets or sets the dsc meta configuration. + :type dsc_meta_configuration: str + :param endpoint: Gets or sets the dsc server endpoint. + :type endpoint: str + :param keys: Gets or sets the agent registration keys. + :type keys: ~azure.mgmt.automation.models.AgentRegistrationKeys + :param id: Gets or sets the id. + :type id: str + """ + + _attribute_map = { + 'dsc_meta_configuration': {'key': 'dscMetaConfiguration', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'keys': {'key': 'keys', 'type': 'AgentRegistrationKeys'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AgentRegistration, self).__init__(**kwargs) + self.dsc_meta_configuration = kwargs.get('dsc_meta_configuration', None) + self.endpoint = kwargs.get('endpoint', None) + self.keys = kwargs.get('keys', None) + self.id = kwargs.get('id', None) + + +class AgentRegistrationKeys(Model): + """Definition of the agent registration keys. + + :param primary: Gets or sets the primary key. + :type primary: str + :param secondary: Gets or sets the secondary key. + :type secondary: str + """ + + _attribute_map = { + 'primary': {'key': 'primary', 'type': 'str'}, + 'secondary': {'key': 'secondary', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AgentRegistrationKeys, self).__init__(**kwargs) + self.primary = kwargs.get('primary', None) + self.secondary = kwargs.get('secondary', None) + + +class AgentRegistrationRegenerateKeyParameter(Model): + """The parameters supplied to the regenerate keys operation. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. Gets or sets the agent registration key name - + primary or secondary. Possible values include: 'primary', 'secondary' + :type key_name: str or + ~azure.mgmt.automation.models.AgentRegistrationKeyName + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AgentRegistrationRegenerateKeyParameter, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class Resource(Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class AutomationAccount(TrackedResource): + """Definition of the automation account type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param sku: Gets or sets the SKU of account. + :type sku: ~azure.mgmt.automation.models.Sku + :param last_modified_by: Gets or sets the last modified by. + :type last_modified_by: str + :ivar state: Gets status of account. Possible values include: 'Ok', + 'Unavailable', 'Suspended' + :vartype state: str or + ~azure.mgmt.automation.models.AutomationAccountState + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AutomationAccount, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.state = None + self.creation_time = None + self.last_modified_time = None + self.description = kwargs.get('description', None) + self.etag = kwargs.get('etag', None) + + +class AutomationAccountCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update automation account + operation. + + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(AutomationAccountCreateOrUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class AutomationAccountUpdateParameters(Model): + """The parameters supplied to the update automation account operation. + + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(AutomationAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class AzureQueryProperties(Model): + """Azure query for the update configuration. + + :param scope: List of Subscription or Resource Group ARM Ids. + :type scope: list[str] + :param locations: List of locations to scope the query to. + :type locations: list[str] + :param tag_settings: Tag settings for the VM. + :type tag_settings: ~azure.mgmt.automation.models.TagSettingsProperties + """ + + _attribute_map = { + 'scope': {'key': 'scope', 'type': '[str]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'tag_settings': {'key': 'tagSettings', 'type': 'TagSettingsProperties'}, + } + + def __init__(self, **kwargs): + super(AzureQueryProperties, self).__init__(**kwargs) + self.scope = kwargs.get('scope', None) + self.locations = kwargs.get('locations', None) + self.tag_settings = kwargs.get('tag_settings', None) + + +class ProxyResource(Resource): + """ARM proxy resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class Certificate(ProxyResource): + """Definition of the certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar thumbprint: Gets the thumbprint of the certificate. + :vartype thumbprint: str + :ivar expiry_time: Gets the expiry time of the certificate. + :vartype expiry_time: datetime + :ivar is_exportable: Gets the is exportable flag of the certificate. + :vartype is_exportable: bool + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'expiry_time': {'readonly': True}, + 'is_exportable': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'is_exportable': {'key': 'properties.isExportable', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Certificate, self).__init__(**kwargs) + self.thumbprint = None + self.expiry_time = None + self.is_exportable = None + self.creation_time = None + self.last_modified_time = None + self.description = kwargs.get('description', None) + + +class CertificateCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update or replace certificate + operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the certificate. + :type name: str + :param base64_value: Required. Gets or sets the base64 encoded value of + the certificate. + :type base64_value: str + :param description: Gets or sets the description of the certificate. + :type description: str + :param thumbprint: Gets or sets the thumbprint of the certificate. + :type thumbprint: str + :param is_exportable: Gets or sets the is exportable flag of the + certificate. + :type is_exportable: bool + """ + + _validation = { + 'name': {'required': True}, + 'base64_value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'base64_value': {'key': 'properties.base64Value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'is_exportable': {'key': 'properties.isExportable', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CertificateCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.base64_value = kwargs.get('base64_value', None) + self.description = kwargs.get('description', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.is_exportable = kwargs.get('is_exportable', None) + + +class CertificateUpdateParameters(Model): + """The parameters supplied to the update certificate operation. + + :param name: Gets or sets the name of the certificate. + :type name: str + :param description: Gets or sets the description of the certificate. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CertificateUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CollectionItemUpdateConfiguration(Model): + """object returned when requesting a collection of software update + configuration. + + :param azure_virtual_machines: List of azure resource Ids for azure + virtual machines targeted by the software update configuration. + :type azure_virtual_machines: list[str] + :param duration: Maximum time allowed for the software update + configuration run. Duration needs to be specified using the format + PT[n]H[n]M[n]S as per ISO8601 + :type duration: timedelta + """ + + _attribute_map = { + 'azure_virtual_machines': {'key': 'azureVirtualMachines', 'type': '[str]'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(CollectionItemUpdateConfiguration, self).__init__(**kwargs) + self.azure_virtual_machines = kwargs.get('azure_virtual_machines', None) + self.duration = kwargs.get('duration', None) + + +class Connection(ProxyResource): + """Definition of the connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param connection_type: Gets or sets the connectionType of the connection. + :type connection_type: + ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :ivar field_definition_values: Gets the field definition values of the + connection. + :vartype field_definition_values: dict[str, str] + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'field_definition_values': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'ConnectionTypeAssociationProperty'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Connection, self).__init__(**kwargs) + self.connection_type = kwargs.get('connection_type', None) + self.field_definition_values = None + self.creation_time = None + self.last_modified_time = None + self.description = kwargs.get('description', None) + + +class ConnectionCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update connection operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the connection. + :type name: str + :param description: Gets or sets the description of the connection. + :type description: str + :param connection_type: Required. Gets or sets the connectionType of the + connection. + :type connection_type: + ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :param field_definition_values: Gets or sets the field definition + properties of the connection. + :type field_definition_values: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'connection_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'ConnectionTypeAssociationProperty'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ConnectionCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.connection_type = kwargs.get('connection_type', None) + self.field_definition_values = kwargs.get('field_definition_values', None) + + +class ConnectionType(Model): + """Definition of the connection type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets the name of the connection type. + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param is_global: Gets or sets a Boolean value to indicate if the + connection type is global. + :type is_global: bool + :ivar field_definitions: Gets the field definitions of the connection + type. + :vartype field_definitions: dict[str, + ~azure.mgmt.automation.models.FieldDefinition] + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'field_definitions': {'readonly': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'field_definitions': {'key': 'properties.fieldDefinitions', 'type': '{FieldDefinition}'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectionType, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.is_global = kwargs.get('is_global', None) + self.field_definitions = None + self.creation_time = None + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + + +class ConnectionTypeAssociationProperty(Model): + """The connection type property associated with the entity. + + :param name: Gets or sets the name of the connection type. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectionTypeAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class ConnectionTypeCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update connection type operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the connection type. + :type name: str + :param is_global: Gets or sets a Boolean value to indicate if the + connection type is global. + :type is_global: bool + :param field_definitions: Required. Gets or sets the field definitions of + the connection type. + :type field_definitions: dict[str, + ~azure.mgmt.automation.models.FieldDefinition] + """ + + _validation = { + 'name': {'required': True}, + 'field_definitions': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'field_definitions': {'key': 'properties.fieldDefinitions', 'type': '{FieldDefinition}'}, + } + + def __init__(self, **kwargs): + super(ConnectionTypeCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_global = kwargs.get('is_global', None) + self.field_definitions = kwargs.get('field_definitions', None) + + +class ConnectionUpdateParameters(Model): + """The parameters supplied to the update connection operation. + + :param name: Gets or sets the name of the connection. + :type name: str + :param description: Gets or sets the description of the connection. + :type description: str + :param field_definition_values: Gets or sets the field definition values + of the connection. + :type field_definition_values: dict[str, str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ConnectionUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.field_definition_values = kwargs.get('field_definition_values', None) + + +class ContentHash(Model): + """Definition of the runbook property type. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. Gets or sets the content hash algorithm used + to hash the content. + :type algorithm: str + :param value: Required. Gets or sets expected hash value of the content. + :type value: str + """ + + _validation = { + 'algorithm': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'algorithm', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContentHash, self).__init__(**kwargs) + self.algorithm = kwargs.get('algorithm', None) + self.value = kwargs.get('value', None) + + +class ContentLink(Model): + """Definition of the content link. + + :param uri: Gets or sets the uri of the runbook content. + :type uri: str + :param content_hash: Gets or sets the hash. + :type content_hash: ~azure.mgmt.automation.models.ContentHash + :param version: Gets or sets the version of the content. + :type version: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_hash': {'key': 'contentHash', 'type': 'ContentHash'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContentLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_hash = kwargs.get('content_hash', None) + self.version = kwargs.get('version', None) + + +class ContentSource(Model): + """Definition of the content source. + + :param hash: Gets or sets the hash. + :type hash: ~azure.mgmt.automation.models.ContentHash + :param type: Gets or sets the content source type. Possible values + include: 'embeddedContent', 'uri' + :type type: str or ~azure.mgmt.automation.models.ContentSourceType + :param value: Gets or sets the value of the content. This is based on the + content source type. + :type value: str + :param version: Gets or sets the version of the content. + :type version: str + """ + + _attribute_map = { + 'hash': {'key': 'hash', 'type': 'ContentHash'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContentSource, self).__init__(**kwargs) + self.hash = kwargs.get('hash', None) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) + self.version = kwargs.get('version', None) + + +class Credential(ProxyResource): + """Definition of the credential. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar user_name: Gets the user name of the credential. + :vartype user_name: str + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'user_name': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Credential, self).__init__(**kwargs) + self.user_name = None + self.creation_time = None + self.last_modified_time = None + self.description = kwargs.get('description', None) + + +class CredentialCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update credential operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the credential. + :type name: str + :param user_name: Required. Gets or sets the user name of the credential. + :type user_name: str + :param password: Required. Gets or sets the password of the credential. + :type password: str + :param description: Gets or sets the description of the credential. + :type description: str + """ + + _validation = { + 'name': {'required': True}, + 'user_name': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CredentialCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) + self.description = kwargs.get('description', None) + + +class CredentialUpdateParameters(Model): + """The parameters supplied to the Update credential operation. + + :param name: Gets or sets the name of the credential. + :type name: str + :param user_name: Gets or sets the user name of the credential. + :type user_name: str + :param password: Gets or sets the password of the credential. + :type password: str + :param description: Gets or sets the description of the credential. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CredentialUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) + self.description = kwargs.get('description', None) + + +class DscCompilationJob(ProxyResource): + """Definition of the Dsc Compilation job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param configuration: Gets or sets the configuration. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :ivar started_by: Gets the compilation job started by. + :vartype started_by: str + :ivar job_id: Gets the id of the job. + :vartype job_id: str + :ivar creation_time: Gets the creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: The current provisioning state of the job. + Possible values include: 'Failed', 'Succeeded', 'Suspended', 'Processing' + :type provisioning_state: str or + ~azure.mgmt.automation.models.JobProvisioningState + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + :param status: Gets or sets the status of the job. Possible values + include: 'New', 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', + 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping', + 'Resuming', 'Removing' + :type status: str or ~azure.mgmt.automation.models.JobStatus + :param status_details: Gets or sets the status details of the job. + :type status_details: str + :ivar start_time: Gets the start time of the job. + :vartype start_time: datetime + :ivar end_time: Gets the end time of the job. + :vartype end_time: datetime + :ivar exception: Gets the exception of the job. + :vartype exception: str + :ivar last_modified_time: Gets the last modified time of the job. + :vartype last_modified_time: datetime + :ivar last_status_modified_time: Gets the last status modified time of the + job. + :vartype last_status_modified_time: datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'started_by': {'readonly': True}, + 'job_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'exception': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_status_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'properties.lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DscCompilationJob, self).__init__(**kwargs) + self.configuration = kwargs.get('configuration', None) + self.started_by = None + self.job_id = None + self.creation_time = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.run_on = kwargs.get('run_on', None) + self.status = kwargs.get('status', None) + self.status_details = kwargs.get('status_details', None) + self.start_time = None + self.end_time = None + self.exception = None + self.last_modified_time = None + self.last_status_modified_time = None + self.parameters = kwargs.get('parameters', None) + + +class DscCompilationJobCreateParameters(Model): + """The parameters supplied to the create compilation job operation. + + All required parameters must be populated in order to send to Azure. + + :param configuration: Required. Gets or sets the configuration. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param increment_node_configuration_build: If a new build version of + NodeConfiguration is required. + :type increment_node_configuration_build: bool + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'configuration': {'required': True}, + } + + _attribute_map = { + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DscCompilationJobCreateParameters, self).__init__(**kwargs) + self.configuration = kwargs.get('configuration', None) + self.parameters = kwargs.get('parameters', None) + self.increment_node_configuration_build = kwargs.get('increment_node_configuration_build', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class DscConfiguration(TrackedResource): + """Definition of the configuration type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param provisioning_state: Gets or sets the provisioning state of the + configuration. Possible values include: 'Succeeded' + :type provisioning_state: str or + ~azure.mgmt.automation.models.DscConfigurationProvisioningState + :param job_count: Gets or sets the job count of the configuration. + :type job_count: int + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.DscConfigurationParameter] + :param source: Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param state: Gets or sets the state of the configuration. Possible values + include: 'New', 'Edit', 'Published' + :type state: str or ~azure.mgmt.automation.models.DscConfigurationState + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param node_configuration_count: Gets the number of compiled node + configurations. + :type node_configuration_count: int + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'DscConfigurationProvisioningState'}, + 'job_count': {'key': 'properties.jobCount', 'type': 'int'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'node_configuration_count': {'key': 'properties.nodeConfigurationCount', 'type': 'int'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscConfiguration, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.job_count = kwargs.get('job_count', None) + self.parameters = kwargs.get('parameters', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.log_verbose = kwargs.get('log_verbose', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.node_configuration_count = kwargs.get('node_configuration_count', None) + self.description = kwargs.get('description', None) + self.etag = kwargs.get('etag', None) + + +class DscConfigurationAssociationProperty(Model): + """The Dsc configuration property associated with the entity. + + :param name: Gets or sets the name of the Dsc configuration. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscConfigurationAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class DscConfigurationCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update configuration operation. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.DscConfigurationParameter] + :param description: Gets or sets the description of the configuration. + :type description: str + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DscConfigurationCreateOrUpdateParameters, self).__init__(**kwargs) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.source = kwargs.get('source', None) + self.parameters = kwargs.get('parameters', None) + self.description = kwargs.get('description', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class DscConfigurationParameter(Model): + """Definition of the configuration parameter type. + + :param type: Gets or sets the type of the parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value to indicate whether the + parameter is mandatory or not. + :type is_mandatory: bool + :param position: Get or sets the position of the parameter. + :type position: int + :param default_value: Gets or sets the default value of parameter. + :type default_value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'int'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscConfigurationParameter, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.is_mandatory = kwargs.get('is_mandatory', None) + self.position = kwargs.get('position', None) + self.default_value = kwargs.get('default_value', None) + + +class DscConfigurationUpdateParameters(Model): + """The parameters supplied to the create or update configuration operation. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.DscConfigurationParameter] + :param description: Gets or sets the description of the configuration. + :type description: str + :param name: Gets or sets name of the resource. + :type name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DscConfigurationUpdateParameters, self).__init__(**kwargs) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.source = kwargs.get('source', None) + self.parameters = kwargs.get('parameters', None) + self.description = kwargs.get('description', None) + self.name = kwargs.get('name', None) + self.tags = kwargs.get('tags', None) + + +class DscMetaConfiguration(Model): + """Definition of the DSC Meta Configuration. + + :param configuration_mode_frequency_mins: Gets or sets the + ConfigurationModeFrequencyMins value of the meta configuration. + :type configuration_mode_frequency_mins: int + :param reboot_node_if_needed: Gets or sets the RebootNodeIfNeeded value of + the meta configuration. + :type reboot_node_if_needed: bool + :param configuration_mode: Gets or sets the ConfigurationMode value of the + meta configuration. + :type configuration_mode: str + :param action_after_reboot: Gets or sets the ActionAfterReboot value of + the meta configuration. + :type action_after_reboot: str + :param certificate_id: Gets or sets the CertificateId value of the meta + configuration. + :type certificate_id: str + :param refresh_frequency_mins: Gets or sets the RefreshFrequencyMins value + of the meta configuration. + :type refresh_frequency_mins: int + :param allow_module_overwrite: Gets or sets the AllowModuleOverwrite value + of the meta configuration. + :type allow_module_overwrite: bool + """ + + _attribute_map = { + 'configuration_mode_frequency_mins': {'key': 'configurationModeFrequencyMins', 'type': 'int'}, + 'reboot_node_if_needed': {'key': 'rebootNodeIfNeeded', 'type': 'bool'}, + 'configuration_mode': {'key': 'configurationMode', 'type': 'str'}, + 'action_after_reboot': {'key': 'actionAfterReboot', 'type': 'str'}, + 'certificate_id': {'key': 'certificateId', 'type': 'str'}, + 'refresh_frequency_mins': {'key': 'refreshFrequencyMins', 'type': 'int'}, + 'allow_module_overwrite': {'key': 'allowModuleOverwrite', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DscMetaConfiguration, self).__init__(**kwargs) + self.configuration_mode_frequency_mins = kwargs.get('configuration_mode_frequency_mins', None) + self.reboot_node_if_needed = kwargs.get('reboot_node_if_needed', None) + self.configuration_mode = kwargs.get('configuration_mode', None) + self.action_after_reboot = kwargs.get('action_after_reboot', None) + self.certificate_id = kwargs.get('certificate_id', None) + self.refresh_frequency_mins = kwargs.get('refresh_frequency_mins', None) + self.allow_module_overwrite = kwargs.get('allow_module_overwrite', None) + + +class DscNode(ProxyResource): + """Definition of a DscNode. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param last_seen: Gets or sets the last seen time of the node. + :type last_seen: datetime + :param registration_time: Gets or sets the registration time of the node. + :type registration_time: datetime + :param ip: Gets or sets the ip of the node. + :type ip: str + :param account_id: Gets or sets the account id of the node. + :type account_id: str + :param dsc_node_name: Gets or sets the name of the dsc node configuration. + :type dsc_node_name: str + :param status: Gets or sets the status of the node. + :type status: str + :param node_id: Gets or sets the node id. + :type node_id: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + :param total_count: Gets the total number of records matching filter + criteria. + :type total_count: int + :param extension_handler: Gets or sets the list of extensionHandler + properties for a Node. + :type extension_handler: + list[~azure.mgmt.automation.models.DscNodeExtensionHandlerAssociationProperty] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_seen': {'key': 'properties.lastSeen', 'type': 'iso-8601'}, + 'registration_time': {'key': 'properties.registrationTime', 'type': 'iso-8601'}, + 'ip': {'key': 'properties.ip', 'type': 'str'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + 'dsc_node_name': {'key': 'properties.nodeConfiguration.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'node_id': {'key': 'properties.nodeId', 'type': 'str'}, + 'etag': {'key': 'properties.etag', 'type': 'str'}, + 'total_count': {'key': 'properties.totalCount', 'type': 'int'}, + 'extension_handler': {'key': 'properties.extensionHandler', 'type': '[DscNodeExtensionHandlerAssociationProperty]'}, + } + + def __init__(self, **kwargs): + super(DscNode, self).__init__(**kwargs) + self.last_seen = kwargs.get('last_seen', None) + self.registration_time = kwargs.get('registration_time', None) + self.ip = kwargs.get('ip', None) + self.account_id = kwargs.get('account_id', None) + self.dsc_node_name = kwargs.get('dsc_node_name', None) + self.status = kwargs.get('status', None) + self.node_id = kwargs.get('node_id', None) + self.etag = kwargs.get('etag', None) + self.total_count = kwargs.get('total_count', None) + self.extension_handler = kwargs.get('extension_handler', None) + + +class DscNodeConfiguration(ProxyResource): + """Definition of the dsc node configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param creation_time: Gets or sets creation time. + :type creation_time: datetime + :param configuration: Gets or sets the configuration of the node. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param source: Source of node configuration. + :type source: str + :param node_count: Number of nodes with this node configuration assigned + :type node_count: long + :param increment_node_configuration_build: If a new build version of + NodeConfiguration is required. + :type increment_node_configuration_build: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'long'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DscNodeConfiguration, self).__init__(**kwargs) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.creation_time = kwargs.get('creation_time', None) + self.configuration = kwargs.get('configuration', None) + self.source = kwargs.get('source', None) + self.node_count = kwargs.get('node_count', None) + self.increment_node_configuration_build = kwargs.get('increment_node_configuration_build', None) + + +class DscNodeConfigurationCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update node configuration + operation. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param configuration: Required. Gets or sets the configuration of the + node. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param increment_node_configuration_build: If a new build version of + NodeConfiguration is required. + :type increment_node_configuration_build: bool + :param name: Name of the node configuration. + :type name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'source': {'required': True}, + 'configuration': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DscNodeConfigurationCreateOrUpdateParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.configuration = kwargs.get('configuration', None) + self.increment_node_configuration_build = kwargs.get('increment_node_configuration_build', None) + self.name = kwargs.get('name', None) + self.tags = kwargs.get('tags', None) + + +class DscNodeExtensionHandlerAssociationProperty(Model): + """The dsc extensionHandler property associated with the node. + + :param name: Gets or sets the name of the extension handler. + :type name: str + :param version: Gets or sets the version of the extension handler. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscNodeExtensionHandlerAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.version = kwargs.get('version', None) + + +class DscNodeReport(Model): + """Definition of the dsc node report type. + + :param end_time: Gets or sets the end time of the node report. + :type end_time: datetime + :param last_modified_time: Gets or sets the lastModifiedTime of the node + report. + :type last_modified_time: datetime + :param start_time: Gets or sets the start time of the node report. + :type start_time: datetime + :param type: Gets or sets the type of the node report. + :type type: str + :param report_id: Gets or sets the id of the node report. + :type report_id: str + :param status: Gets or sets the status of the node report. + :type status: str + :param refresh_mode: Gets or sets the refreshMode of the node report. + :type refresh_mode: str + :param reboot_requested: Gets or sets the rebootRequested of the node + report. + :type reboot_requested: str + :param report_format_version: Gets or sets the reportFormatVersion of the + node report. + :type report_format_version: str + :param configuration_version: Gets or sets the configurationVersion of the + node report. + :type configuration_version: str + :param id: Gets or sets the id. + :type id: str + :param errors: Gets or sets the errors for the node report. + :type errors: list[~azure.mgmt.automation.models.DscReportError] + :param resources: Gets or sets the resource for the node report. + :type resources: list[~azure.mgmt.automation.models.DscReportResource] + :param meta_configuration: Gets or sets the metaConfiguration of the node + at the time of the report. + :type meta_configuration: + ~azure.mgmt.automation.models.DscMetaConfiguration + :param host_name: Gets or sets the hostname of the node that sent the + report. + :type host_name: str + :param i_pv4_addresses: Gets or sets the IPv4 address of the node that + sent the report. + :type i_pv4_addresses: list[str] + :param i_pv6_addresses: Gets or sets the IPv6 address of the node that + sent the report. + :type i_pv6_addresses: list[str] + :param number_of_resources: Gets or sets the number of resource in the + node report. + :type number_of_resources: int + :param raw_errors: Gets or sets the unparsed errors for the node report. + :type raw_errors: str + """ + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'report_id': {'key': 'reportId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'refresh_mode': {'key': 'refreshMode', 'type': 'str'}, + 'reboot_requested': {'key': 'rebootRequested', 'type': 'str'}, + 'report_format_version': {'key': 'reportFormatVersion', 'type': 'str'}, + 'configuration_version': {'key': 'configurationVersion', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[DscReportError]'}, + 'resources': {'key': 'resources', 'type': '[DscReportResource]'}, + 'meta_configuration': {'key': 'metaConfiguration', 'type': 'DscMetaConfiguration'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'i_pv4_addresses': {'key': 'iPV4Addresses', 'type': '[str]'}, + 'i_pv6_addresses': {'key': 'iPV6Addresses', 'type': '[str]'}, + 'number_of_resources': {'key': 'numberOfResources', 'type': 'int'}, + 'raw_errors': {'key': 'rawErrors', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscNodeReport, self).__init__(**kwargs) + self.end_time = kwargs.get('end_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.start_time = kwargs.get('start_time', None) + self.type = kwargs.get('type', None) + self.report_id = kwargs.get('report_id', None) + self.status = kwargs.get('status', None) + self.refresh_mode = kwargs.get('refresh_mode', None) + self.reboot_requested = kwargs.get('reboot_requested', None) + self.report_format_version = kwargs.get('report_format_version', None) + self.configuration_version = kwargs.get('configuration_version', None) + self.id = kwargs.get('id', None) + self.errors = kwargs.get('errors', None) + self.resources = kwargs.get('resources', None) + self.meta_configuration = kwargs.get('meta_configuration', None) + self.host_name = kwargs.get('host_name', None) + self.i_pv4_addresses = kwargs.get('i_pv4_addresses', None) + self.i_pv6_addresses = kwargs.get('i_pv6_addresses', None) + self.number_of_resources = kwargs.get('number_of_resources', None) + self.raw_errors = kwargs.get('raw_errors', None) + + +class DscNodeUpdateParameters(Model): + """The parameters supplied to the update dsc node operation. + + :param node_id: Gets or sets the id of the dsc node. + :type node_id: str + :param properties: + :type properties: + ~azure.mgmt.automation.models.DscNodeUpdateParametersProperties + """ + + _attribute_map = { + 'node_id': {'key': 'nodeId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DscNodeUpdateParametersProperties'}, + } + + def __init__(self, **kwargs): + super(DscNodeUpdateParameters, self).__init__(**kwargs) + self.node_id = kwargs.get('node_id', None) + self.properties = kwargs.get('properties', None) + + +class DscNodeUpdateParametersProperties(Model): + """DscNodeUpdateParametersProperties. + + :param name: Gets or sets the name of the dsc node configuration. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'nodeConfiguration.name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscNodeUpdateParametersProperties, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class DscReportError(Model): + """Definition of the dsc node report error type. + + :param error_source: Gets or sets the source of the error. + :type error_source: str + :param resource_id: Gets or sets the resource ID which generated the + error. + :type resource_id: str + :param error_code: Gets or sets the error code. + :type error_code: str + :param error_message: Gets or sets the error message. + :type error_message: str + :param locale: Gets or sets the locale of the error. + :type locale: str + :param error_details: Gets or sets the error details. + :type error_details: str + """ + + _attribute_map = { + 'error_source': {'key': 'errorSource', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'locale': {'key': 'locale', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscReportError, self).__init__(**kwargs) + self.error_source = kwargs.get('error_source', None) + self.resource_id = kwargs.get('resource_id', None) + self.error_code = kwargs.get('error_code', None) + self.error_message = kwargs.get('error_message', None) + self.locale = kwargs.get('locale', None) + self.error_details = kwargs.get('error_details', None) + + +class DscReportResource(Model): + """Definition of the DSC Report Resource. + + :param resource_id: Gets or sets the ID of the resource. + :type resource_id: str + :param source_info: Gets or sets the source info of the resource. + :type source_info: str + :param depends_on: Gets or sets the Resource Navigation values for + resources the resource depends on. + :type depends_on: + list[~azure.mgmt.automation.models.DscReportResourceNavigation] + :param module_name: Gets or sets the module name of the resource. + :type module_name: str + :param module_version: Gets or sets the module version of the resource. + :type module_version: str + :param resource_name: Gets or sets the name of the resource. + :type resource_name: str + :param error: Gets or sets the error of the resource. + :type error: str + :param status: Gets or sets the status of the resource. + :type status: str + :param duration_in_seconds: Gets or sets the duration in seconds for the + resource. + :type duration_in_seconds: float + :param start_date: Gets or sets the start date of the resource. + :type start_date: datetime + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'source_info': {'key': 'sourceInfo', 'type': 'str'}, + 'depends_on': {'key': 'dependsOn', 'type': '[DscReportResourceNavigation]'}, + 'module_name': {'key': 'moduleName', 'type': 'str'}, + 'module_version': {'key': 'moduleVersion', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'float'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(DscReportResource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.source_info = kwargs.get('source_info', None) + self.depends_on = kwargs.get('depends_on', None) + self.module_name = kwargs.get('module_name', None) + self.module_version = kwargs.get('module_version', None) + self.resource_name = kwargs.get('resource_name', None) + self.error = kwargs.get('error', None) + self.status = kwargs.get('status', None) + self.duration_in_seconds = kwargs.get('duration_in_seconds', None) + self.start_date = kwargs.get('start_date', None) + + +class DscReportResourceNavigation(Model): + """Navigation for DSC Report Resource. + + :param resource_id: Gets or sets the ID of the resource to navigate to. + :type resource_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DscReportResourceNavigation, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + + +class ErrorResponse(Model): + """Error response of an operation failure. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class FieldDefinition(Model): + """Definition of the connection fields. + + All required parameters must be populated in order to send to Azure. + + :param is_encrypted: Gets or sets the isEncrypted flag of the connection + field definition. + :type is_encrypted: bool + :param is_optional: Gets or sets the isOptional flag of the connection + field definition. + :type is_optional: bool + :param type: Required. Gets or sets the type of the connection field + definition. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'is_encrypted': {'key': 'isEncrypted', 'type': 'bool'}, + 'is_optional': {'key': 'isOptional', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FieldDefinition, self).__init__(**kwargs) + self.is_encrypted = kwargs.get('is_encrypted', None) + self.is_optional = kwargs.get('is_optional', None) + self.type = kwargs.get('type', None) + + +class HybridRunbookWorker(Model): + """Definition of hybrid runbook worker. + + :param name: Gets or sets the worker machine name. + :type name: str + :param ip: Gets or sets the assigned machine IP address. + :type ip: str + :param registration_time: Gets or sets the registration time of the worker + machine. + :type registration_time: datetime + :param last_seen_date_time: Last Heartbeat from the Worker + :type last_seen_date_time: datetime + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ip': {'key': 'ip', 'type': 'str'}, + 'registration_time': {'key': 'registrationTime', 'type': 'iso-8601'}, + 'last_seen_date_time': {'key': 'lastSeenDateTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(HybridRunbookWorker, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.ip = kwargs.get('ip', None) + self.registration_time = kwargs.get('registration_time', None) + self.last_seen_date_time = kwargs.get('last_seen_date_time', None) + + +class HybridRunbookWorkerGroup(Model): + """Definition of hybrid runbook worker group. + + :param id: Gets or sets the id of the resource. + :type id: str + :param name: Gets or sets the name of the group. + :type name: str + :param hybrid_runbook_workers: Gets or sets the list of hybrid runbook + workers. + :type hybrid_runbook_workers: + list[~azure.mgmt.automation.models.HybridRunbookWorker] + :param credential: Sets the credential of a worker group. + :type credential: + ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + :param group_type: Type of the HybridWorkerGroup. Possible values include: + 'User', 'System' + :type group_type: str or ~azure.mgmt.automation.models.GroupTypeEnum + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'hybrid_runbook_workers': {'key': 'hybridRunbookWorkers', 'type': '[HybridRunbookWorker]'}, + 'credential': {'key': 'credential', 'type': 'RunAsCredentialAssociationProperty'}, + 'group_type': {'key': 'groupType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HybridRunbookWorkerGroup, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.hybrid_runbook_workers = kwargs.get('hybrid_runbook_workers', None) + self.credential = kwargs.get('credential', None) + self.group_type = kwargs.get('group_type', None) + + +class HybridRunbookWorkerGroupUpdateParameters(Model): + """Parameters supplied to the update operation. + + :param credential: Sets the credential of a worker group. + :type credential: + ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + """ + + _attribute_map = { + 'credential': {'key': 'credential', 'type': 'RunAsCredentialAssociationProperty'}, + } + + def __init__(self, **kwargs): + super(HybridRunbookWorkerGroupUpdateParameters, self).__init__(**kwargs) + self.credential = kwargs.get('credential', None) + + +class Job(ProxyResource): + """Definition of the job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param started_by: Gets or sets the job started by. + :type started_by: str + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + :param job_id: Gets or sets the id of the job. + :type job_id: str + :param creation_time: Gets or sets the creation time of the job. + :type creation_time: datetime + :param status: Gets or sets the status of the job. Possible values + include: 'New', 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', + 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping', + 'Resuming', 'Removing' + :type status: str or ~azure.mgmt.automation.models.JobStatus + :param status_details: Gets or sets the status details of the job. + :type status_details: str + :param start_time: Gets or sets the start time of the job. + :type start_time: datetime + :param end_time: Gets or sets the end time of the job. + :type end_time: datetime + :param exception: Gets or sets the exception of the job. + :type exception: str + :param last_modified_time: Gets or sets the last modified time of the job. + :type last_modified_time: datetime + :param last_status_modified_time: Gets or sets the last status modified + time of the job. + :type last_status_modified_time: datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param provisioning_state: The current provisioning state of the job. + Possible values include: 'Failed', 'Succeeded', 'Suspended', 'Processing' + :type provisioning_state: str or + ~azure.mgmt.automation.models.JobProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'properties.lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Job, self).__init__(**kwargs) + self.runbook = kwargs.get('runbook', None) + self.started_by = kwargs.get('started_by', None) + self.run_on = kwargs.get('run_on', None) + self.job_id = kwargs.get('job_id', None) + self.creation_time = kwargs.get('creation_time', None) + self.status = kwargs.get('status', None) + self.status_details = kwargs.get('status_details', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.exception = kwargs.get('exception', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.last_status_modified_time = kwargs.get('last_status_modified_time', None) + self.parameters = kwargs.get('parameters', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class JobCollectionItem(ProxyResource): + """Job collection item properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar runbook: The runbook association. + :vartype runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :ivar job_id: The id of the job. + :vartype job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: datetime + :ivar status: The status of the job. Possible values include: 'New', + 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', 'Blocked', + 'Suspended', 'Disconnected', 'Suspending', 'Stopping', 'Resuming', + 'Removing' + :vartype status: str or ~azure.mgmt.automation.models.JobStatus + :ivar start_time: The start time of the job. + :vartype start_time: datetime + :ivar end_time: The end time of the job. + :vartype end_time: datetime + :ivar last_modified_time: The last modified time of the job. + :vartype last_modified_time: datetime + :ivar provisioning_state: The provisioning state of a resource. + :vartype provisioning_state: str + :param run_on: Specifies the runOn group name where the job was executed. + :type run_on: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'runbook': {'readonly': True}, + 'job_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobCollectionItem, self).__init__(**kwargs) + self.runbook = None + self.job_id = None + self.creation_time = None + self.status = None + self.start_time = None + self.end_time = None + self.last_modified_time = None + self.provisioning_state = None + self.run_on = kwargs.get('run_on', None) + + +class JobCreateParameters(Model): + """The parameters supplied to the create job operation. + + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + """ + + _attribute_map = { + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobCreateParameters, self).__init__(**kwargs) + self.runbook = kwargs.get('runbook', None) + self.parameters = kwargs.get('parameters', None) + self.run_on = kwargs.get('run_on', None) + + +class JobNavigation(Model): + """Software update configuration machine run job navigation properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Id of the job associated with the software update configuration + run + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobNavigation, self).__init__(**kwargs) + self.id = None + + +class JobSchedule(Model): + """Definition of the job schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets the name of the variable. + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param job_schedule_id: Gets or sets the id of job schedule. + :type job_schedule_id: str + :param schedule: Gets or sets the schedule. + :type schedule: ~azure.mgmt.automation.models.ScheduleAssociationProperty + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the hybrid worker group that the scheduled job + should run on. + :type run_on: str + :param parameters: Gets or sets the parameters of the job schedule. + :type parameters: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'job_schedule_id': {'key': 'properties.jobScheduleId', 'type': 'str'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ScheduleAssociationProperty'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(JobSchedule, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.job_schedule_id = kwargs.get('job_schedule_id', None) + self.schedule = kwargs.get('schedule', None) + self.runbook = kwargs.get('runbook', None) + self.run_on = kwargs.get('run_on', None) + self.parameters = kwargs.get('parameters', None) + + +class JobScheduleCreateParameters(Model): + """The parameters supplied to the create job schedule operation. + + All required parameters must be populated in order to send to Azure. + + :param schedule: Required. Gets or sets the schedule. + :type schedule: ~azure.mgmt.automation.models.ScheduleAssociationProperty + :param runbook: Required. Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the hybrid worker group that the scheduled job + should run on. + :type run_on: str + :param parameters: Gets or sets a list of job properties. + :type parameters: dict[str, str] + """ + + _validation = { + 'schedule': {'required': True}, + 'runbook': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'properties.schedule', 'type': 'ScheduleAssociationProperty'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(JobScheduleCreateParameters, self).__init__(**kwargs) + self.schedule = kwargs.get('schedule', None) + self.runbook = kwargs.get('runbook', None) + self.run_on = kwargs.get('run_on', None) + self.parameters = kwargs.get('parameters', None) + + +class JobStream(Model): + """Definition of the job stream. + + :param id: Gets or sets the id of the resource. + :type id: str + :param job_stream_id: Gets or sets the id of the job stream. + :type job_stream_id: str + :param time: Gets or sets the creation time of the job. + :type time: datetime + :param stream_type: Gets or sets the stream type. Possible values include: + 'Progress', 'Output', 'Warning', 'Error', 'Debug', 'Verbose', 'Any' + :type stream_type: str or ~azure.mgmt.automation.models.JobStreamType + :param stream_text: Gets or sets the stream text. + :type stream_text: str + :param summary: Gets or sets the summary. + :type summary: str + :param value: Gets or sets the values of the job stream. + :type value: dict[str, object] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'job_stream_id': {'key': 'properties.jobStreamId', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + 'stream_text': {'key': 'properties.streamText', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '{object}'}, + } + + def __init__(self, **kwargs): + super(JobStream, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.job_stream_id = kwargs.get('job_stream_id', None) + self.time = kwargs.get('time', None) + self.stream_type = kwargs.get('stream_type', None) + self.stream_text = kwargs.get('stream_text', None) + self.summary = kwargs.get('summary', None) + self.value = kwargs.get('value', None) + + +class JobStreamListResult(Model): + """The response model for the list job stream operation. + + :param value: A list of job streams. + :type value: list[~azure.mgmt.automation.models.JobStream] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobStream]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobStreamListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class Key(Model): + """Automation key which is used to register a DSC Node. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Automation key name. Possible values include: 'Primary', + 'Secondary' + :vartype key_name: str or ~azure.mgmt.automation.models.AutomationKeyName + :ivar permissions: Automation key permissions. Possible values include: + 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.automation.models.AutomationKeyPermissions + :ivar value: Value of the Automation Key used for registration. + :vartype value: str + """ + + _validation = { + 'key_name': {'readonly': True}, + 'permissions': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'KeyName', 'type': 'str'}, + 'permissions': {'key': 'Permissions', 'type': 'str'}, + 'value': {'key': 'Value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Key, self).__init__(**kwargs) + self.key_name = None + self.permissions = None + self.value = None + + +class KeyListResult(Model): + """KeyListResult. + + :param keys: Lists the automation keys. + :type keys: list[~azure.mgmt.automation.models.Key] + """ + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[Key]'}, + } + + def __init__(self, **kwargs): + super(KeyListResult, self).__init__(**kwargs) + self.keys = kwargs.get('keys', None) + + +class LinkedWorkspace(Model): + """Definition of the linked workspace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the linked workspace. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LinkedWorkspace, self).__init__(**kwargs) + self.id = None + + +class LinuxProperties(Model): + """Linux specific update configuration. + + :param included_package_classifications: Update classifications included + in the software update configuration. Possible values include: + 'Unclassified', 'Critical', 'Security', 'Other' + :type included_package_classifications: str or + ~azure.mgmt.automation.models.LinuxUpdateClasses + :param excluded_package_name_masks: packages excluded from the software + update configuration. + :type excluded_package_name_masks: list[str] + :param included_package_name_masks: packages included from the software + update configuration. + :type included_package_name_masks: list[str] + :param reboot_setting: Reboot setting for the software update + configuration. + :type reboot_setting: str + """ + + _attribute_map = { + 'included_package_classifications': {'key': 'includedPackageClassifications', 'type': 'str'}, + 'excluded_package_name_masks': {'key': 'excludedPackageNameMasks', 'type': '[str]'}, + 'included_package_name_masks': {'key': 'includedPackageNameMasks', 'type': '[str]'}, + 'reboot_setting': {'key': 'rebootSetting', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LinuxProperties, self).__init__(**kwargs) + self.included_package_classifications = kwargs.get('included_package_classifications', None) + self.excluded_package_name_masks = kwargs.get('excluded_package_name_masks', None) + self.included_package_name_masks = kwargs.get('included_package_name_masks', None) + self.reboot_setting = kwargs.get('reboot_setting', None) + + +class Module(TrackedResource): + """Definition of the module type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param is_global: Gets or sets the isGlobal flag of the module. + :type is_global: bool + :param version: Gets or sets the version of the module. + :type version: str + :param size_in_bytes: Gets or sets the size in bytes of the module. + :type size_in_bytes: long + :param activity_count: Gets or sets the activity count of the module. + :type activity_count: int + :param provisioning_state: Gets or sets the provisioning state of the + module. Possible values include: 'Created', 'Creating', + 'StartingImportModuleRunbook', 'RunningImportModuleRunbook', + 'ContentRetrieved', 'ContentDownloaded', 'ContentValidated', + 'ConnectionTypeImported', 'ContentStored', 'ModuleDataStored', + 'ActivitiesStored', 'ModuleImportRunbookComplete', 'Succeeded', 'Failed', + 'Cancelled', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ModuleProvisioningState + :param content_link: Gets or sets the contentLink of the module. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param error: Gets or sets the error info of the module. + :type error: ~azure.mgmt.automation.models.ModuleErrorInfo + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param is_composite: Gets or sets type of module, if its composite or not. + :type is_composite: bool + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'activity_count': {'key': 'properties.activityCount', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ModuleProvisioningState'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'error': {'key': 'properties.error', 'type': 'ModuleErrorInfo'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_composite': {'key': 'properties.isComposite', 'type': 'bool'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Module, self).__init__(**kwargs) + self.is_global = kwargs.get('is_global', None) + self.version = kwargs.get('version', None) + self.size_in_bytes = kwargs.get('size_in_bytes', None) + self.activity_count = kwargs.get('activity_count', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.content_link = kwargs.get('content_link', None) + self.error = kwargs.get('error', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + self.is_composite = kwargs.get('is_composite', None) + self.etag = kwargs.get('etag', None) + + +class ModuleCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update module operation. + + All required parameters must be populated in order to send to Azure. + + :param content_link: Required. Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'content_link': {'required': True}, + } + + _attribute_map = { + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ModuleCreateOrUpdateParameters, self).__init__(**kwargs) + self.content_link = kwargs.get('content_link', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class ModuleErrorInfo(Model): + """Definition of the module error info type. + + :param code: Gets or sets the error code. + :type code: str + :param message: Gets or sets the error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ModuleErrorInfo, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ModuleUpdateParameters(Model): + """The parameters supplied to the update module operation. + + :param content_link: Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ModuleUpdateParameters, self).__init__(**kwargs) + self.content_link = kwargs.get('content_link', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class NodeCount(Model): + """Number of nodes based on the Filter. + + :param name: Gets the name of a count type + :type name: str + :param properties: + :type properties: ~azure.mgmt.automation.models.NodeCountProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'NodeCountProperties'}, + } + + def __init__(self, **kwargs): + super(NodeCount, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + + +class NodeCountProperties(Model): + """NodeCountProperties. + + :param count: Gets the count for the name + :type count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(NodeCountProperties, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + + +class NodeCounts(Model): + """Gets the count of nodes by count type. + + :param value: Gets an array of counts + :type value: list[~azure.mgmt.automation.models.NodeCount] + :param total_count: Gets the total number of records matching countType + criteria. + :type total_count: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NodeCount]'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(NodeCounts, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.total_count = kwargs.get('total_count', None) + + +class NonAzureQueryProperties(Model): + """Non Azure query for the update configuration. + + :param function_alias: Log Analytics Saved Search name. + :type function_alias: str + :param workspace_id: Workspace Id for Log Analytics in which the saved + Search is resided. + :type workspace_id: str + """ + + _attribute_map = { + 'function_alias': {'key': 'functionAlias', 'type': 'str'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NonAzureQueryProperties, self).__init__(**kwargs) + self.function_alias = kwargs.get('function_alias', None) + self.workspace_id = kwargs.get('workspace_id', None) + + +class Operation(Model): + """Automation REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Provider, Resource and Operation values + :type display: ~azure.mgmt.automation.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class OperationDisplay(Model): + """Provider, Resource and Operation values. + + :param provider: Service provider: Microsoft.Automation + :type provider: str + :param resource: Resource on which the operation is performed: Runbooks, + Jobs etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + + +class PythonPackageCreateParameters(Model): + """The parameters supplied to the create or update module operation. + + All required parameters must be populated in order to send to Azure. + + :param content_link: Required. Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'content_link': {'required': True}, + } + + _attribute_map = { + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(PythonPackageCreateParameters, self).__init__(**kwargs) + self.content_link = kwargs.get('content_link', None) + self.tags = kwargs.get('tags', None) + + +class PythonPackageUpdateParameters(Model): + """The parameters supplied to the update module operation. + + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(PythonPackageUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class RunAsCredentialAssociationProperty(Model): + """Definition of RunAs credential to use for hybrid worker. + + :param name: Gets or sets the name of the credential. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunAsCredentialAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class Runbook(TrackedResource): + """Definition of the runbook type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param runbook_type: Gets or sets the type of the runbook. Possible values + include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', + 'GraphPowerShellWorkflow', 'GraphPowerShell' + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param publish_content_link: Gets or sets the published runbook content + link. + :type publish_content_link: ~azure.mgmt.automation.models.ContentLink + :param state: Gets or sets the state of the runbook. Possible values + include: 'New', 'Edit', 'Published' + :type state: str or ~azure.mgmt.automation.models.RunbookState + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param log_activity_trace: Gets or sets the option to log activity trace + of the runbook. + :type log_activity_trace: int + :param job_count: Gets or sets the job count of the runbook. + :type job_count: int + :param parameters: Gets or sets the runbook parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.RunbookParameter] + :param output_types: Gets or sets the runbook output types. + :type output_types: list[str] + :param draft: Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param provisioning_state: Gets or sets the provisioning state of the + runbook. Possible values include: 'Succeeded' + :type provisioning_state: str or + ~azure.mgmt.automation.models.RunbookProvisioningState + :param last_modified_by: Gets or sets the last modified by. + :type last_modified_by: str + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'runbook_type': {'key': 'properties.runbookType', 'type': 'str'}, + 'publish_content_link': {'key': 'properties.publishContentLink', 'type': 'ContentLink'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'log_activity_trace': {'key': 'properties.logActivityTrace', 'type': 'int'}, + 'job_count': {'key': 'properties.jobCount', 'type': 'int'}, + 'parameters': {'key': 'properties.parameters', 'type': '{RunbookParameter}'}, + 'output_types': {'key': 'properties.outputTypes', 'type': '[str]'}, + 'draft': {'key': 'properties.draft', 'type': 'RunbookDraft'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'RunbookProvisioningState'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Runbook, self).__init__(**kwargs) + self.runbook_type = kwargs.get('runbook_type', None) + self.publish_content_link = kwargs.get('publish_content_link', None) + self.state = kwargs.get('state', None) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + self.job_count = kwargs.get('job_count', None) + self.parameters = kwargs.get('parameters', None) + self.output_types = kwargs.get('output_types', None) + self.draft = kwargs.get('draft', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + self.etag = kwargs.get('etag', None) + + +class RunbookAssociationProperty(Model): + """The runbook property associated with the entity. + + :param name: Gets or sets the name of the runbook. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunbookAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class RunbookCreateOrUpdateDraftParameters(Model): + """The parameters supplied to the create or update runbook operation. + + All required parameters must be populated in order to send to Azure. + + :param runbook_content: Required. Content of the Runbook. + :type runbook_content: str + """ + + _validation = { + 'runbook_content': {'required': True}, + } + + _attribute_map = { + 'runbook_content': {'key': 'runbookContent', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunbookCreateOrUpdateDraftParameters, self).__init__(**kwargs) + self.runbook_content = kwargs.get('runbook_content', None) + + +class RunbookCreateOrUpdateDraftProperties(Model): + """The parameters supplied to the create or update draft runbook properties. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param runbook_type: Required. Gets or sets the type of the runbook. + Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', + 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param draft: Required. Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_activity_trace: Gets or sets the activity-level tracing options + of the runbook. + :type log_activity_trace: int + """ + + _validation = { + 'runbook_type': {'required': True}, + 'draft': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'logProgress', 'type': 'bool'}, + 'runbook_type': {'key': 'runbookType', 'type': 'str'}, + 'draft': {'key': 'draft', 'type': 'RunbookDraft'}, + 'description': {'key': 'description', 'type': 'str'}, + 'log_activity_trace': {'key': 'logActivityTrace', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(RunbookCreateOrUpdateDraftProperties, self).__init__(**kwargs) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.runbook_type = kwargs.get('runbook_type', None) + self.draft = kwargs.get('draft', None) + self.description = kwargs.get('description', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + + +class RunbookCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update runbook operation. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param runbook_type: Required. Gets or sets the type of the runbook. + Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', + 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param draft: Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param publish_content_link: Gets or sets the published runbook content + link. + :type publish_content_link: ~azure.mgmt.automation.models.ContentLink + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_activity_trace: Gets or sets the activity-level tracing options + of the runbook. + :type log_activity_trace: int + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'runbook_type': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'runbook_type': {'key': 'properties.runbookType', 'type': 'str'}, + 'draft': {'key': 'properties.draft', 'type': 'RunbookDraft'}, + 'publish_content_link': {'key': 'properties.publishContentLink', 'type': 'ContentLink'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'log_activity_trace': {'key': 'properties.logActivityTrace', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(RunbookCreateOrUpdateParameters, self).__init__(**kwargs) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.runbook_type = kwargs.get('runbook_type', None) + self.draft = kwargs.get('draft', None) + self.publish_content_link = kwargs.get('publish_content_link', None) + self.description = kwargs.get('description', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class RunbookDraft(Model): + """RunbookDraft. + + :param in_edit: Gets or sets whether runbook is in edit mode. + :type in_edit: bool + :param draft_content_link: Gets or sets the draft runbook content link. + :type draft_content_link: ~azure.mgmt.automation.models.ContentLink + :param creation_time: Gets or sets the creation time of the runbook draft. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time of the + runbook draft. + :type last_modified_time: datetime + :param parameters: Gets or sets the runbook draft parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.RunbookParameter] + :param output_types: Gets or sets the runbook output types. + :type output_types: list[str] + """ + + _attribute_map = { + 'in_edit': {'key': 'inEdit', 'type': 'bool'}, + 'draft_content_link': {'key': 'draftContentLink', 'type': 'ContentLink'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'parameters', 'type': '{RunbookParameter}'}, + 'output_types': {'key': 'outputTypes', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(RunbookDraft, self).__init__(**kwargs) + self.in_edit = kwargs.get('in_edit', None) + self.draft_content_link = kwargs.get('draft_content_link', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.parameters = kwargs.get('parameters', None) + self.output_types = kwargs.get('output_types', None) + + +class RunbookDraftUndoEditResult(Model): + """The response model for the undo edit runbook operation. + + :param status_code: Possible values include: 'Continue', + 'SwitchingProtocols', 'OK', 'Created', 'Accepted', + 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', + 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', + 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', + 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', + 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', + 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', + 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', + 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', + 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', + 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', + 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', + 'HttpVersionNotSupported' + :type status_code: str or ~azure.mgmt.automation.models.HttpStatusCode + :param request_id: + :type request_id: str + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunbookDraftUndoEditResult, self).__init__(**kwargs) + self.status_code = kwargs.get('status_code', None) + self.request_id = kwargs.get('request_id', None) + + +class RunbookParameter(Model): + """Definition of the runbook parameter type. + + :param type: Gets or sets the type of the parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value to indicate whether the + parameter is mandatory or not. + :type is_mandatory: bool + :param position: Get or sets the position of the parameter. + :type position: int + :param default_value: Gets or sets the default value of parameter. + :type default_value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'int'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunbookParameter, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.is_mandatory = kwargs.get('is_mandatory', None) + self.position = kwargs.get('position', None) + self.default_value = kwargs.get('default_value', None) + + +class RunbookUpdateParameters(Model): + """The parameters supplied to the update runbook operation. + + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param log_activity_trace: Gets or sets the activity-level tracing options + of the runbook. + :type log_activity_trace: int + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'log_activity_trace': {'key': 'properties.logActivityTrace', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(RunbookUpdateParameters, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.log_verbose = kwargs.get('log_verbose', None) + self.log_progress = kwargs.get('log_progress', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class Schedule(ProxyResource): + """Definition of the schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param start_time: Gets or sets the start time of the schedule. + :type start_time: datetime + :ivar start_time_offset_minutes: Gets the start time's offset in minutes. + :vartype start_time_offset_minutes: float + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: datetime + :param expiry_time_offset_minutes: Gets or sets the expiry time's offset + in minutes. + :type expiry_time_offset_minutes: float + :param is_enabled: Gets or sets a value indicating whether this schedule + is enabled. Default value: False . + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in + minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible + values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month', 'Minute' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param advanced_schedule: Gets or sets the advanced schedule. + :type advanced_schedule: ~azure.mgmt.automation.models.AdvancedSchedule + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_time_offset_minutes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'properties.startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'properties.expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'properties.nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'advanced_schedule': {'key': 'properties.advancedSchedule', 'type': 'AdvancedSchedule'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Schedule, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.start_time_offset_minutes = None + self.expiry_time = kwargs.get('expiry_time', None) + self.expiry_time_offset_minutes = kwargs.get('expiry_time_offset_minutes', None) + self.is_enabled = kwargs.get('is_enabled', False) + self.next_run = kwargs.get('next_run', None) + self.next_run_offset_minutes = kwargs.get('next_run_offset_minutes', None) + self.interval = kwargs.get('interval', None) + self.frequency = kwargs.get('frequency', None) + self.time_zone = kwargs.get('time_zone', None) + self.advanced_schedule = kwargs.get('advanced_schedule', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + + +class ScheduleAssociationProperty(Model): + """The schedule property associated with the entity. + + :param name: Gets or sets the name of the Schedule. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScheduleAssociationProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class ScheduleCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update schedule operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the Schedule. + :type name: str + :param description: Gets or sets the description of the schedule. + :type description: str + :param start_time: Required. Gets or sets the start time of the schedule. + :type start_time: datetime + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: datetime + :param interval: Gets or sets the interval of the schedule. + :type interval: object + :param frequency: Required. Gets or sets the frequency of the schedule. + Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month', + 'Minute' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param advanced_schedule: Gets or sets the AdvancedSchedule. + :type advanced_schedule: ~azure.mgmt.automation.models.AdvancedSchedule + """ + + _validation = { + 'name': {'required': True}, + 'start_time': {'required': True}, + 'frequency': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'interval': {'key': 'properties.interval', 'type': 'object'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'advanced_schedule': {'key': 'properties.advancedSchedule', 'type': 'AdvancedSchedule'}, + } + + def __init__(self, **kwargs): + super(ScheduleCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.start_time = kwargs.get('start_time', None) + self.expiry_time = kwargs.get('expiry_time', None) + self.interval = kwargs.get('interval', None) + self.frequency = kwargs.get('frequency', None) + self.time_zone = kwargs.get('time_zone', None) + self.advanced_schedule = kwargs.get('advanced_schedule', None) + + +class ScheduleProperties(Model): + """Definition of schedule parameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param start_time: Gets or sets the start time of the schedule. + :type start_time: datetime + :ivar start_time_offset_minutes: Gets the start time's offset in minutes. + :vartype start_time_offset_minutes: float + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: datetime + :param expiry_time_offset_minutes: Gets or sets the expiry time's offset + in minutes. + :type expiry_time_offset_minutes: float + :param is_enabled: Gets or sets a value indicating whether this schedule + is enabled. Default value: False . + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in + minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible + values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month', 'Minute' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param advanced_schedule: Gets or sets the advanced schedule. + :type advanced_schedule: ~azure.mgmt.automation.models.AdvancedSchedule + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'start_time_offset_minutes': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'interval', 'type': 'int'}, + 'frequency': {'key': 'frequency', 'type': 'str'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'advanced_schedule': {'key': 'advancedSchedule', 'type': 'AdvancedSchedule'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScheduleProperties, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.start_time_offset_minutes = None + self.expiry_time = kwargs.get('expiry_time', None) + self.expiry_time_offset_minutes = kwargs.get('expiry_time_offset_minutes', None) + self.is_enabled = kwargs.get('is_enabled', False) + self.next_run = kwargs.get('next_run', None) + self.next_run_offset_minutes = kwargs.get('next_run_offset_minutes', None) + self.interval = kwargs.get('interval', None) + self.frequency = kwargs.get('frequency', None) + self.time_zone = kwargs.get('time_zone', None) + self.advanced_schedule = kwargs.get('advanced_schedule', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + + +class ScheduleUpdateParameters(Model): + """The parameters supplied to the update schedule operation. + + :param name: Gets or sets the name of the Schedule. + :type name: str + :param description: Gets or sets the description of the schedule. + :type description: str + :param is_enabled: Gets or sets a value indicating whether this schedule + is enabled. + :type is_enabled: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ScheduleUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.is_enabled = kwargs.get('is_enabled', None) + + +class Sku(Model): + """The account SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the SKU name of the account. Possible + values include: 'Free', 'Basic' + :type name: str or ~azure.mgmt.automation.models.SkuNameEnum + :param family: Gets or sets the SKU family. + :type family: str + :param capacity: Gets or sets the SKU capacity. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + + +class SoftareUpdateConfigurationRunTaskProperties(Model): + """Task properties of the software update configuration. + + :param status: The status of the task. + :type status: str + :param source: The name of the source of the task. + :type source: str + :param job_id: The job id of the task. + :type job_id: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SoftareUpdateConfigurationRunTaskProperties, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.source = kwargs.get('source', None) + self.job_id = kwargs.get('job_id', None) + + +class SoftareUpdateConfigurationRunTasks(Model): + """Software update configuration run tasks model. + + :param pre_task: Pre task properties. + :type pre_task: + ~azure.mgmt.automation.models.SoftareUpdateConfigurationRunTaskProperties + :param post_task: Post task properties. + :type post_task: + ~azure.mgmt.automation.models.SoftareUpdateConfigurationRunTaskProperties + """ + + _attribute_map = { + 'pre_task': {'key': 'preTask', 'type': 'SoftareUpdateConfigurationRunTaskProperties'}, + 'post_task': {'key': 'postTask', 'type': 'SoftareUpdateConfigurationRunTaskProperties'}, + } + + def __init__(self, **kwargs): + super(SoftareUpdateConfigurationRunTasks, self).__init__(**kwargs) + self.pre_task = kwargs.get('pre_task', None) + self.post_task = kwargs.get('post_task', None) + + +class SoftwareUpdateConfiguration(Model): + """Software update configuration properties. + + 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 name: Resource name. + :vartype name: str + :ivar id: Resource Id. + :vartype id: str + :ivar type: Resource type + :vartype type: str + :param update_configuration: Required. update specific properties for the + Software update configuration + :type update_configuration: + ~azure.mgmt.automation.models.UpdateConfiguration + :param schedule_info: Required. Schedule information for the Software + update configuration + :type schedule_info: ~azure.mgmt.automation.models.ScheduleProperties + :ivar provisioning_state: Provisioning state for the software update + configuration, which only appears in the response. + :vartype provisioning_state: str + :param error: Details of provisioning error + :type error: ~azure.mgmt.automation.models.ErrorResponse + :ivar creation_time: Creation time of the resource, which only appears in + the response. + :vartype creation_time: datetime + :ivar created_by: CreatedBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time: Last time resource was modified, which only + appears in the response. + :vartype last_modified_time: datetime + :ivar last_modified_by: LastModifiedBy property, which only appears in the + response. + :vartype last_modified_by: str + :param tasks: Tasks information for the Software update configuration. + :type tasks: + ~azure.mgmt.automation.models.SoftwareUpdateConfigurationTasks + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'update_configuration': {'required': True}, + 'schedule_info': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'update_configuration': {'key': 'properties.updateConfiguration', 'type': 'UpdateConfiguration'}, + 'schedule_info': {'key': 'properties.scheduleInfo', 'type': 'ScheduleProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'ErrorResponse'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'tasks': {'key': 'properties.tasks', 'type': 'SoftwareUpdateConfigurationTasks'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfiguration, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.update_configuration = kwargs.get('update_configuration', None) + self.schedule_info = kwargs.get('schedule_info', None) + self.provisioning_state = None + self.error = kwargs.get('error', None) + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None + self.tasks = kwargs.get('tasks', None) + + +class SoftwareUpdateConfigurationCollectionItem(Model): + """Software update configuration collection item properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration. + :vartype name: str + :ivar id: Resource Id of the software update configuration + :vartype id: str + :param update_configuration: Update specific properties of the software + update configuration. + :type update_configuration: + ~azure.mgmt.automation.models.CollectionItemUpdateConfiguration + :param frequency: execution frequency of the schedule associated with the + software update configuration. Possible values include: 'OneTime', 'Day', + 'Hour', 'Week', 'Month', 'Minute' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param start_time: the start time of the update. + :type start_time: datetime + :ivar creation_time: Creation time of the software update configuration, + which only appears in the response. + :vartype creation_time: datetime + :ivar last_modified_time: Last time software update configuration was + modified, which only appears in the response. + :vartype last_modified_time: datetime + :ivar provisioning_state: Provisioning state for the software update + configuration, which only appears in the response. + :vartype provisioning_state: str + :param next_run: ext run time of the update. + :type next_run: datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'update_configuration': {'key': 'properties.updateConfiguration', 'type': 'CollectionItemUpdateConfiguration'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationCollectionItem, self).__init__(**kwargs) + self.name = None + self.id = None + self.update_configuration = kwargs.get('update_configuration', None) + self.frequency = kwargs.get('frequency', None) + self.start_time = kwargs.get('start_time', None) + self.creation_time = None + self.last_modified_time = None + self.provisioning_state = None + self.next_run = kwargs.get('next_run', None) + + +class SoftwareUpdateConfigurationListResult(Model): + """result of listing all software update configuration. + + :param value: outer object returned when listing all software update + configurations + :type value: + list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationCollectionItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationCollectionItem]'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class SoftwareUpdateConfigurationMachineRun(Model): + """Software update configuration machine run model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration machine run + :vartype name: str + :ivar id: Resource Id of the software update configuration machine run + :vartype id: str + :ivar target_computer: name of the updated computer + :vartype target_computer: str + :ivar target_computer_type: type of the updated computer. + :vartype target_computer_type: str + :param software_update_configuration: software update configuration + triggered this run + :type software_update_configuration: + ~azure.mgmt.automation.models.UpdateConfigurationNavigation + :ivar status: Status of the software update configuration machine run. + :vartype status: str + :ivar os_type: Operating system target of the software update + configuration triggered this run + :vartype os_type: str + :ivar correlation_id: correlation id of the software update configuration + machine run + :vartype correlation_id: str + :ivar source_computer_id: source computer id of the software update + configuration machine run + :vartype source_computer_id: str + :ivar start_time: Start time of the software update configuration machine + run. + :vartype start_time: datetime + :ivar end_time: End time of the software update configuration machine run. + :vartype end_time: datetime + :ivar configured_duration: configured duration for the software update + configuration run. + :vartype configured_duration: str + :param job: Job associated with the software update configuration machine + run + :type job: ~azure.mgmt.automation.models.JobNavigation + :ivar creation_time: Creation time of the resource, which only appears in + the response. + :vartype creation_time: datetime + :ivar created_by: createdBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time: Last time resource was modified, which only + appears in the response. + :vartype last_modified_time: datetime + :ivar last_modified_by: lastModifiedBy property, which only appears in the + response. + :vartype last_modified_by: str + :param error: Details of provisioning error + :type error: ~azure.mgmt.automation.models.ErrorResponse + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target_computer': {'readonly': True}, + 'target_computer_type': {'readonly': True}, + 'status': {'readonly': True}, + 'os_type': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'source_computer_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'configured_duration': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'target_computer': {'key': 'properties.targetComputer', 'type': 'str'}, + 'target_computer_type': {'key': 'properties.targetComputerType', 'type': 'str'}, + 'software_update_configuration': {'key': 'properties.softwareUpdateConfiguration', 'type': 'UpdateConfigurationNavigation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'source_computer_id': {'key': 'properties.sourceComputerId', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'configured_duration': {'key': 'properties.configuredDuration', 'type': 'str'}, + 'job': {'key': 'properties.job', 'type': 'JobNavigation'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationMachineRun, self).__init__(**kwargs) + self.name = None + self.id = None + self.target_computer = None + self.target_computer_type = None + self.software_update_configuration = kwargs.get('software_update_configuration', None) + self.status = None + self.os_type = None + self.correlation_id = None + self.source_computer_id = None + self.start_time = None + self.end_time = None + self.configured_duration = None + self.job = kwargs.get('job', None) + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None + self.error = kwargs.get('error', None) + + +class SoftwareUpdateConfigurationMachineRunListResult(Model): + """result of listing all software update configuration machine runs. + + :param value: outer object returned when listing all software update + configuration machine runs + :type value: + list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRun] + :param next_link: link to next page of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationMachineRun]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationMachineRunListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class SoftwareUpdateConfigurationRun(Model): + """Software update configuration Run properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration run. + :vartype name: str + :ivar id: Resource Id of the software update configuration run + :vartype id: str + :param software_update_configuration: software update configuration + triggered this run + :type software_update_configuration: + ~azure.mgmt.automation.models.UpdateConfigurationNavigation + :ivar status: Status of the software update configuration run. + :vartype status: str + :ivar configured_duration: Configured duration for the software update + configuration run. + :vartype configured_duration: str + :ivar os_type: Operating system target of the software update + configuration triggered this run + :vartype os_type: str + :ivar start_time: Start time of the software update configuration run. + :vartype start_time: datetime + :ivar end_time: End time of the software update configuration run. + :vartype end_time: datetime + :ivar computer_count: Number of computers in the software update + configuration run. + :vartype computer_count: int + :ivar failed_count: Number of computers with failed status. + :vartype failed_count: int + :ivar creation_time: Creation time of the resource, which only appears in + the response. + :vartype creation_time: datetime + :ivar created_by: CreatedBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time: Last time resource was modified, which only + appears in the response. + :vartype last_modified_time: datetime + :ivar last_modified_by: LastModifiedBy property, which only appears in the + response. + :vartype last_modified_by: str + :param tasks: Software update configuration tasks triggered in this run + :type tasks: + ~azure.mgmt.automation.models.SoftareUpdateConfigurationRunTasks + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'status': {'readonly': True}, + 'configured_duration': {'readonly': True}, + 'os_type': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'computer_count': {'readonly': True}, + 'failed_count': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'software_update_configuration': {'key': 'properties.softwareUpdateConfiguration', 'type': 'UpdateConfigurationNavigation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'configured_duration': {'key': 'properties.configuredDuration', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'computer_count': {'key': 'properties.computerCount', 'type': 'int'}, + 'failed_count': {'key': 'properties.failedCount', 'type': 'int'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'tasks': {'key': 'properties.tasks', 'type': 'SoftareUpdateConfigurationRunTasks'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationRun, self).__init__(**kwargs) + self.name = None + self.id = None + self.software_update_configuration = kwargs.get('software_update_configuration', None) + self.status = None + self.configured_duration = None + self.os_type = None + self.start_time = None + self.end_time = None + self.computer_count = None + self.failed_count = None + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None + self.tasks = kwargs.get('tasks', None) + + +class SoftwareUpdateConfigurationRunListResult(Model): + """result of listing all software update configuration runs. + + :param value: outer object returned when listing all software update + configuration runs + :type value: + list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationRun] + :param next_link: link to next page of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationRun]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationRunListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class SoftwareUpdateConfigurationTasks(Model): + """Task properties of the software update configuration. + + :param pre_task: Pre task properties. + :type pre_task: ~azure.mgmt.automation.models.TaskProperties + :param post_task: Post task properties. + :type post_task: ~azure.mgmt.automation.models.TaskProperties + """ + + _attribute_map = { + 'pre_task': {'key': 'preTask', 'type': 'TaskProperties'}, + 'post_task': {'key': 'postTask', 'type': 'TaskProperties'}, + } + + def __init__(self, **kwargs): + super(SoftwareUpdateConfigurationTasks, self).__init__(**kwargs) + self.pre_task = kwargs.get('pre_task', None) + self.post_task = kwargs.get('post_task', None) + + +class SourceControl(ProxyResource): + """Definition of the source control. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param repo_url: The repo url of the source control. + :type repo_url: str + :param branch: The repo branch of the source control. Include branch as + empty string for VsoTfvc. + :type branch: str + :param folder_path: The folder path of the source control. + :type folder_path: str + :param auto_sync: The auto sync of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is + true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, + GitHub. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param description: The description. + :type description: str + :param creation_time: The creation time. + :type creation_time: datetime + :param last_modified_time: The last modified time. + :type last_modified_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'source_type': {'key': 'properties.sourceType', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SourceControl, self).__init__(**kwargs) + self.repo_url = kwargs.get('repo_url', None) + self.branch = kwargs.get('branch', None) + self.folder_path = kwargs.get('folder_path', None) + self.auto_sync = kwargs.get('auto_sync', None) + self.publish_runbook = kwargs.get('publish_runbook', None) + self.source_type = kwargs.get('source_type', None) + self.description = kwargs.get('description', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + + +class SourceControlCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update source control operation. + + :param repo_url: The repo url of the source control. + :type repo_url: str + :param branch: The repo branch of the source control. Include branch as + empty string for VsoTfvc. + :type branch: str + :param folder_path: The folder path of the source control. Path must be + relative. + :type folder_path: str + :param auto_sync: The auto async of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is + true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, + GitHub, case sensitive. Possible values include: 'VsoGit', 'VsoTfvc', + 'GitHub' + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param security_token: The authorization token for the repo of the source + control. + :type security_token: + ~azure.mgmt.automation.models.SourceControlSecurityTokenProperties + :param description: The user description of the source control. + :type description: str + """ + + _validation = { + 'repo_url': {'max_length': 2000}, + 'branch': {'max_length': 255}, + 'folder_path': {'max_length': 255}, + 'description': {'max_length': 512}, + } + + _attribute_map = { + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'source_type': {'key': 'properties.sourceType', 'type': 'str'}, + 'security_token': {'key': 'properties.securityToken', 'type': 'SourceControlSecurityTokenProperties'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlCreateOrUpdateParameters, self).__init__(**kwargs) + self.repo_url = kwargs.get('repo_url', None) + self.branch = kwargs.get('branch', None) + self.folder_path = kwargs.get('folder_path', None) + self.auto_sync = kwargs.get('auto_sync', None) + self.publish_runbook = kwargs.get('publish_runbook', None) + self.source_type = kwargs.get('source_type', None) + self.security_token = kwargs.get('security_token', None) + self.description = kwargs.get('description', None) + + +class SourceControlSecurityTokenProperties(Model): + """SourceControlSecurityTokenProperties. + + :param access_token: The access token. + :type access_token: str + :param refresh_token: The refresh token. + :type refresh_token: str + :param token_type: The token type. Must be either PersonalAccessToken or + Oauth. Possible values include: 'PersonalAccessToken', 'Oauth' + :type token_type: str or ~azure.mgmt.automation.models.TokenType + """ + + _validation = { + 'access_token': {'max_length': 1024}, + 'refresh_token': {'max_length': 1024}, + } + + _attribute_map = { + 'access_token': {'key': 'accessToken', 'type': 'str'}, + 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, + 'token_type': {'key': 'tokenType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlSecurityTokenProperties, self).__init__(**kwargs) + self.access_token = kwargs.get('access_token', None) + self.refresh_token = kwargs.get('refresh_token', None) + self.token_type = kwargs.get('token_type', None) + + +class SourceControlSyncJob(Model): + """Definition of the source control sync job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: The provisioning state of the job. Possible + values include: 'Completed', 'Failed', 'Running' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ProvisioningState + :ivar start_time: The start time of the job. + :vartype start_time: datetime + :ivar end_time: The end time of the job. + :vartype end_time: datetime + :param sync_type: The sync type. Possible values include: 'PartialSync', + 'FullSync' + :type sync_type: str or ~azure.mgmt.automation.models.SyncType + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_id': {'key': 'properties.sourceControlSyncJobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'sync_type': {'key': 'properties.syncType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlSyncJob, self).__init__(**kwargs) + self.name = None + self.type = None + self.id = None + self.source_control_sync_job_id = kwargs.get('source_control_sync_job_id', None) + self.creation_time = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.start_time = None + self.end_time = None + self.sync_type = kwargs.get('sync_type', None) + + +class SourceControlSyncJobById(Model): + """Definition of the source control sync job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: The id of the job. + :type id: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: The provisioning state of the job. Possible + values include: 'Completed', 'Failed', 'Running' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ProvisioningState + :ivar start_time: The start time of the job. + :vartype start_time: datetime + :ivar end_time: The end time of the job. + :vartype end_time: datetime + :param sync_type: The sync type. Possible values include: 'PartialSync', + 'FullSync' + :type sync_type: str or ~azure.mgmt.automation.models.SyncType + :param exception: The exceptions that occurred while running the sync job. + :type exception: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_id': {'key': 'properties.sourceControlSyncJobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'sync_type': {'key': 'properties.syncType', 'type': 'str'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlSyncJobById, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.source_control_sync_job_id = kwargs.get('source_control_sync_job_id', None) + self.creation_time = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.start_time = None + self.end_time = None + self.sync_type = kwargs.get('sync_type', None) + self.exception = kwargs.get('exception', None) + + +class SourceControlSyncJobCreateParameters(Model): + """The parameters supplied to the create source control sync job operation. + + All required parameters must be populated in order to send to Azure. + + :param commit_id: Required. The commit id of the source control sync job. + If not syncing to a commitId, enter an empty string. + :type commit_id: str + """ + + _validation = { + 'commit_id': {'required': True, 'min_length': 0}, + } + + _attribute_map = { + 'commit_id': {'key': 'properties.commitId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlSyncJobCreateParameters, self).__init__(**kwargs) + self.commit_id = kwargs.get('commit_id', None) + + +class SourceControlSyncJobStream(Model): + """Definition of the source control sync job stream. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_stream_id: The sync job stream id. + :type source_control_sync_job_stream_id: str + :param summary: The summary of the sync job stream. + :type summary: str + :ivar time: The time of the sync job stream. + :vartype time: datetime + :param stream_type: The type of the sync job stream. Possible values + include: 'Error', 'Output' + :type stream_type: str or ~azure.mgmt.automation.models.StreamType + """ + + _validation = { + 'id': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_stream_id': {'key': 'properties.sourceControlSyncJobStreamId', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlSyncJobStream, self).__init__(**kwargs) + self.id = None + self.source_control_sync_job_stream_id = kwargs.get('source_control_sync_job_stream_id', None) + self.summary = kwargs.get('summary', None) + self.time = None + self.stream_type = kwargs.get('stream_type', None) + + +class SourceControlSyncJobStreamById(Model): + """Definition of the source control sync job stream by id. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_stream_id: The sync job stream id. + :type source_control_sync_job_stream_id: str + :param summary: The summary of the sync job stream. + :type summary: str + :ivar time: The time of the sync job stream. + :vartype time: datetime + :param stream_type: The type of the sync job stream. Possible values + include: 'Error', 'Output' + :type stream_type: str or ~azure.mgmt.automation.models.StreamType + :param stream_text: The text of the sync job stream. + :type stream_text: str + :param value: The values of the job stream. + :type value: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_stream_id': {'key': 'properties.sourceControlSyncJobStreamId', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + 'stream_text': {'key': 'properties.streamText', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '{object}'}, + } + + def __init__(self, **kwargs): + super(SourceControlSyncJobStreamById, self).__init__(**kwargs) + self.id = None + self.source_control_sync_job_stream_id = kwargs.get('source_control_sync_job_stream_id', None) + self.summary = kwargs.get('summary', None) + self.time = None + self.stream_type = kwargs.get('stream_type', None) + self.stream_text = kwargs.get('stream_text', None) + self.value = kwargs.get('value', None) + + +class SourceControlUpdateParameters(Model): + """The parameters supplied to the update source control operation. + + :param branch: The repo branch of the source control. + :type branch: str + :param folder_path: The folder path of the source control. Path must be + relative. + :type folder_path: str + :param auto_sync: The auto sync of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is + true. + :type publish_runbook: bool + :param security_token: The authorization token for the repo of the source + control. + :type security_token: + ~azure.mgmt.automation.models.SourceControlSecurityTokenProperties + :param description: The user description of the source control. + :type description: str + """ + + _attribute_map = { + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'security_token': {'key': 'properties.securityToken', 'type': 'SourceControlSecurityTokenProperties'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceControlUpdateParameters, self).__init__(**kwargs) + self.branch = kwargs.get('branch', None) + self.folder_path = kwargs.get('folder_path', None) + self.auto_sync = kwargs.get('auto_sync', None) + self.publish_runbook = kwargs.get('publish_runbook', None) + self.security_token = kwargs.get('security_token', None) + self.description = kwargs.get('description', None) + + +class Statistics(Model): + """Definition of the statistic. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar counter_property: Gets the property value of the statistic. + :vartype counter_property: str + :ivar counter_value: Gets the value of the statistic. + :vartype counter_value: long + :ivar start_time: Gets the startTime of the statistic. + :vartype start_time: datetime + :ivar end_time: Gets the endTime of the statistic. + :vartype end_time: datetime + :ivar id: Gets the id. + :vartype id: str + """ + + _validation = { + 'counter_property': {'readonly': True}, + 'counter_value': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'counter_property': {'key': 'counterProperty', 'type': 'str'}, + 'counter_value': {'key': 'counterValue', 'type': 'long'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Statistics, self).__init__(**kwargs) + self.counter_property = None + self.counter_value = None + self.start_time = None + self.end_time = None + self.id = None + + +class TagSettingsProperties(Model): + """Tag filter information for the VM. + + :param tags: Dictionary of tags with its list of values. + :type tags: dict[str, list[str]] + :param filter_operator: Filter VMs by Any or All specified tags. Possible + values include: 'All', 'Any' + :type filter_operator: str or ~azure.mgmt.automation.models.TagOperators + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{[str]}'}, + 'filter_operator': {'key': 'filterOperator', 'type': 'TagOperators'}, + } + + def __init__(self, **kwargs): + super(TagSettingsProperties, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.filter_operator = kwargs.get('filter_operator', None) + + +class TargetProperties(Model): + """Group specific to the update configuration. + + :param azure_queries: List of Azure queries in the software update + configuration. + :type azure_queries: + list[~azure.mgmt.automation.models.AzureQueryProperties] + :param non_azure_queries: List of non Azure queries in the software update + configuration. + :type non_azure_queries: + list[~azure.mgmt.automation.models.NonAzureQueryProperties] + """ + + _attribute_map = { + 'azure_queries': {'key': 'azureQueries', 'type': '[AzureQueryProperties]'}, + 'non_azure_queries': {'key': 'nonAzureQueries', 'type': '[NonAzureQueryProperties]'}, + } + + def __init__(self, **kwargs): + super(TargetProperties, self).__init__(**kwargs) + self.azure_queries = kwargs.get('azure_queries', None) + self.non_azure_queries = kwargs.get('non_azure_queries', None) + + +class TaskProperties(Model): + """Task properties of the software update configuration. + + :param parameters: Gets or sets the parameters of the task. + :type parameters: dict[str, str] + :param source: Gets or sets the name of the runbook. + :type source: str + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'source': {'key': 'source', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TaskProperties, self).__init__(**kwargs) + self.parameters = kwargs.get('parameters', None) + self.source = kwargs.get('source', None) + + +class TestJob(Model): + """Definition of the test job. + + :param creation_time: Gets or sets the creation time of the test job. + :type creation_time: datetime + :param status: Gets or sets the status of the test job. + :type status: str + :param status_details: Gets or sets the status details of the test job. + :type status_details: str + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + :param start_time: Gets or sets the start time of the test job. + :type start_time: datetime + :param end_time: Gets or sets the end time of the test job. + :type end_time: datetime + :param exception: Gets or sets the exception of the test job. + :type exception: str + :param last_modified_time: Gets or sets the last modified time of the test + job. + :type last_modified_time: datetime + :param last_status_modified_time: Gets or sets the last status modified + time of the test job. + :type last_status_modified_time: datetime + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param log_activity_trace: The activity-level tracing options of the + runbook. + :type log_activity_trace: int + """ + + _attribute_map = { + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_details': {'key': 'statusDetails', 'type': 'str'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'exception', 'type': 'str'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'log_activity_trace': {'key': 'logActivityTrace', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(TestJob, self).__init__(**kwargs) + self.creation_time = kwargs.get('creation_time', None) + self.status = kwargs.get('status', None) + self.status_details = kwargs.get('status_details', None) + self.run_on = kwargs.get('run_on', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.exception = kwargs.get('exception', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.last_status_modified_time = kwargs.get('last_status_modified_time', None) + self.parameters = kwargs.get('parameters', None) + self.log_activity_trace = kwargs.get('log_activity_trace', None) + + +class TestJobCreateParameters(Model): + """The parameters supplied to the create test job operation. + + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TestJobCreateParameters, self).__init__(**kwargs) + self.parameters = kwargs.get('parameters', None) + self.run_on = kwargs.get('run_on', None) + + +class TypeField(Model): + """Information about a field of a type. + + :param name: Gets or sets the name of the field. + :type name: str + :param type: Gets or sets the type of the field. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TypeField, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class UpdateConfiguration(Model): + """Update specific properties of the software update configuration. + + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. operating system of target machines. + Possible values include: 'Windows', 'Linux' + :type operating_system: str or + ~azure.mgmt.automation.models.OperatingSystemType + :param windows: Windows specific update configuration. + :type windows: ~azure.mgmt.automation.models.WindowsProperties + :param linux: Linux specific update configuration. + :type linux: ~azure.mgmt.automation.models.LinuxProperties + :param duration: Maximum time allowed for the software update + configuration run. Duration needs to be specified using the format + PT[n]H[n]M[n]S as per ISO8601 + :type duration: timedelta + :param azure_virtual_machines: List of azure resource Ids for azure + virtual machines targeted by the software update configuration. + :type azure_virtual_machines: list[str] + :param non_azure_computer_names: List of names of non-azure machines + targeted by the software update configuration. + :type non_azure_computer_names: list[str] + :param targets: Group targets for the software update configuration. + :type targets: ~azure.mgmt.automation.models.TargetProperties + """ + + _validation = { + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemType'}, + 'windows': {'key': 'windows', 'type': 'WindowsProperties'}, + 'linux': {'key': 'linux', 'type': 'LinuxProperties'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'azure_virtual_machines': {'key': 'azureVirtualMachines', 'type': '[str]'}, + 'non_azure_computer_names': {'key': 'nonAzureComputerNames', 'type': '[str]'}, + 'targets': {'key': 'targets', 'type': 'TargetProperties'}, + } + + def __init__(self, **kwargs): + super(UpdateConfiguration, self).__init__(**kwargs) + self.operating_system = kwargs.get('operating_system', None) + self.windows = kwargs.get('windows', None) + self.linux = kwargs.get('linux', None) + self.duration = kwargs.get('duration', None) + self.azure_virtual_machines = kwargs.get('azure_virtual_machines', None) + self.non_azure_computer_names = kwargs.get('non_azure_computer_names', None) + self.targets = kwargs.get('targets', None) + + +class UpdateConfigurationNavigation(Model): + """Software update configuration Run Navigation model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration triggered the + software update configuration run + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateConfigurationNavigation, self).__init__(**kwargs) + self.name = None + + +class Usage(Model): + """Definition of Usage. + + :param id: Gets or sets the id of the resource. + :type id: str + :param name: Gets or sets the usage counter name. + :type name: ~azure.mgmt.automation.models.UsageCounterName + :param unit: Gets or sets the usage unit name. + :type unit: str + :param current_value: Gets or sets the current usage value. + :type current_value: float + :param limit: Gets or sets max limit. -1 for unlimited + :type limit: long + :param throttle_status: Gets or sets the throttle status. + :type throttle_status: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'UsageCounterName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'throttle_status': {'key': 'throttleStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.unit = kwargs.get('unit', None) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.throttle_status = kwargs.get('throttle_status', None) + + +class UsageCounterName(Model): + """Definition of usage counter name. + + :param value: Gets or sets the usage counter name. + :type value: str + :param localized_value: Gets or sets the localized usage counter name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageCounterName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) + + +class Variable(ProxyResource): + """Definition of the variable. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param value: Gets or sets the value of the variable. + :type value: str + :param is_encrypted: Gets or sets the encrypted flag of the variable. + :type is_encrypted: bool + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'is_encrypted': {'key': 'properties.isEncrypted', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Variable, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.is_encrypted = kwargs.get('is_encrypted', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.description = kwargs.get('description', None) + + +class VariableCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update variable operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the variable. + :type name: str + :param value: Gets or sets the value of the variable. + :type value: str + :param description: Gets or sets the description of the variable. + :type description: str + :param is_encrypted: Gets or sets the encrypted flag of the variable. + :type is_encrypted: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_encrypted': {'key': 'properties.isEncrypted', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(VariableCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.description = kwargs.get('description', None) + self.is_encrypted = kwargs.get('is_encrypted', None) + + +class VariableUpdateParameters(Model): + """The parameters supplied to the update variable operation. + + :param name: Gets or sets the name of the variable. + :type name: str + :param value: Gets or sets the value of the variable. + :type value: str + :param description: Gets or sets the description of the variable. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VariableUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.description = kwargs.get('description', None) + + +class Watcher(TrackedResource): + """Definition of the watcher type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param execution_frequency_in_seconds: Gets or sets the frequency at which + the watcher is invoked. + :type execution_frequency_in_seconds: long + :param script_name: Gets or sets the name of the script the watcher is + attached to, i.e. the name of an existing runbook. + :type script_name: str + :param script_parameters: Gets or sets the parameters of the script. + :type script_parameters: dict[str, str] + :param script_run_on: Gets or sets the name of the hybrid worker group the + watcher will run on. + :type script_run_on: str + :ivar status: Gets the current status of the watcher. + :vartype status: str + :ivar creation_time: Gets or sets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets or sets the last modified time. + :vartype last_modified_time: datetime + :ivar last_modified_by: Details of the user who last modified the watcher. + :vartype last_modified_by: str + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'execution_frequency_in_seconds': {'key': 'properties.executionFrequencyInSeconds', 'type': 'long'}, + 'script_name': {'key': 'properties.scriptName', 'type': 'str'}, + 'script_parameters': {'key': 'properties.scriptParameters', 'type': '{str}'}, + 'script_run_on': {'key': 'properties.scriptRunOn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Watcher, self).__init__(**kwargs) + self.execution_frequency_in_seconds = kwargs.get('execution_frequency_in_seconds', None) + self.script_name = kwargs.get('script_name', None) + self.script_parameters = kwargs.get('script_parameters', None) + self.script_run_on = kwargs.get('script_run_on', None) + self.status = None + self.creation_time = None + self.last_modified_time = None + self.last_modified_by = None + self.description = kwargs.get('description', None) + self.etag = kwargs.get('etag', None) + + +class WatcherUpdateParameters(Model): + """WatcherUpdateParameters. + + :param execution_frequency_in_seconds: Gets or sets the frequency at which + the watcher is invoked. + :type execution_frequency_in_seconds: long + :param name: Gets or sets the name of the resource. + :type name: str + """ + + _attribute_map = { + 'execution_frequency_in_seconds': {'key': 'properties.executionFrequencyInSeconds', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WatcherUpdateParameters, self).__init__(**kwargs) + self.execution_frequency_in_seconds = kwargs.get('execution_frequency_in_seconds', None) + self.name = kwargs.get('name', None) + + +class Webhook(ProxyResource): + """Definition of the webhook type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param is_enabled: Gets or sets the value of the enabled flag of the + webhook. Default value: False . + :type is_enabled: bool + :param uri: Gets or sets the webhook uri. + :type uri: str + :param expiry_time: Gets or sets the expiry time. + :type expiry_time: datetime + :param last_invoked_time: Gets or sets the last invoked time. + :type last_invoked_time: datetime + :param parameters: Gets or sets the parameters of the job that is created + when the webhook calls the runbook it is associated with. + :type parameters: dict[str, str] + :param runbook: Gets or sets the runbook the webhook is associated with. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the name of the hybrid worker group the + webhook job will run on. + :type run_on: str + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param last_modified_by: Details of the user who last modified the Webhook + :type last_modified_by: str + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'last_invoked_time': {'key': 'properties.lastInvokedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Webhook, self).__init__(**kwargs) + self.is_enabled = kwargs.get('is_enabled', False) + self.uri = kwargs.get('uri', None) + self.expiry_time = kwargs.get('expiry_time', None) + self.last_invoked_time = kwargs.get('last_invoked_time', None) + self.parameters = kwargs.get('parameters', None) + self.runbook = kwargs.get('runbook', None) + self.run_on = kwargs.get('run_on', None) + self.creation_time = kwargs.get('creation_time', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.description = kwargs.get('description', None) + + +class WebhookCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update webhook operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the webhook. + :type name: str + :param is_enabled: Gets or sets the value of the enabled flag of webhook. + :type is_enabled: bool + :param uri: Gets or sets the uri. + :type uri: str + :param expiry_time: Gets or sets the expiry time. + :type expiry_time: datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the name of the hybrid worker group the + webhook job will run on. + :type run_on: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WebhookCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_enabled = kwargs.get('is_enabled', None) + self.uri = kwargs.get('uri', None) + self.expiry_time = kwargs.get('expiry_time', None) + self.parameters = kwargs.get('parameters', None) + self.runbook = kwargs.get('runbook', None) + self.run_on = kwargs.get('run_on', None) + + +class WebhookUpdateParameters(Model): + """The parameters supplied to the update webhook operation. + + :param name: Gets or sets the name of the webhook. + :type name: str + :param is_enabled: Gets or sets the value of the enabled flag of webhook. + :type is_enabled: bool + :param run_on: Gets or sets the name of the hybrid worker group the + webhook job will run on. + :type run_on: str + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param description: Gets or sets the description of the webhook. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WebhookUpdateParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_enabled = kwargs.get('is_enabled', None) + self.run_on = kwargs.get('run_on', None) + self.parameters = kwargs.get('parameters', None) + self.description = kwargs.get('description', None) + + +class WindowsProperties(Model): + """Windows specific update configuration. + + :param included_update_classifications: Update classification included in + the software update configuration. A comma separated string with required + values. Possible values include: 'Unclassified', 'Critical', 'Security', + 'UpdateRollup', 'FeaturePack', 'ServicePack', 'Definition', 'Tools', + 'Updates' + :type included_update_classifications: str or + ~azure.mgmt.automation.models.WindowsUpdateClasses + :param excluded_kb_numbers: KB numbers excluded from the software update + configuration. + :type excluded_kb_numbers: list[str] + :param included_kb_numbers: KB numbers included from the software update + configuration. + :type included_kb_numbers: list[str] + :param reboot_setting: Reboot setting for the software update + configuration. + :type reboot_setting: str + """ + + _attribute_map = { + 'included_update_classifications': {'key': 'includedUpdateClassifications', 'type': 'str'}, + 'excluded_kb_numbers': {'key': 'excludedKbNumbers', 'type': '[str]'}, + 'included_kb_numbers': {'key': 'includedKbNumbers', 'type': '[str]'}, + 'reboot_setting': {'key': 'rebootSetting', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WindowsProperties, self).__init__(**kwargs) + self.included_update_classifications = kwargs.get('included_update_classifications', None) + self.excluded_kb_numbers = kwargs.get('excluded_kb_numbers', None) + self.included_kb_numbers = kwargs.get('included_kb_numbers', None) + self.reboot_setting = kwargs.get('reboot_setting', None) diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_models_py3.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_models_py3.py new file mode 100644 index 000000000000..18f9f01b4107 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_models_py3.py @@ -0,0 +1,5338 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class Activity(Model): + """Definition of the activity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Gets or sets the id of the resource. + :type id: str + :ivar name: Gets the name of the activity. + :vartype name: str + :param definition: Gets or sets the user name of the activity. + :type definition: str + :param parameter_sets: Gets or sets the parameter sets of the activity. + :type parameter_sets: + list[~azure.mgmt.automation.models.ActivityParameterSet] + :param output_types: Gets or sets the output types of the activity. + :type output_types: list[~azure.mgmt.automation.models.ActivityOutputType] + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'definition': {'key': 'properties.definition', 'type': 'str'}, + 'parameter_sets': {'key': 'properties.parameterSets', 'type': '[ActivityParameterSet]'}, + 'output_types': {'key': 'properties.outputTypes', 'type': '[ActivityOutputType]'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, definition: str=None, parameter_sets=None, output_types=None, creation_time=None, last_modified_time=None, description: str=None, **kwargs) -> None: + super(Activity, self).__init__(**kwargs) + self.id = id + self.name = None + self.definition = definition + self.parameter_sets = parameter_sets + self.output_types = output_types + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + + +class ActivityOutputType(Model): + """Definition of the activity output type. + + :param name: Gets or sets the name of the activity output type. + :type name: str + :param type: Gets or sets the type of the activity output type. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type: str=None, **kwargs) -> None: + super(ActivityOutputType, self).__init__(**kwargs) + self.name = name + self.type = type + + +class ActivityParameter(Model): + """Definition of the activity parameter. + + :param name: Gets or sets the name of the activity parameter. + :type name: str + :param type: Gets or sets the type of the activity parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value that indicates true if + the parameter is required. If the value is false, the parameter is + optional. + :type is_mandatory: bool + :param is_dynamic: Gets or sets a Boolean value that indicates true if the + parameter is dynamic. + :type is_dynamic: bool + :param position: Gets or sets the position of the activity parameter. + :type position: long + :param value_from_pipeline: Gets or sets a Boolean value that indicates + true if the parameter can take values from the incoming pipeline objects. + This setting is used if the cmdlet must access the complete input object. + false indicates that the parameter cannot take values from the complete + input object. + :type value_from_pipeline: bool + :param value_from_pipeline_by_property_name: Gets or sets a Boolean value + that indicates true if the parameter can be filled from a property of the + incoming pipeline object that has the same name as this parameter. false + indicates that the parameter cannot be filled from the incoming pipeline + object property with the same name. + :type value_from_pipeline_by_property_name: bool + :param value_from_remaining_arguments: Gets or sets a Boolean value that + indicates true if the cmdlet parameter accepts all the remaining + command-line arguments that are associated with this parameter in the form + of an array. false if the cmdlet parameter does not accept all the + remaining argument values. + :type value_from_remaining_arguments: bool + :param description: Gets or sets the description of the activity + parameter. + :type description: str + :param validation_set: Gets or sets the validation set of activity + parameter. + :type validation_set: + list[~azure.mgmt.automation.models.ActivityParameterValidationSet] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'is_dynamic': {'key': 'isDynamic', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'long'}, + 'value_from_pipeline': {'key': 'valueFromPipeline', 'type': 'bool'}, + 'value_from_pipeline_by_property_name': {'key': 'valueFromPipelineByPropertyName', 'type': 'bool'}, + 'value_from_remaining_arguments': {'key': 'valueFromRemainingArguments', 'type': 'bool'}, + 'description': {'key': 'description', 'type': 'str'}, + 'validation_set': {'key': 'validationSet', 'type': '[ActivityParameterValidationSet]'}, + } + + def __init__(self, *, name: str=None, type: str=None, is_mandatory: bool=None, is_dynamic: bool=None, position: int=None, value_from_pipeline: bool=None, value_from_pipeline_by_property_name: bool=None, value_from_remaining_arguments: bool=None, description: str=None, validation_set=None, **kwargs) -> None: + super(ActivityParameter, self).__init__(**kwargs) + self.name = name + self.type = type + self.is_mandatory = is_mandatory + self.is_dynamic = is_dynamic + self.position = position + self.value_from_pipeline = value_from_pipeline + self.value_from_pipeline_by_property_name = value_from_pipeline_by_property_name + self.value_from_remaining_arguments = value_from_remaining_arguments + self.description = description + self.validation_set = validation_set + + +class ActivityParameterSet(Model): + """Definition of the activity parameter set. + + :param name: Gets or sets the name of the activity parameter set. + :type name: str + :param parameters: Gets or sets the parameters of the activity parameter + set. + :type parameters: list[~azure.mgmt.automation.models.ActivityParameter] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[ActivityParameter]'}, + } + + def __init__(self, *, name: str=None, parameters=None, **kwargs) -> None: + super(ActivityParameterSet, self).__init__(**kwargs) + self.name = name + self.parameters = parameters + + +class ActivityParameterValidationSet(Model): + """Definition of the activity parameter validation set. + + :param member_value: Gets or sets the name of the activity parameter + validation set member. + :type member_value: str + """ + + _attribute_map = { + 'member_value': {'key': 'memberValue', 'type': 'str'}, + } + + def __init__(self, *, member_value: str=None, **kwargs) -> None: + super(ActivityParameterValidationSet, self).__init__(**kwargs) + self.member_value = member_value + + +class AdvancedSchedule(Model): + """The properties of the create Advanced Schedule. + + :param week_days: Days of the week that the job should execute on. + :type week_days: list[str] + :param month_days: Days of the month that the job should execute on. Must + be between 1 and 31. + :type month_days: list[int] + :param monthly_occurrences: Occurrences of days within a month. + :type monthly_occurrences: + list[~azure.mgmt.automation.models.AdvancedScheduleMonthlyOccurrence] + """ + + _attribute_map = { + 'week_days': {'key': 'weekDays', 'type': '[str]'}, + 'month_days': {'key': 'monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'monthlyOccurrences', 'type': '[AdvancedScheduleMonthlyOccurrence]'}, + } + + def __init__(self, *, week_days=None, month_days=None, monthly_occurrences=None, **kwargs) -> None: + super(AdvancedSchedule, self).__init__(**kwargs) + self.week_days = week_days + self.month_days = month_days + self.monthly_occurrences = monthly_occurrences + + +class AdvancedScheduleMonthlyOccurrence(Model): + """The properties of the create advanced schedule monthly occurrence. + + :param occurrence: Occurrence of the week within the month. Must be + between 1 and 5 + :type occurrence: int + :param day: Day of the occurrence. Must be one of monday, tuesday, + wednesday, thursday, friday, saturday, sunday. Possible values include: + 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', + 'Sunday' + :type day: str or ~azure.mgmt.automation.models.ScheduleDay + """ + + _attribute_map = { + 'occurrence': {'key': 'occurrence', 'type': 'int'}, + 'day': {'key': 'day', 'type': 'str'}, + } + + def __init__(self, *, occurrence: int=None, day=None, **kwargs) -> None: + super(AdvancedScheduleMonthlyOccurrence, self).__init__(**kwargs) + self.occurrence = occurrence + self.day = day + + +class AgentRegistration(Model): + """Definition of the agent registration information type. + + :param dsc_meta_configuration: Gets or sets the dsc meta configuration. + :type dsc_meta_configuration: str + :param endpoint: Gets or sets the dsc server endpoint. + :type endpoint: str + :param keys: Gets or sets the agent registration keys. + :type keys: ~azure.mgmt.automation.models.AgentRegistrationKeys + :param id: Gets or sets the id. + :type id: str + """ + + _attribute_map = { + 'dsc_meta_configuration': {'key': 'dscMetaConfiguration', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'keys': {'key': 'keys', 'type': 'AgentRegistrationKeys'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, dsc_meta_configuration: str=None, endpoint: str=None, keys=None, id: str=None, **kwargs) -> None: + super(AgentRegistration, self).__init__(**kwargs) + self.dsc_meta_configuration = dsc_meta_configuration + self.endpoint = endpoint + self.keys = keys + self.id = id + + +class AgentRegistrationKeys(Model): + """Definition of the agent registration keys. + + :param primary: Gets or sets the primary key. + :type primary: str + :param secondary: Gets or sets the secondary key. + :type secondary: str + """ + + _attribute_map = { + 'primary': {'key': 'primary', 'type': 'str'}, + 'secondary': {'key': 'secondary', 'type': 'str'}, + } + + def __init__(self, *, primary: str=None, secondary: str=None, **kwargs) -> None: + super(AgentRegistrationKeys, self).__init__(**kwargs) + self.primary = primary + self.secondary = secondary + + +class AgentRegistrationRegenerateKeyParameter(Model): + """The parameters supplied to the regenerate keys operation. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. Gets or sets the agent registration key name - + primary or secondary. Possible values include: 'primary', 'secondary' + :type key_name: str or + ~azure.mgmt.automation.models.AgentRegistrationKeyName + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name, **kwargs) -> None: + super(AgentRegistrationRegenerateKeyParameter, self).__init__(**kwargs) + self.key_name = key_name + + +class Resource(Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, tags=None, location: str=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class AutomationAccount(TrackedResource): + """Definition of the automation account type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param sku: Gets or sets the SKU of account. + :type sku: ~azure.mgmt.automation.models.Sku + :param last_modified_by: Gets or sets the last modified by. + :type last_modified_by: str + :ivar state: Gets status of account. Possible values include: 'Ok', + 'Unavailable', 'Suspended' + :vartype state: str or + ~azure.mgmt.automation.models.AutomationAccountState + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, tags=None, location: str=None, sku=None, last_modified_by: str=None, description: str=None, etag: str=None, **kwargs) -> None: + super(AutomationAccount, self).__init__(tags=tags, location=location, **kwargs) + self.sku = sku + self.last_modified_by = last_modified_by + self.state = None + self.creation_time = None + self.last_modified_time = None + self.description = description + self.etag = etag + + +class AutomationAccountCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update automation account + operation. + + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, sku=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(AutomationAccountCreateOrUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.name = name + self.location = location + self.tags = tags + + +class AutomationAccountUpdateParameters(Model): + """The parameters supplied to the update automation account operation. + + :param sku: Gets or sets account SKU. + :type sku: ~azure.mgmt.automation.models.Sku + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, sku=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(AutomationAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.name = name + self.location = location + self.tags = tags + + +class AzureQueryProperties(Model): + """Azure query for the update configuration. + + :param scope: List of Subscription or Resource Group ARM Ids. + :type scope: list[str] + :param locations: List of locations to scope the query to. + :type locations: list[str] + :param tag_settings: Tag settings for the VM. + :type tag_settings: ~azure.mgmt.automation.models.TagSettingsProperties + """ + + _attribute_map = { + 'scope': {'key': 'scope', 'type': '[str]'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'tag_settings': {'key': 'tagSettings', 'type': 'TagSettingsProperties'}, + } + + def __init__(self, *, scope=None, locations=None, tag_settings=None, **kwargs) -> None: + super(AzureQueryProperties, self).__init__(**kwargs) + self.scope = scope + self.locations = locations + self.tag_settings = tag_settings + + +class ProxyResource(Resource): + """ARM proxy resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class Certificate(ProxyResource): + """Definition of the certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar thumbprint: Gets the thumbprint of the certificate. + :vartype thumbprint: str + :ivar expiry_time: Gets the expiry time of the certificate. + :vartype expiry_time: datetime + :ivar is_exportable: Gets the is exportable flag of the certificate. + :vartype is_exportable: bool + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'expiry_time': {'readonly': True}, + 'is_exportable': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'is_exportable': {'key': 'properties.isExportable', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, **kwargs) -> None: + super(Certificate, self).__init__(**kwargs) + self.thumbprint = None + self.expiry_time = None + self.is_exportable = None + self.creation_time = None + self.last_modified_time = None + self.description = description + + +class CertificateCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update or replace certificate + operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the certificate. + :type name: str + :param base64_value: Required. Gets or sets the base64 encoded value of + the certificate. + :type base64_value: str + :param description: Gets or sets the description of the certificate. + :type description: str + :param thumbprint: Gets or sets the thumbprint of the certificate. + :type thumbprint: str + :param is_exportable: Gets or sets the is exportable flag of the + certificate. + :type is_exportable: bool + """ + + _validation = { + 'name': {'required': True}, + 'base64_value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'base64_value': {'key': 'properties.base64Value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'is_exportable': {'key': 'properties.isExportable', 'type': 'bool'}, + } + + def __init__(self, *, name: str, base64_value: str, description: str=None, thumbprint: str=None, is_exportable: bool=None, **kwargs) -> None: + super(CertificateCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.base64_value = base64_value + self.description = description + self.thumbprint = thumbprint + self.is_exportable = is_exportable + + +class CertificateUpdateParameters(Model): + """The parameters supplied to the update certificate operation. + + :param name: Gets or sets the name of the certificate. + :type name: str + :param description: Gets or sets the description of the certificate. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, description: str=None, **kwargs) -> None: + super(CertificateUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CollectionItemUpdateConfiguration(Model): + """object returned when requesting a collection of software update + configuration. + + :param azure_virtual_machines: List of azure resource Ids for azure + virtual machines targeted by the software update configuration. + :type azure_virtual_machines: list[str] + :param duration: Maximum time allowed for the software update + configuration run. Duration needs to be specified using the format + PT[n]H[n]M[n]S as per ISO8601 + :type duration: timedelta + """ + + _attribute_map = { + 'azure_virtual_machines': {'key': 'azureVirtualMachines', 'type': '[str]'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + } + + def __init__(self, *, azure_virtual_machines=None, duration=None, **kwargs) -> None: + super(CollectionItemUpdateConfiguration, self).__init__(**kwargs) + self.azure_virtual_machines = azure_virtual_machines + self.duration = duration + + +class Connection(ProxyResource): + """Definition of the connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param connection_type: Gets or sets the connectionType of the connection. + :type connection_type: + ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :ivar field_definition_values: Gets the field definition values of the + connection. + :vartype field_definition_values: dict[str, str] + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'field_definition_values': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'ConnectionTypeAssociationProperty'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, connection_type=None, description: str=None, **kwargs) -> None: + super(Connection, self).__init__(**kwargs) + self.connection_type = connection_type + self.field_definition_values = None + self.creation_time = None + self.last_modified_time = None + self.description = description + + +class ConnectionCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update connection operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the connection. + :type name: str + :param description: Gets or sets the description of the connection. + :type description: str + :param connection_type: Required. Gets or sets the connectionType of the + connection. + :type connection_type: + ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty + :param field_definition_values: Gets or sets the field definition + properties of the connection. + :type field_definition_values: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'connection_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'ConnectionTypeAssociationProperty'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + } + + def __init__(self, *, name: str, connection_type, description: str=None, field_definition_values=None, **kwargs) -> None: + super(ConnectionCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + self.connection_type = connection_type + self.field_definition_values = field_definition_values + + +class ConnectionType(Model): + """Definition of the connection type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets the name of the connection type. + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param is_global: Gets or sets a Boolean value to indicate if the + connection type is global. + :type is_global: bool + :ivar field_definitions: Gets the field definitions of the connection + type. + :vartype field_definitions: dict[str, + ~azure.mgmt.automation.models.FieldDefinition] + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'field_definitions': {'readonly': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'field_definitions': {'key': 'properties.fieldDefinitions', 'type': '{FieldDefinition}'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, is_global: bool=None, last_modified_time=None, description: str=None, **kwargs) -> None: + super(ConnectionType, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.is_global = is_global + self.field_definitions = None + self.creation_time = None + self.last_modified_time = last_modified_time + self.description = description + + +class ConnectionTypeAssociationProperty(Model): + """The connection type property associated with the entity. + + :param name: Gets or sets the name of the connection type. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(ConnectionTypeAssociationProperty, self).__init__(**kwargs) + self.name = name + + +class ConnectionTypeCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update connection type operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the connection type. + :type name: str + :param is_global: Gets or sets a Boolean value to indicate if the + connection type is global. + :type is_global: bool + :param field_definitions: Required. Gets or sets the field definitions of + the connection type. + :type field_definitions: dict[str, + ~azure.mgmt.automation.models.FieldDefinition] + """ + + _validation = { + 'name': {'required': True}, + 'field_definitions': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'field_definitions': {'key': 'properties.fieldDefinitions', 'type': '{FieldDefinition}'}, + } + + def __init__(self, *, name: str, field_definitions, is_global: bool=None, **kwargs) -> None: + super(ConnectionTypeCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.is_global = is_global + self.field_definitions = field_definitions + + +class ConnectionUpdateParameters(Model): + """The parameters supplied to the update connection operation. + + :param name: Gets or sets the name of the connection. + :type name: str + :param description: Gets or sets the description of the connection. + :type description: str + :param field_definition_values: Gets or sets the field definition values + of the connection. + :type field_definition_values: dict[str, str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'field_definition_values': {'key': 'properties.fieldDefinitionValues', 'type': '{str}'}, + } + + def __init__(self, *, name: str=None, description: str=None, field_definition_values=None, **kwargs) -> None: + super(ConnectionUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + self.field_definition_values = field_definition_values + + +class ContentHash(Model): + """Definition of the runbook property type. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. Gets or sets the content hash algorithm used + to hash the content. + :type algorithm: str + :param value: Required. Gets or sets expected hash value of the content. + :type value: str + """ + + _validation = { + 'algorithm': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'algorithm', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, algorithm: str, value: str, **kwargs) -> None: + super(ContentHash, self).__init__(**kwargs) + self.algorithm = algorithm + self.value = value + + +class ContentLink(Model): + """Definition of the content link. + + :param uri: Gets or sets the uri of the runbook content. + :type uri: str + :param content_hash: Gets or sets the hash. + :type content_hash: ~azure.mgmt.automation.models.ContentHash + :param version: Gets or sets the version of the content. + :type version: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_hash': {'key': 'contentHash', 'type': 'ContentHash'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, uri: str=None, content_hash=None, version: str=None, **kwargs) -> None: + super(ContentLink, self).__init__(**kwargs) + self.uri = uri + self.content_hash = content_hash + self.version = version + + +class ContentSource(Model): + """Definition of the content source. + + :param hash: Gets or sets the hash. + :type hash: ~azure.mgmt.automation.models.ContentHash + :param type: Gets or sets the content source type. Possible values + include: 'embeddedContent', 'uri' + :type type: str or ~azure.mgmt.automation.models.ContentSourceType + :param value: Gets or sets the value of the content. This is based on the + content source type. + :type value: str + :param version: Gets or sets the version of the content. + :type version: str + """ + + _attribute_map = { + 'hash': {'key': 'hash', 'type': 'ContentHash'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, hash=None, type=None, value: str=None, version: str=None, **kwargs) -> None: + super(ContentSource, self).__init__(**kwargs) + self.hash = hash + self.type = type + self.value = value + self.version = version + + +class Credential(ProxyResource): + """Definition of the credential. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar user_name: Gets the user name of the credential. + :vartype user_name: str + :ivar creation_time: Gets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modified time. + :vartype last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'user_name': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, **kwargs) -> None: + super(Credential, self).__init__(**kwargs) + self.user_name = None + self.creation_time = None + self.last_modified_time = None + self.description = description + + +class CredentialCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update credential operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the credential. + :type name: str + :param user_name: Required. Gets or sets the user name of the credential. + :type user_name: str + :param password: Required. Gets or sets the password of the credential. + :type password: str + :param description: Gets or sets the description of the credential. + :type description: str + """ + + _validation = { + 'name': {'required': True}, + 'user_name': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, name: str, user_name: str, password: str, description: str=None, **kwargs) -> None: + super(CredentialCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.user_name = user_name + self.password = password + self.description = description + + +class CredentialUpdateParameters(Model): + """The parameters supplied to the Update credential operation. + + :param name: Gets or sets the name of the credential. + :type name: str + :param user_name: Gets or sets the user name of the credential. + :type user_name: str + :param password: Gets or sets the password of the credential. + :type password: str + :param description: Gets or sets the description of the credential. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, user_name: str=None, password: str=None, description: str=None, **kwargs) -> None: + super(CredentialUpdateParameters, self).__init__(**kwargs) + self.name = name + self.user_name = user_name + self.password = password + self.description = description + + +class DscCompilationJob(ProxyResource): + """Definition of the Dsc Compilation job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param configuration: Gets or sets the configuration. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :ivar started_by: Gets the compilation job started by. + :vartype started_by: str + :ivar job_id: Gets the id of the job. + :vartype job_id: str + :ivar creation_time: Gets the creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: The current provisioning state of the job. + Possible values include: 'Failed', 'Succeeded', 'Suspended', 'Processing' + :type provisioning_state: str or + ~azure.mgmt.automation.models.JobProvisioningState + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + :param status: Gets or sets the status of the job. Possible values + include: 'New', 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', + 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping', + 'Resuming', 'Removing' + :type status: str or ~azure.mgmt.automation.models.JobStatus + :param status_details: Gets or sets the status details of the job. + :type status_details: str + :ivar start_time: Gets the start time of the job. + :vartype start_time: datetime + :ivar end_time: Gets the end time of the job. + :vartype end_time: datetime + :ivar exception: Gets the exception of the job. + :vartype exception: str + :ivar last_modified_time: Gets the last modified time of the job. + :vartype last_modified_time: datetime + :ivar last_status_modified_time: Gets the last status modified time of the + job. + :vartype last_status_modified_time: datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'started_by': {'readonly': True}, + 'job_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'exception': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_status_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'properties.lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__(self, *, configuration=None, provisioning_state=None, run_on: str=None, status=None, status_details: str=None, parameters=None, **kwargs) -> None: + super(DscCompilationJob, self).__init__(**kwargs) + self.configuration = configuration + self.started_by = None + self.job_id = None + self.creation_time = None + self.provisioning_state = provisioning_state + self.run_on = run_on + self.status = status + self.status_details = status_details + self.start_time = None + self.end_time = None + self.exception = None + self.last_modified_time = None + self.last_status_modified_time = None + self.parameters = parameters + + +class DscCompilationJobCreateParameters(Model): + """The parameters supplied to the create compilation job operation. + + All required parameters must be populated in order to send to Azure. + + :param configuration: Required. Gets or sets the configuration. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param increment_node_configuration_build: If a new build version of + NodeConfiguration is required. + :type increment_node_configuration_build: bool + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'configuration': {'required': True}, + } + + _attribute_map = { + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, configuration, parameters=None, increment_node_configuration_build: bool=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(DscCompilationJobCreateParameters, self).__init__(**kwargs) + self.configuration = configuration + self.parameters = parameters + self.increment_node_configuration_build = increment_node_configuration_build + self.name = name + self.location = location + self.tags = tags + + +class DscConfiguration(TrackedResource): + """Definition of the configuration type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param provisioning_state: Gets or sets the provisioning state of the + configuration. Possible values include: 'Succeeded' + :type provisioning_state: str or + ~azure.mgmt.automation.models.DscConfigurationProvisioningState + :param job_count: Gets or sets the job count of the configuration. + :type job_count: int + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.DscConfigurationParameter] + :param source: Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param state: Gets or sets the state of the configuration. Possible values + include: 'New', 'Edit', 'Published' + :type state: str or ~azure.mgmt.automation.models.DscConfigurationState + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param node_configuration_count: Gets the number of compiled node + configurations. + :type node_configuration_count: int + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'DscConfigurationProvisioningState'}, + 'job_count': {'key': 'properties.jobCount', 'type': 'int'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'node_configuration_count': {'key': 'properties.nodeConfigurationCount', 'type': 'int'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, tags=None, location: str=None, provisioning_state=None, job_count: int=None, parameters=None, source=None, state=None, log_verbose: bool=None, creation_time=None, last_modified_time=None, node_configuration_count: int=None, description: str=None, etag: str=None, **kwargs) -> None: + super(DscConfiguration, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = provisioning_state + self.job_count = job_count + self.parameters = parameters + self.source = source + self.state = state + self.log_verbose = log_verbose + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.node_configuration_count = node_configuration_count + self.description = description + self.etag = etag + + +class DscConfigurationAssociationProperty(Model): + """The Dsc configuration property associated with the entity. + + :param name: Gets or sets the name of the Dsc configuration. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(DscConfigurationAssociationProperty, self).__init__(**kwargs) + self.name = name + + +class DscConfigurationCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update configuration operation. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.DscConfigurationParameter] + :param description: Gets or sets the description of the configuration. + :type description: str + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, source, log_verbose: bool=None, log_progress: bool=None, parameters=None, description: str=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(DscConfigurationCreateOrUpdateParameters, self).__init__(**kwargs) + self.log_verbose = log_verbose + self.log_progress = log_progress + self.source = source + self.parameters = parameters + self.description = description + self.name = name + self.location = location + self.tags = tags + + +class DscConfigurationParameter(Model): + """Definition of the configuration parameter type. + + :param type: Gets or sets the type of the parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value to indicate whether the + parameter is mandatory or not. + :type is_mandatory: bool + :param position: Get or sets the position of the parameter. + :type position: int + :param default_value: Gets or sets the default value of parameter. + :type default_value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'int'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, is_mandatory: bool=None, position: int=None, default_value: str=None, **kwargs) -> None: + super(DscConfigurationParameter, self).__init__(**kwargs) + self.type = type + self.is_mandatory = is_mandatory + self.position = position + self.default_value = default_value + + +class DscConfigurationUpdateParameters(Model): + """The parameters supplied to the create or update configuration operation. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param parameters: Gets or sets the configuration parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.DscConfigurationParameter] + :param description: Gets or sets the description of the configuration. + :type description: str + :param name: Gets or sets name of the resource. + :type name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '{DscConfigurationParameter}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, source, log_verbose: bool=None, log_progress: bool=None, parameters=None, description: str=None, name: str=None, tags=None, **kwargs) -> None: + super(DscConfigurationUpdateParameters, self).__init__(**kwargs) + self.log_verbose = log_verbose + self.log_progress = log_progress + self.source = source + self.parameters = parameters + self.description = description + self.name = name + self.tags = tags + + +class DscMetaConfiguration(Model): + """Definition of the DSC Meta Configuration. + + :param configuration_mode_frequency_mins: Gets or sets the + ConfigurationModeFrequencyMins value of the meta configuration. + :type configuration_mode_frequency_mins: int + :param reboot_node_if_needed: Gets or sets the RebootNodeIfNeeded value of + the meta configuration. + :type reboot_node_if_needed: bool + :param configuration_mode: Gets or sets the ConfigurationMode value of the + meta configuration. + :type configuration_mode: str + :param action_after_reboot: Gets or sets the ActionAfterReboot value of + the meta configuration. + :type action_after_reboot: str + :param certificate_id: Gets or sets the CertificateId value of the meta + configuration. + :type certificate_id: str + :param refresh_frequency_mins: Gets or sets the RefreshFrequencyMins value + of the meta configuration. + :type refresh_frequency_mins: int + :param allow_module_overwrite: Gets or sets the AllowModuleOverwrite value + of the meta configuration. + :type allow_module_overwrite: bool + """ + + _attribute_map = { + 'configuration_mode_frequency_mins': {'key': 'configurationModeFrequencyMins', 'type': 'int'}, + 'reboot_node_if_needed': {'key': 'rebootNodeIfNeeded', 'type': 'bool'}, + 'configuration_mode': {'key': 'configurationMode', 'type': 'str'}, + 'action_after_reboot': {'key': 'actionAfterReboot', 'type': 'str'}, + 'certificate_id': {'key': 'certificateId', 'type': 'str'}, + 'refresh_frequency_mins': {'key': 'refreshFrequencyMins', 'type': 'int'}, + 'allow_module_overwrite': {'key': 'allowModuleOverwrite', 'type': 'bool'}, + } + + def __init__(self, *, configuration_mode_frequency_mins: int=None, reboot_node_if_needed: bool=None, configuration_mode: str=None, action_after_reboot: str=None, certificate_id: str=None, refresh_frequency_mins: int=None, allow_module_overwrite: bool=None, **kwargs) -> None: + super(DscMetaConfiguration, self).__init__(**kwargs) + self.configuration_mode_frequency_mins = configuration_mode_frequency_mins + self.reboot_node_if_needed = reboot_node_if_needed + self.configuration_mode = configuration_mode + self.action_after_reboot = action_after_reboot + self.certificate_id = certificate_id + self.refresh_frequency_mins = refresh_frequency_mins + self.allow_module_overwrite = allow_module_overwrite + + +class DscNode(ProxyResource): + """Definition of a DscNode. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param last_seen: Gets or sets the last seen time of the node. + :type last_seen: datetime + :param registration_time: Gets or sets the registration time of the node. + :type registration_time: datetime + :param ip: Gets or sets the ip of the node. + :type ip: str + :param account_id: Gets or sets the account id of the node. + :type account_id: str + :param dsc_node_name: Gets or sets the name of the dsc node configuration. + :type dsc_node_name: str + :param status: Gets or sets the status of the node. + :type status: str + :param node_id: Gets or sets the node id. + :type node_id: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + :param total_count: Gets the total number of records matching filter + criteria. + :type total_count: int + :param extension_handler: Gets or sets the list of extensionHandler + properties for a Node. + :type extension_handler: + list[~azure.mgmt.automation.models.DscNodeExtensionHandlerAssociationProperty] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_seen': {'key': 'properties.lastSeen', 'type': 'iso-8601'}, + 'registration_time': {'key': 'properties.registrationTime', 'type': 'iso-8601'}, + 'ip': {'key': 'properties.ip', 'type': 'str'}, + 'account_id': {'key': 'properties.accountId', 'type': 'str'}, + 'dsc_node_name': {'key': 'properties.nodeConfiguration.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'node_id': {'key': 'properties.nodeId', 'type': 'str'}, + 'etag': {'key': 'properties.etag', 'type': 'str'}, + 'total_count': {'key': 'properties.totalCount', 'type': 'int'}, + 'extension_handler': {'key': 'properties.extensionHandler', 'type': '[DscNodeExtensionHandlerAssociationProperty]'}, + } + + def __init__(self, *, last_seen=None, registration_time=None, ip: str=None, account_id: str=None, dsc_node_name: str=None, status: str=None, node_id: str=None, etag: str=None, total_count: int=None, extension_handler=None, **kwargs) -> None: + super(DscNode, self).__init__(**kwargs) + self.last_seen = last_seen + self.registration_time = registration_time + self.ip = ip + self.account_id = account_id + self.dsc_node_name = dsc_node_name + self.status = status + self.node_id = node_id + self.etag = etag + self.total_count = total_count + self.extension_handler = extension_handler + + +class DscNodeConfiguration(ProxyResource): + """Definition of the dsc node configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param creation_time: Gets or sets creation time. + :type creation_time: datetime + :param configuration: Gets or sets the configuration of the node. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param source: Source of node configuration. + :type source: str + :param node_count: Number of nodes with this node configuration assigned + :type node_count: long + :param increment_node_configuration_build: If a new build version of + NodeConfiguration is required. + :type increment_node_configuration_build: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'node_count': {'key': 'properties.nodeCount', 'type': 'long'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + } + + def __init__(self, *, last_modified_time=None, creation_time=None, configuration=None, source: str=None, node_count: int=None, increment_node_configuration_build: bool=None, **kwargs) -> None: + super(DscNodeConfiguration, self).__init__(**kwargs) + self.last_modified_time = last_modified_time + self.creation_time = creation_time + self.configuration = configuration + self.source = source + self.node_count = node_count + self.increment_node_configuration_build = increment_node_configuration_build + + +class DscNodeConfigurationCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update node configuration + operation. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param configuration: Required. Gets or sets the configuration of the + node. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param increment_node_configuration_build: If a new build version of + NodeConfiguration is required. + :type increment_node_configuration_build: bool + :param name: Name of the node configuration. + :type name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'source': {'required': True}, + 'configuration': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'properties.source', 'type': 'ContentSource'}, + 'configuration': {'key': 'properties.configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'increment_node_configuration_build': {'key': 'properties.incrementNodeConfigurationBuild', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, source, configuration, increment_node_configuration_build: bool=None, name: str=None, tags=None, **kwargs) -> None: + super(DscNodeConfigurationCreateOrUpdateParameters, self).__init__(**kwargs) + self.source = source + self.configuration = configuration + self.increment_node_configuration_build = increment_node_configuration_build + self.name = name + self.tags = tags + + +class DscNodeExtensionHandlerAssociationProperty(Model): + """The dsc extensionHandler property associated with the node. + + :param name: Gets or sets the name of the extension handler. + :type name: str + :param version: Gets or sets the version of the extension handler. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, version: str=None, **kwargs) -> None: + super(DscNodeExtensionHandlerAssociationProperty, self).__init__(**kwargs) + self.name = name + self.version = version + + +class DscNodeReport(Model): + """Definition of the dsc node report type. + + :param end_time: Gets or sets the end time of the node report. + :type end_time: datetime + :param last_modified_time: Gets or sets the lastModifiedTime of the node + report. + :type last_modified_time: datetime + :param start_time: Gets or sets the start time of the node report. + :type start_time: datetime + :param type: Gets or sets the type of the node report. + :type type: str + :param report_id: Gets or sets the id of the node report. + :type report_id: str + :param status: Gets or sets the status of the node report. + :type status: str + :param refresh_mode: Gets or sets the refreshMode of the node report. + :type refresh_mode: str + :param reboot_requested: Gets or sets the rebootRequested of the node + report. + :type reboot_requested: str + :param report_format_version: Gets or sets the reportFormatVersion of the + node report. + :type report_format_version: str + :param configuration_version: Gets or sets the configurationVersion of the + node report. + :type configuration_version: str + :param id: Gets or sets the id. + :type id: str + :param errors: Gets or sets the errors for the node report. + :type errors: list[~azure.mgmt.automation.models.DscReportError] + :param resources: Gets or sets the resource for the node report. + :type resources: list[~azure.mgmt.automation.models.DscReportResource] + :param meta_configuration: Gets or sets the metaConfiguration of the node + at the time of the report. + :type meta_configuration: + ~azure.mgmt.automation.models.DscMetaConfiguration + :param host_name: Gets or sets the hostname of the node that sent the + report. + :type host_name: str + :param i_pv4_addresses: Gets or sets the IPv4 address of the node that + sent the report. + :type i_pv4_addresses: list[str] + :param i_pv6_addresses: Gets or sets the IPv6 address of the node that + sent the report. + :type i_pv6_addresses: list[str] + :param number_of_resources: Gets or sets the number of resource in the + node report. + :type number_of_resources: int + :param raw_errors: Gets or sets the unparsed errors for the node report. + :type raw_errors: str + """ + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'report_id': {'key': 'reportId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'refresh_mode': {'key': 'refreshMode', 'type': 'str'}, + 'reboot_requested': {'key': 'rebootRequested', 'type': 'str'}, + 'report_format_version': {'key': 'reportFormatVersion', 'type': 'str'}, + 'configuration_version': {'key': 'configurationVersion', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[DscReportError]'}, + 'resources': {'key': 'resources', 'type': '[DscReportResource]'}, + 'meta_configuration': {'key': 'metaConfiguration', 'type': 'DscMetaConfiguration'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'i_pv4_addresses': {'key': 'iPV4Addresses', 'type': '[str]'}, + 'i_pv6_addresses': {'key': 'iPV6Addresses', 'type': '[str]'}, + 'number_of_resources': {'key': 'numberOfResources', 'type': 'int'}, + 'raw_errors': {'key': 'rawErrors', 'type': 'str'}, + } + + def __init__(self, *, end_time=None, last_modified_time=None, start_time=None, type: str=None, report_id: str=None, status: str=None, refresh_mode: str=None, reboot_requested: str=None, report_format_version: str=None, configuration_version: str=None, id: str=None, errors=None, resources=None, meta_configuration=None, host_name: str=None, i_pv4_addresses=None, i_pv6_addresses=None, number_of_resources: int=None, raw_errors: str=None, **kwargs) -> None: + super(DscNodeReport, self).__init__(**kwargs) + self.end_time = end_time + self.last_modified_time = last_modified_time + self.start_time = start_time + self.type = type + self.report_id = report_id + self.status = status + self.refresh_mode = refresh_mode + self.reboot_requested = reboot_requested + self.report_format_version = report_format_version + self.configuration_version = configuration_version + self.id = id + self.errors = errors + self.resources = resources + self.meta_configuration = meta_configuration + self.host_name = host_name + self.i_pv4_addresses = i_pv4_addresses + self.i_pv6_addresses = i_pv6_addresses + self.number_of_resources = number_of_resources + self.raw_errors = raw_errors + + +class DscNodeUpdateParameters(Model): + """The parameters supplied to the update dsc node operation. + + :param node_id: Gets or sets the id of the dsc node. + :type node_id: str + :param properties: + :type properties: + ~azure.mgmt.automation.models.DscNodeUpdateParametersProperties + """ + + _attribute_map = { + 'node_id': {'key': 'nodeId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DscNodeUpdateParametersProperties'}, + } + + def __init__(self, *, node_id: str=None, properties=None, **kwargs) -> None: + super(DscNodeUpdateParameters, self).__init__(**kwargs) + self.node_id = node_id + self.properties = properties + + +class DscNodeUpdateParametersProperties(Model): + """DscNodeUpdateParametersProperties. + + :param name: Gets or sets the name of the dsc node configuration. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'nodeConfiguration.name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(DscNodeUpdateParametersProperties, self).__init__(**kwargs) + self.name = name + + +class DscReportError(Model): + """Definition of the dsc node report error type. + + :param error_source: Gets or sets the source of the error. + :type error_source: str + :param resource_id: Gets or sets the resource ID which generated the + error. + :type resource_id: str + :param error_code: Gets or sets the error code. + :type error_code: str + :param error_message: Gets or sets the error message. + :type error_message: str + :param locale: Gets or sets the locale of the error. + :type locale: str + :param error_details: Gets or sets the error details. + :type error_details: str + """ + + _attribute_map = { + 'error_source': {'key': 'errorSource', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'locale': {'key': 'locale', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': 'str'}, + } + + def __init__(self, *, error_source: str=None, resource_id: str=None, error_code: str=None, error_message: str=None, locale: str=None, error_details: str=None, **kwargs) -> None: + super(DscReportError, self).__init__(**kwargs) + self.error_source = error_source + self.resource_id = resource_id + self.error_code = error_code + self.error_message = error_message + self.locale = locale + self.error_details = error_details + + +class DscReportResource(Model): + """Definition of the DSC Report Resource. + + :param resource_id: Gets or sets the ID of the resource. + :type resource_id: str + :param source_info: Gets or sets the source info of the resource. + :type source_info: str + :param depends_on: Gets or sets the Resource Navigation values for + resources the resource depends on. + :type depends_on: + list[~azure.mgmt.automation.models.DscReportResourceNavigation] + :param module_name: Gets or sets the module name of the resource. + :type module_name: str + :param module_version: Gets or sets the module version of the resource. + :type module_version: str + :param resource_name: Gets or sets the name of the resource. + :type resource_name: str + :param error: Gets or sets the error of the resource. + :type error: str + :param status: Gets or sets the status of the resource. + :type status: str + :param duration_in_seconds: Gets or sets the duration in seconds for the + resource. + :type duration_in_seconds: float + :param start_date: Gets or sets the start date of the resource. + :type start_date: datetime + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'source_info': {'key': 'sourceInfo', 'type': 'str'}, + 'depends_on': {'key': 'dependsOn', 'type': '[DscReportResourceNavigation]'}, + 'module_name': {'key': 'moduleName', 'type': 'str'}, + 'module_version': {'key': 'moduleVersion', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'float'}, + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + } + + def __init__(self, *, resource_id: str=None, source_info: str=None, depends_on=None, module_name: str=None, module_version: str=None, resource_name: str=None, error: str=None, status: str=None, duration_in_seconds: float=None, start_date=None, **kwargs) -> None: + super(DscReportResource, self).__init__(**kwargs) + self.resource_id = resource_id + self.source_info = source_info + self.depends_on = depends_on + self.module_name = module_name + self.module_version = module_version + self.resource_name = resource_name + self.error = error + self.status = status + self.duration_in_seconds = duration_in_seconds + self.start_date = start_date + + +class DscReportResourceNavigation(Model): + """Navigation for DSC Report Resource. + + :param resource_id: Gets or sets the ID of the resource to navigate to. + :type resource_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str=None, **kwargs) -> None: + super(DscReportResourceNavigation, self).__init__(**kwargs) + self.resource_id = resource_id + + +class ErrorResponse(Model): + """Error response of an operation failure. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class FieldDefinition(Model): + """Definition of the connection fields. + + All required parameters must be populated in order to send to Azure. + + :param is_encrypted: Gets or sets the isEncrypted flag of the connection + field definition. + :type is_encrypted: bool + :param is_optional: Gets or sets the isOptional flag of the connection + field definition. + :type is_optional: bool + :param type: Required. Gets or sets the type of the connection field + definition. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'is_encrypted': {'key': 'isEncrypted', 'type': 'bool'}, + 'is_optional': {'key': 'isOptional', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, type: str, is_encrypted: bool=None, is_optional: bool=None, **kwargs) -> None: + super(FieldDefinition, self).__init__(**kwargs) + self.is_encrypted = is_encrypted + self.is_optional = is_optional + self.type = type + + +class HybridRunbookWorker(Model): + """Definition of hybrid runbook worker. + + :param name: Gets or sets the worker machine name. + :type name: str + :param ip: Gets or sets the assigned machine IP address. + :type ip: str + :param registration_time: Gets or sets the registration time of the worker + machine. + :type registration_time: datetime + :param last_seen_date_time: Last Heartbeat from the Worker + :type last_seen_date_time: datetime + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ip': {'key': 'ip', 'type': 'str'}, + 'registration_time': {'key': 'registrationTime', 'type': 'iso-8601'}, + 'last_seen_date_time': {'key': 'lastSeenDateTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, name: str=None, ip: str=None, registration_time=None, last_seen_date_time=None, **kwargs) -> None: + super(HybridRunbookWorker, self).__init__(**kwargs) + self.name = name + self.ip = ip + self.registration_time = registration_time + self.last_seen_date_time = last_seen_date_time + + +class HybridRunbookWorkerGroup(Model): + """Definition of hybrid runbook worker group. + + :param id: Gets or sets the id of the resource. + :type id: str + :param name: Gets or sets the name of the group. + :type name: str + :param hybrid_runbook_workers: Gets or sets the list of hybrid runbook + workers. + :type hybrid_runbook_workers: + list[~azure.mgmt.automation.models.HybridRunbookWorker] + :param credential: Sets the credential of a worker group. + :type credential: + ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + :param group_type: Type of the HybridWorkerGroup. Possible values include: + 'User', 'System' + :type group_type: str or ~azure.mgmt.automation.models.GroupTypeEnum + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'hybrid_runbook_workers': {'key': 'hybridRunbookWorkers', 'type': '[HybridRunbookWorker]'}, + 'credential': {'key': 'credential', 'type': 'RunAsCredentialAssociationProperty'}, + 'group_type': {'key': 'groupType', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, hybrid_runbook_workers=None, credential=None, group_type=None, **kwargs) -> None: + super(HybridRunbookWorkerGroup, self).__init__(**kwargs) + self.id = id + self.name = name + self.hybrid_runbook_workers = hybrid_runbook_workers + self.credential = credential + self.group_type = group_type + + +class HybridRunbookWorkerGroupUpdateParameters(Model): + """Parameters supplied to the update operation. + + :param credential: Sets the credential of a worker group. + :type credential: + ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + """ + + _attribute_map = { + 'credential': {'key': 'credential', 'type': 'RunAsCredentialAssociationProperty'}, + } + + def __init__(self, *, credential=None, **kwargs) -> None: + super(HybridRunbookWorkerGroupUpdateParameters, self).__init__(**kwargs) + self.credential = credential + + +class Job(ProxyResource): + """Definition of the job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param started_by: Gets or sets the job started by. + :type started_by: str + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + :param job_id: Gets or sets the id of the job. + :type job_id: str + :param creation_time: Gets or sets the creation time of the job. + :type creation_time: datetime + :param status: Gets or sets the status of the job. Possible values + include: 'New', 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', + 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping', + 'Resuming', 'Removing' + :type status: str or ~azure.mgmt.automation.models.JobStatus + :param status_details: Gets or sets the status details of the job. + :type status_details: str + :param start_time: Gets or sets the start time of the job. + :type start_time: datetime + :param end_time: Gets or sets the end time of the job. + :type end_time: datetime + :param exception: Gets or sets the exception of the job. + :type exception: str + :param last_modified_time: Gets or sets the last modified time of the job. + :type last_modified_time: datetime + :param last_status_modified_time: Gets or sets the last status modified + time of the job. + :type last_status_modified_time: datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param provisioning_state: The current provisioning state of the job. + Possible values include: 'Failed', 'Succeeded', 'Suspended', 'Processing' + :type provisioning_state: str or + ~azure.mgmt.automation.models.JobProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'properties.lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, runbook=None, started_by: str=None, run_on: str=None, job_id: str=None, creation_time=None, status=None, status_details: str=None, start_time=None, end_time=None, exception: str=None, last_modified_time=None, last_status_modified_time=None, parameters=None, provisioning_state=None, **kwargs) -> None: + super(Job, self).__init__(**kwargs) + self.runbook = runbook + self.started_by = started_by + self.run_on = run_on + self.job_id = job_id + self.creation_time = creation_time + self.status = status + self.status_details = status_details + self.start_time = start_time + self.end_time = end_time + self.exception = exception + self.last_modified_time = last_modified_time + self.last_status_modified_time = last_status_modified_time + self.parameters = parameters + self.provisioning_state = provisioning_state + + +class JobCollectionItem(ProxyResource): + """Job collection item properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar runbook: The runbook association. + :vartype runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :ivar job_id: The id of the job. + :vartype job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: datetime + :ivar status: The status of the job. Possible values include: 'New', + 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', 'Blocked', + 'Suspended', 'Disconnected', 'Suspending', 'Stopping', 'Resuming', + 'Removing' + :vartype status: str or ~azure.mgmt.automation.models.JobStatus + :ivar start_time: The start time of the job. + :vartype start_time: datetime + :ivar end_time: The end time of the job. + :vartype end_time: datetime + :ivar last_modified_time: The last modified time of the job. + :vartype last_modified_time: datetime + :ivar provisioning_state: The provisioning state of a resource. + :vartype provisioning_state: str + :param run_on: Specifies the runOn group name where the job was executed. + :type run_on: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'runbook': {'readonly': True}, + 'job_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'job_id': {'key': 'properties.jobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__(self, *, run_on: str=None, **kwargs) -> None: + super(JobCollectionItem, self).__init__(**kwargs) + self.runbook = None + self.job_id = None + self.creation_time = None + self.status = None + self.start_time = None + self.end_time = None + self.last_modified_time = None + self.provisioning_state = None + self.run_on = run_on + + +class JobCreateParameters(Model): + """The parameters supplied to the create job operation. + + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + """ + + _attribute_map = { + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__(self, *, runbook=None, parameters=None, run_on: str=None, **kwargs) -> None: + super(JobCreateParameters, self).__init__(**kwargs) + self.runbook = runbook + self.parameters = parameters + self.run_on = run_on + + +class JobNavigation(Model): + """Software update configuration machine run job navigation properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Id of the job associated with the software update configuration + run + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(JobNavigation, self).__init__(**kwargs) + self.id = None + + +class JobSchedule(Model): + """Definition of the job schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the resource. + :vartype id: str + :ivar name: Gets the name of the variable. + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param job_schedule_id: Gets or sets the id of job schedule. + :type job_schedule_id: str + :param schedule: Gets or sets the schedule. + :type schedule: ~azure.mgmt.automation.models.ScheduleAssociationProperty + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the hybrid worker group that the scheduled job + should run on. + :type run_on: str + :param parameters: Gets or sets the parameters of the job schedule. + :type parameters: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'job_schedule_id': {'key': 'properties.jobScheduleId', 'type': 'str'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ScheduleAssociationProperty'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__(self, *, job_schedule_id: str=None, schedule=None, runbook=None, run_on: str=None, parameters=None, **kwargs) -> None: + super(JobSchedule, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.job_schedule_id = job_schedule_id + self.schedule = schedule + self.runbook = runbook + self.run_on = run_on + self.parameters = parameters + + +class JobScheduleCreateParameters(Model): + """The parameters supplied to the create job schedule operation. + + All required parameters must be populated in order to send to Azure. + + :param schedule: Required. Gets or sets the schedule. + :type schedule: ~azure.mgmt.automation.models.ScheduleAssociationProperty + :param runbook: Required. Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the hybrid worker group that the scheduled job + should run on. + :type run_on: str + :param parameters: Gets or sets a list of job properties. + :type parameters: dict[str, str] + """ + + _validation = { + 'schedule': {'required': True}, + 'runbook': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'properties.schedule', 'type': 'ScheduleAssociationProperty'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + } + + def __init__(self, *, schedule, runbook, run_on: str=None, parameters=None, **kwargs) -> None: + super(JobScheduleCreateParameters, self).__init__(**kwargs) + self.schedule = schedule + self.runbook = runbook + self.run_on = run_on + self.parameters = parameters + + +class JobStream(Model): + """Definition of the job stream. + + :param id: Gets or sets the id of the resource. + :type id: str + :param job_stream_id: Gets or sets the id of the job stream. + :type job_stream_id: str + :param time: Gets or sets the creation time of the job. + :type time: datetime + :param stream_type: Gets or sets the stream type. Possible values include: + 'Progress', 'Output', 'Warning', 'Error', 'Debug', 'Verbose', 'Any' + :type stream_type: str or ~azure.mgmt.automation.models.JobStreamType + :param stream_text: Gets or sets the stream text. + :type stream_text: str + :param summary: Gets or sets the summary. + :type summary: str + :param value: Gets or sets the values of the job stream. + :type value: dict[str, object] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'job_stream_id': {'key': 'properties.jobStreamId', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + 'stream_text': {'key': 'properties.streamText', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '{object}'}, + } + + def __init__(self, *, id: str=None, job_stream_id: str=None, time=None, stream_type=None, stream_text: str=None, summary: str=None, value=None, **kwargs) -> None: + super(JobStream, self).__init__(**kwargs) + self.id = id + self.job_stream_id = job_stream_id + self.time = time + self.stream_type = stream_type + self.stream_text = stream_text + self.summary = summary + self.value = value + + +class JobStreamListResult(Model): + """The response model for the list job stream operation. + + :param value: A list of job streams. + :type value: list[~azure.mgmt.automation.models.JobStream] + :param next_link: Gets or sets the next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[JobStream]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(JobStreamListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Key(Model): + """Automation key which is used to register a DSC Node. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Automation key name. Possible values include: 'Primary', + 'Secondary' + :vartype key_name: str or ~azure.mgmt.automation.models.AutomationKeyName + :ivar permissions: Automation key permissions. Possible values include: + 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.automation.models.AutomationKeyPermissions + :ivar value: Value of the Automation Key used for registration. + :vartype value: str + """ + + _validation = { + 'key_name': {'readonly': True}, + 'permissions': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'KeyName', 'type': 'str'}, + 'permissions': {'key': 'Permissions', 'type': 'str'}, + 'value': {'key': 'Value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Key, self).__init__(**kwargs) + self.key_name = None + self.permissions = None + self.value = None + + +class KeyListResult(Model): + """KeyListResult. + + :param keys: Lists the automation keys. + :type keys: list[~azure.mgmt.automation.models.Key] + """ + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[Key]'}, + } + + def __init__(self, *, keys=None, **kwargs) -> None: + super(KeyListResult, self).__init__(**kwargs) + self.keys = keys + + +class LinkedWorkspace(Model): + """Definition of the linked workspace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Gets the id of the linked workspace. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(LinkedWorkspace, self).__init__(**kwargs) + self.id = None + + +class LinuxProperties(Model): + """Linux specific update configuration. + + :param included_package_classifications: Update classifications included + in the software update configuration. Possible values include: + 'Unclassified', 'Critical', 'Security', 'Other' + :type included_package_classifications: str or + ~azure.mgmt.automation.models.LinuxUpdateClasses + :param excluded_package_name_masks: packages excluded from the software + update configuration. + :type excluded_package_name_masks: list[str] + :param included_package_name_masks: packages included from the software + update configuration. + :type included_package_name_masks: list[str] + :param reboot_setting: Reboot setting for the software update + configuration. + :type reboot_setting: str + """ + + _attribute_map = { + 'included_package_classifications': {'key': 'includedPackageClassifications', 'type': 'str'}, + 'excluded_package_name_masks': {'key': 'excludedPackageNameMasks', 'type': '[str]'}, + 'included_package_name_masks': {'key': 'includedPackageNameMasks', 'type': '[str]'}, + 'reboot_setting': {'key': 'rebootSetting', 'type': 'str'}, + } + + def __init__(self, *, included_package_classifications=None, excluded_package_name_masks=None, included_package_name_masks=None, reboot_setting: str=None, **kwargs) -> None: + super(LinuxProperties, self).__init__(**kwargs) + self.included_package_classifications = included_package_classifications + self.excluded_package_name_masks = excluded_package_name_masks + self.included_package_name_masks = included_package_name_masks + self.reboot_setting = reboot_setting + + +class Module(TrackedResource): + """Definition of the module type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param is_global: Gets or sets the isGlobal flag of the module. + :type is_global: bool + :param version: Gets or sets the version of the module. + :type version: str + :param size_in_bytes: Gets or sets the size in bytes of the module. + :type size_in_bytes: long + :param activity_count: Gets or sets the activity count of the module. + :type activity_count: int + :param provisioning_state: Gets or sets the provisioning state of the + module. Possible values include: 'Created', 'Creating', + 'StartingImportModuleRunbook', 'RunningImportModuleRunbook', + 'ContentRetrieved', 'ContentDownloaded', 'ContentValidated', + 'ConnectionTypeImported', 'ContentStored', 'ModuleDataStored', + 'ActivitiesStored', 'ModuleImportRunbookComplete', 'Succeeded', 'Failed', + 'Cancelled', 'Updating' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ModuleProvisioningState + :param content_link: Gets or sets the contentLink of the module. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param error: Gets or sets the error info of the module. + :type error: ~azure.mgmt.automation.models.ModuleErrorInfo + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param is_composite: Gets or sets type of module, if its composite or not. + :type is_composite: bool + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'is_global': {'key': 'properties.isGlobal', 'type': 'bool'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'activity_count': {'key': 'properties.activityCount', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ModuleProvisioningState'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'error': {'key': 'properties.error', 'type': 'ModuleErrorInfo'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_composite': {'key': 'properties.isComposite', 'type': 'bool'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, tags=None, location: str=None, is_global: bool=None, version: str=None, size_in_bytes: int=None, activity_count: int=None, provisioning_state=None, content_link=None, error=None, creation_time=None, last_modified_time=None, description: str=None, is_composite: bool=None, etag: str=None, **kwargs) -> None: + super(Module, self).__init__(tags=tags, location=location, **kwargs) + self.is_global = is_global + self.version = version + self.size_in_bytes = size_in_bytes + self.activity_count = activity_count + self.provisioning_state = provisioning_state + self.content_link = content_link + self.error = error + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + self.is_composite = is_composite + self.etag = etag + + +class ModuleCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update module operation. + + All required parameters must be populated in order to send to Azure. + + :param content_link: Required. Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'content_link': {'required': True}, + } + + _attribute_map = { + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, content_link, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(ModuleCreateOrUpdateParameters, self).__init__(**kwargs) + self.content_link = content_link + self.name = name + self.location = location + self.tags = tags + + +class ModuleErrorInfo(Model): + """Definition of the module error info type. + + :param code: Gets or sets the error code. + :type code: str + :param message: Gets or sets the error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(ModuleErrorInfo, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ModuleUpdateParameters(Model): + """The parameters supplied to the update module operation. + + :param content_link: Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param name: Gets or sets name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, content_link=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(ModuleUpdateParameters, self).__init__(**kwargs) + self.content_link = content_link + self.name = name + self.location = location + self.tags = tags + + +class NodeCount(Model): + """Number of nodes based on the Filter. + + :param name: Gets the name of a count type + :type name: str + :param properties: + :type properties: ~azure.mgmt.automation.models.NodeCountProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'NodeCountProperties'}, + } + + def __init__(self, *, name: str=None, properties=None, **kwargs) -> None: + super(NodeCount, self).__init__(**kwargs) + self.name = name + self.properties = properties + + +class NodeCountProperties(Model): + """NodeCountProperties. + + :param count: Gets the count for the name + :type count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, *, count: int=None, **kwargs) -> None: + super(NodeCountProperties, self).__init__(**kwargs) + self.count = count + + +class NodeCounts(Model): + """Gets the count of nodes by count type. + + :param value: Gets an array of counts + :type value: list[~azure.mgmt.automation.models.NodeCount] + :param total_count: Gets the total number of records matching countType + criteria. + :type total_count: int + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NodeCount]'}, + 'total_count': {'key': 'totalCount', 'type': 'int'}, + } + + def __init__(self, *, value=None, total_count: int=None, **kwargs) -> None: + super(NodeCounts, self).__init__(**kwargs) + self.value = value + self.total_count = total_count + + +class NonAzureQueryProperties(Model): + """Non Azure query for the update configuration. + + :param function_alias: Log Analytics Saved Search name. + :type function_alias: str + :param workspace_id: Workspace Id for Log Analytics in which the saved + Search is resided. + :type workspace_id: str + """ + + _attribute_map = { + 'function_alias': {'key': 'functionAlias', 'type': 'str'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + } + + def __init__(self, *, function_alias: str=None, workspace_id: str=None, **kwargs) -> None: + super(NonAzureQueryProperties, self).__init__(**kwargs) + self.function_alias = function_alias + self.workspace_id = workspace_id + + +class Operation(Model): + """Automation REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Provider, Resource and Operation values + :type display: ~azure.mgmt.automation.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class OperationDisplay(Model): + """Provider, Resource and Operation values. + + :param provider: Service provider: Microsoft.Automation + :type provider: str + :param resource: Resource on which the operation is performed: Runbooks, + Jobs etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + + +class PythonPackageCreateParameters(Model): + """The parameters supplied to the create or update module operation. + + All required parameters must be populated in order to send to Azure. + + :param content_link: Required. Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'content_link': {'required': True}, + } + + _attribute_map = { + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, content_link, tags=None, **kwargs) -> None: + super(PythonPackageCreateParameters, self).__init__(**kwargs) + self.content_link = content_link + self.tags = tags + + +class PythonPackageUpdateParameters(Model): + """The parameters supplied to the update module operation. + + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(PythonPackageUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class RunAsCredentialAssociationProperty(Model): + """Definition of RunAs credential to use for hybrid worker. + + :param name: Gets or sets the name of the credential. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(RunAsCredentialAssociationProperty, self).__init__(**kwargs) + self.name = name + + +class Runbook(TrackedResource): + """Definition of the runbook type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param runbook_type: Gets or sets the type of the runbook. Possible values + include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', + 'GraphPowerShellWorkflow', 'GraphPowerShell' + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param publish_content_link: Gets or sets the published runbook content + link. + :type publish_content_link: ~azure.mgmt.automation.models.ContentLink + :param state: Gets or sets the state of the runbook. Possible values + include: 'New', 'Edit', 'Published' + :type state: str or ~azure.mgmt.automation.models.RunbookState + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param log_activity_trace: Gets or sets the option to log activity trace + of the runbook. + :type log_activity_trace: int + :param job_count: Gets or sets the job count of the runbook. + :type job_count: int + :param parameters: Gets or sets the runbook parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.RunbookParameter] + :param output_types: Gets or sets the runbook output types. + :type output_types: list[str] + :param draft: Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param provisioning_state: Gets or sets the provisioning state of the + runbook. Possible values include: 'Succeeded' + :type provisioning_state: str or + ~azure.mgmt.automation.models.RunbookProvisioningState + :param last_modified_by: Gets or sets the last modified by. + :type last_modified_by: str + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'runbook_type': {'key': 'properties.runbookType', 'type': 'str'}, + 'publish_content_link': {'key': 'properties.publishContentLink', 'type': 'ContentLink'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'log_activity_trace': {'key': 'properties.logActivityTrace', 'type': 'int'}, + 'job_count': {'key': 'properties.jobCount', 'type': 'int'}, + 'parameters': {'key': 'properties.parameters', 'type': '{RunbookParameter}'}, + 'output_types': {'key': 'properties.outputTypes', 'type': '[str]'}, + 'draft': {'key': 'properties.draft', 'type': 'RunbookDraft'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'RunbookProvisioningState'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, tags=None, location: str=None, runbook_type=None, publish_content_link=None, state=None, log_verbose: bool=None, log_progress: bool=None, log_activity_trace: int=None, job_count: int=None, parameters=None, output_types=None, draft=None, provisioning_state=None, last_modified_by: str=None, creation_time=None, last_modified_time=None, description: str=None, etag: str=None, **kwargs) -> None: + super(Runbook, self).__init__(tags=tags, location=location, **kwargs) + self.runbook_type = runbook_type + self.publish_content_link = publish_content_link + self.state = state + self.log_verbose = log_verbose + self.log_progress = log_progress + self.log_activity_trace = log_activity_trace + self.job_count = job_count + self.parameters = parameters + self.output_types = output_types + self.draft = draft + self.provisioning_state = provisioning_state + self.last_modified_by = last_modified_by + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + self.etag = etag + + +class RunbookAssociationProperty(Model): + """The runbook property associated with the entity. + + :param name: Gets or sets the name of the runbook. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(RunbookAssociationProperty, self).__init__(**kwargs) + self.name = name + + +class RunbookCreateOrUpdateDraftParameters(Model): + """The parameters supplied to the create or update runbook operation. + + All required parameters must be populated in order to send to Azure. + + :param runbook_content: Required. Content of the Runbook. + :type runbook_content: str + """ + + _validation = { + 'runbook_content': {'required': True}, + } + + _attribute_map = { + 'runbook_content': {'key': 'runbookContent', 'type': 'str'}, + } + + def __init__(self, *, runbook_content: str, **kwargs) -> None: + super(RunbookCreateOrUpdateDraftParameters, self).__init__(**kwargs) + self.runbook_content = runbook_content + + +class RunbookCreateOrUpdateDraftProperties(Model): + """The parameters supplied to the create or update draft runbook properties. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param runbook_type: Required. Gets or sets the type of the runbook. + Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', + 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param draft: Required. Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_activity_trace: Gets or sets the activity-level tracing options + of the runbook. + :type log_activity_trace: int + """ + + _validation = { + 'runbook_type': {'required': True}, + 'draft': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'logProgress', 'type': 'bool'}, + 'runbook_type': {'key': 'runbookType', 'type': 'str'}, + 'draft': {'key': 'draft', 'type': 'RunbookDraft'}, + 'description': {'key': 'description', 'type': 'str'}, + 'log_activity_trace': {'key': 'logActivityTrace', 'type': 'int'}, + } + + def __init__(self, *, runbook_type, draft, log_verbose: bool=None, log_progress: bool=None, description: str=None, log_activity_trace: int=None, **kwargs) -> None: + super(RunbookCreateOrUpdateDraftProperties, self).__init__(**kwargs) + self.log_verbose = log_verbose + self.log_progress = log_progress + self.runbook_type = runbook_type + self.draft = draft + self.description = description + self.log_activity_trace = log_activity_trace + + +class RunbookCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update runbook operation. + + All required parameters must be populated in order to send to Azure. + + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param runbook_type: Required. Gets or sets the type of the runbook. + Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', + 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + :type runbook_type: str or ~azure.mgmt.automation.models.RunbookTypeEnum + :param draft: Gets or sets the draft runbook properties. + :type draft: ~azure.mgmt.automation.models.RunbookDraft + :param publish_content_link: Gets or sets the published runbook content + link. + :type publish_content_link: ~azure.mgmt.automation.models.ContentLink + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_activity_trace: Gets or sets the activity-level tracing options + of the runbook. + :type log_activity_trace: int + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'runbook_type': {'required': True}, + } + + _attribute_map = { + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'runbook_type': {'key': 'properties.runbookType', 'type': 'str'}, + 'draft': {'key': 'properties.draft', 'type': 'RunbookDraft'}, + 'publish_content_link': {'key': 'properties.publishContentLink', 'type': 'ContentLink'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'log_activity_trace': {'key': 'properties.logActivityTrace', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, runbook_type, log_verbose: bool=None, log_progress: bool=None, draft=None, publish_content_link=None, description: str=None, log_activity_trace: int=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(RunbookCreateOrUpdateParameters, self).__init__(**kwargs) + self.log_verbose = log_verbose + self.log_progress = log_progress + self.runbook_type = runbook_type + self.draft = draft + self.publish_content_link = publish_content_link + self.description = description + self.log_activity_trace = log_activity_trace + self.name = name + self.location = location + self.tags = tags + + +class RunbookDraft(Model): + """RunbookDraft. + + :param in_edit: Gets or sets whether runbook is in edit mode. + :type in_edit: bool + :param draft_content_link: Gets or sets the draft runbook content link. + :type draft_content_link: ~azure.mgmt.automation.models.ContentLink + :param creation_time: Gets or sets the creation time of the runbook draft. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time of the + runbook draft. + :type last_modified_time: datetime + :param parameters: Gets or sets the runbook draft parameters. + :type parameters: dict[str, + ~azure.mgmt.automation.models.RunbookParameter] + :param output_types: Gets or sets the runbook output types. + :type output_types: list[str] + """ + + _attribute_map = { + 'in_edit': {'key': 'inEdit', 'type': 'bool'}, + 'draft_content_link': {'key': 'draftContentLink', 'type': 'ContentLink'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'parameters', 'type': '{RunbookParameter}'}, + 'output_types': {'key': 'outputTypes', 'type': '[str]'}, + } + + def __init__(self, *, in_edit: bool=None, draft_content_link=None, creation_time=None, last_modified_time=None, parameters=None, output_types=None, **kwargs) -> None: + super(RunbookDraft, self).__init__(**kwargs) + self.in_edit = in_edit + self.draft_content_link = draft_content_link + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.parameters = parameters + self.output_types = output_types + + +class RunbookDraftUndoEditResult(Model): + """The response model for the undo edit runbook operation. + + :param status_code: Possible values include: 'Continue', + 'SwitchingProtocols', 'OK', 'Created', 'Accepted', + 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', + 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', + 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', + 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', + 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', + 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', + 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', + 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', + 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', + 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', + 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', + 'HttpVersionNotSupported' + :type status_code: str or ~azure.mgmt.automation.models.HttpStatusCode + :param request_id: + :type request_id: str + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + } + + def __init__(self, *, status_code=None, request_id: str=None, **kwargs) -> None: + super(RunbookDraftUndoEditResult, self).__init__(**kwargs) + self.status_code = status_code + self.request_id = request_id + + +class RunbookParameter(Model): + """Definition of the runbook parameter type. + + :param type: Gets or sets the type of the parameter. + :type type: str + :param is_mandatory: Gets or sets a Boolean value to indicate whether the + parameter is mandatory or not. + :type is_mandatory: bool + :param position: Get or sets the position of the parameter. + :type position: int + :param default_value: Gets or sets the default value of parameter. + :type default_value: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_mandatory': {'key': 'isMandatory', 'type': 'bool'}, + 'position': {'key': 'position', 'type': 'int'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, is_mandatory: bool=None, position: int=None, default_value: str=None, **kwargs) -> None: + super(RunbookParameter, self).__init__(**kwargs) + self.type = type + self.is_mandatory = is_mandatory + self.position = position + self.default_value = default_value + + +class RunbookUpdateParameters(Model): + """The parameters supplied to the update runbook operation. + + :param description: Gets or sets the description of the runbook. + :type description: str + :param log_verbose: Gets or sets verbose log option. + :type log_verbose: bool + :param log_progress: Gets or sets progress log option. + :type log_progress: bool + :param log_activity_trace: Gets or sets the activity-level tracing options + of the runbook. + :type log_activity_trace: int + :param name: Gets or sets the name of the resource. + :type name: str + :param location: Gets or sets the location of the resource. + :type location: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'log_verbose': {'key': 'properties.logVerbose', 'type': 'bool'}, + 'log_progress': {'key': 'properties.logProgress', 'type': 'bool'}, + 'log_activity_trace': {'key': 'properties.logActivityTrace', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, description: str=None, log_verbose: bool=None, log_progress: bool=None, log_activity_trace: int=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(RunbookUpdateParameters, self).__init__(**kwargs) + self.description = description + self.log_verbose = log_verbose + self.log_progress = log_progress + self.log_activity_trace = log_activity_trace + self.name = name + self.location = location + self.tags = tags + + +class Schedule(ProxyResource): + """Definition of the schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param start_time: Gets or sets the start time of the schedule. + :type start_time: datetime + :ivar start_time_offset_minutes: Gets the start time's offset in minutes. + :vartype start_time_offset_minutes: float + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: datetime + :param expiry_time_offset_minutes: Gets or sets the expiry time's offset + in minutes. + :type expiry_time_offset_minutes: float + :param is_enabled: Gets or sets a value indicating whether this schedule + is enabled. Default value: False . + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in + minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible + values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month', 'Minute' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param advanced_schedule: Gets or sets the advanced schedule. + :type advanced_schedule: ~azure.mgmt.automation.models.AdvancedSchedule + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_time_offset_minutes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'properties.startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'properties.expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'properties.nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'advanced_schedule': {'key': 'properties.advancedSchedule', 'type': 'AdvancedSchedule'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, start_time=None, expiry_time=None, expiry_time_offset_minutes: float=None, is_enabled: bool=False, next_run=None, next_run_offset_minutes: float=None, interval: int=None, frequency=None, time_zone: str=None, advanced_schedule=None, creation_time=None, last_modified_time=None, description: str=None, **kwargs) -> None: + super(Schedule, self).__init__(**kwargs) + self.start_time = start_time + self.start_time_offset_minutes = None + self.expiry_time = expiry_time + self.expiry_time_offset_minutes = expiry_time_offset_minutes + self.is_enabled = is_enabled + self.next_run = next_run + self.next_run_offset_minutes = next_run_offset_minutes + self.interval = interval + self.frequency = frequency + self.time_zone = time_zone + self.advanced_schedule = advanced_schedule + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + + +class ScheduleAssociationProperty(Model): + """The schedule property associated with the entity. + + :param name: Gets or sets the name of the Schedule. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(ScheduleAssociationProperty, self).__init__(**kwargs) + self.name = name + + +class ScheduleCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update schedule operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the Schedule. + :type name: str + :param description: Gets or sets the description of the schedule. + :type description: str + :param start_time: Required. Gets or sets the start time of the schedule. + :type start_time: datetime + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: datetime + :param interval: Gets or sets the interval of the schedule. + :type interval: object + :param frequency: Required. Gets or sets the frequency of the schedule. + Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month', + 'Minute' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param advanced_schedule: Gets or sets the AdvancedSchedule. + :type advanced_schedule: ~azure.mgmt.automation.models.AdvancedSchedule + """ + + _validation = { + 'name': {'required': True}, + 'start_time': {'required': True}, + 'frequency': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'interval': {'key': 'properties.interval', 'type': 'object'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'advanced_schedule': {'key': 'properties.advancedSchedule', 'type': 'AdvancedSchedule'}, + } + + def __init__(self, *, name: str, start_time, frequency, description: str=None, expiry_time=None, interval=None, time_zone: str=None, advanced_schedule=None, **kwargs) -> None: + super(ScheduleCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + self.start_time = start_time + self.expiry_time = expiry_time + self.interval = interval + self.frequency = frequency + self.time_zone = time_zone + self.advanced_schedule = advanced_schedule + + +class ScheduleProperties(Model): + """Definition of schedule parameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param start_time: Gets or sets the start time of the schedule. + :type start_time: datetime + :ivar start_time_offset_minutes: Gets the start time's offset in minutes. + :vartype start_time_offset_minutes: float + :param expiry_time: Gets or sets the end time of the schedule. + :type expiry_time: datetime + :param expiry_time_offset_minutes: Gets or sets the expiry time's offset + in minutes. + :type expiry_time_offset_minutes: float + :param is_enabled: Gets or sets a value indicating whether this schedule + is enabled. Default value: False . + :type is_enabled: bool + :param next_run: Gets or sets the next run time of the schedule. + :type next_run: datetime + :param next_run_offset_minutes: Gets or sets the next run time's offset in + minutes. + :type next_run_offset_minutes: float + :param interval: Gets or sets the interval of the schedule. + :type interval: int + :param frequency: Gets or sets the frequency of the schedule. Possible + values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month', 'Minute' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param time_zone: Gets or sets the time zone of the schedule. + :type time_zone: str + :param advanced_schedule: Gets or sets the advanced schedule. + :type advanced_schedule: ~azure.mgmt.automation.models.AdvancedSchedule + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'start_time_offset_minutes': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'start_time_offset_minutes': {'key': 'startTimeOffsetMinutes', 'type': 'float'}, + 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, + 'expiry_time_offset_minutes': {'key': 'expiryTimeOffsetMinutes', 'type': 'float'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'next_run': {'key': 'nextRun', 'type': 'iso-8601'}, + 'next_run_offset_minutes': {'key': 'nextRunOffsetMinutes', 'type': 'float'}, + 'interval': {'key': 'interval', 'type': 'int'}, + 'frequency': {'key': 'frequency', 'type': 'str'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'advanced_schedule': {'key': 'advancedSchedule', 'type': 'AdvancedSchedule'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, start_time=None, expiry_time=None, expiry_time_offset_minutes: float=None, is_enabled: bool=False, next_run=None, next_run_offset_minutes: float=None, interval: int=None, frequency=None, time_zone: str=None, advanced_schedule=None, creation_time=None, last_modified_time=None, description: str=None, **kwargs) -> None: + super(ScheduleProperties, self).__init__(**kwargs) + self.start_time = start_time + self.start_time_offset_minutes = None + self.expiry_time = expiry_time + self.expiry_time_offset_minutes = expiry_time_offset_minutes + self.is_enabled = is_enabled + self.next_run = next_run + self.next_run_offset_minutes = next_run_offset_minutes + self.interval = interval + self.frequency = frequency + self.time_zone = time_zone + self.advanced_schedule = advanced_schedule + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + + +class ScheduleUpdateParameters(Model): + """The parameters supplied to the update schedule operation. + + :param name: Gets or sets the name of the Schedule. + :type name: str + :param description: Gets or sets the description of the schedule. + :type description: str + :param is_enabled: Gets or sets a value indicating whether this schedule + is enabled. + :type is_enabled: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, description: str=None, is_enabled: bool=None, **kwargs) -> None: + super(ScheduleUpdateParameters, self).__init__(**kwargs) + self.name = name + self.description = description + self.is_enabled = is_enabled + + +class Sku(Model): + """The account SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the SKU name of the account. Possible + values include: 'Free', 'Basic' + :type name: str or ~azure.mgmt.automation.models.SkuNameEnum + :param family: Gets or sets the SKU family. + :type family: str + :param capacity: Gets or sets the SKU capacity. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name, family: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.family = family + self.capacity = capacity + + +class SoftareUpdateConfigurationRunTaskProperties(Model): + """Task properties of the software update configuration. + + :param status: The status of the task. + :type status: str + :param source: The name of the source of the task. + :type source: str + :param job_id: The job id of the task. + :type job_id: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + } + + def __init__(self, *, status: str=None, source: str=None, job_id: str=None, **kwargs) -> None: + super(SoftareUpdateConfigurationRunTaskProperties, self).__init__(**kwargs) + self.status = status + self.source = source + self.job_id = job_id + + +class SoftareUpdateConfigurationRunTasks(Model): + """Software update configuration run tasks model. + + :param pre_task: Pre task properties. + :type pre_task: + ~azure.mgmt.automation.models.SoftareUpdateConfigurationRunTaskProperties + :param post_task: Post task properties. + :type post_task: + ~azure.mgmt.automation.models.SoftareUpdateConfigurationRunTaskProperties + """ + + _attribute_map = { + 'pre_task': {'key': 'preTask', 'type': 'SoftareUpdateConfigurationRunTaskProperties'}, + 'post_task': {'key': 'postTask', 'type': 'SoftareUpdateConfigurationRunTaskProperties'}, + } + + def __init__(self, *, pre_task=None, post_task=None, **kwargs) -> None: + super(SoftareUpdateConfigurationRunTasks, self).__init__(**kwargs) + self.pre_task = pre_task + self.post_task = post_task + + +class SoftwareUpdateConfiguration(Model): + """Software update configuration properties. + + 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 name: Resource name. + :vartype name: str + :ivar id: Resource Id. + :vartype id: str + :ivar type: Resource type + :vartype type: str + :param update_configuration: Required. update specific properties for the + Software update configuration + :type update_configuration: + ~azure.mgmt.automation.models.UpdateConfiguration + :param schedule_info: Required. Schedule information for the Software + update configuration + :type schedule_info: ~azure.mgmt.automation.models.ScheduleProperties + :ivar provisioning_state: Provisioning state for the software update + configuration, which only appears in the response. + :vartype provisioning_state: str + :param error: Details of provisioning error + :type error: ~azure.mgmt.automation.models.ErrorResponse + :ivar creation_time: Creation time of the resource, which only appears in + the response. + :vartype creation_time: datetime + :ivar created_by: CreatedBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time: Last time resource was modified, which only + appears in the response. + :vartype last_modified_time: datetime + :ivar last_modified_by: LastModifiedBy property, which only appears in the + response. + :vartype last_modified_by: str + :param tasks: Tasks information for the Software update configuration. + :type tasks: + ~azure.mgmt.automation.models.SoftwareUpdateConfigurationTasks + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'update_configuration': {'required': True}, + 'schedule_info': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'update_configuration': {'key': 'properties.updateConfiguration', 'type': 'UpdateConfiguration'}, + 'schedule_info': {'key': 'properties.scheduleInfo', 'type': 'ScheduleProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'ErrorResponse'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'tasks': {'key': 'properties.tasks', 'type': 'SoftwareUpdateConfigurationTasks'}, + } + + def __init__(self, *, update_configuration, schedule_info, error=None, tasks=None, **kwargs) -> None: + super(SoftwareUpdateConfiguration, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.update_configuration = update_configuration + self.schedule_info = schedule_info + self.provisioning_state = None + self.error = error + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None + self.tasks = tasks + + +class SoftwareUpdateConfigurationCollectionItem(Model): + """Software update configuration collection item properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration. + :vartype name: str + :ivar id: Resource Id of the software update configuration + :vartype id: str + :param update_configuration: Update specific properties of the software + update configuration. + :type update_configuration: + ~azure.mgmt.automation.models.CollectionItemUpdateConfiguration + :param frequency: execution frequency of the schedule associated with the + software update configuration. Possible values include: 'OneTime', 'Day', + 'Hour', 'Week', 'Month', 'Minute' + :type frequency: str or ~azure.mgmt.automation.models.ScheduleFrequency + :param start_time: the start time of the update. + :type start_time: datetime + :ivar creation_time: Creation time of the software update configuration, + which only appears in the response. + :vartype creation_time: datetime + :ivar last_modified_time: Last time software update configuration was + modified, which only appears in the response. + :vartype last_modified_time: datetime + :ivar provisioning_state: Provisioning state for the software update + configuration, which only appears in the response. + :vartype provisioning_state: str + :param next_run: ext run time of the update. + :type next_run: datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'update_configuration': {'key': 'properties.updateConfiguration', 'type': 'CollectionItemUpdateConfiguration'}, + 'frequency': {'key': 'properties.frequency', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'next_run': {'key': 'properties.nextRun', 'type': 'iso-8601'}, + } + + def __init__(self, *, update_configuration=None, frequency=None, start_time=None, next_run=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationCollectionItem, self).__init__(**kwargs) + self.name = None + self.id = None + self.update_configuration = update_configuration + self.frequency = frequency + self.start_time = start_time + self.creation_time = None + self.last_modified_time = None + self.provisioning_state = None + self.next_run = next_run + + +class SoftwareUpdateConfigurationListResult(Model): + """result of listing all software update configuration. + + :param value: outer object returned when listing all software update + configurations + :type value: + list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationCollectionItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationCollectionItem]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationListResult, self).__init__(**kwargs) + self.value = value + + +class SoftwareUpdateConfigurationMachineRun(Model): + """Software update configuration machine run model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration machine run + :vartype name: str + :ivar id: Resource Id of the software update configuration machine run + :vartype id: str + :ivar target_computer: name of the updated computer + :vartype target_computer: str + :ivar target_computer_type: type of the updated computer. + :vartype target_computer_type: str + :param software_update_configuration: software update configuration + triggered this run + :type software_update_configuration: + ~azure.mgmt.automation.models.UpdateConfigurationNavigation + :ivar status: Status of the software update configuration machine run. + :vartype status: str + :ivar os_type: Operating system target of the software update + configuration triggered this run + :vartype os_type: str + :ivar correlation_id: correlation id of the software update configuration + machine run + :vartype correlation_id: str + :ivar source_computer_id: source computer id of the software update + configuration machine run + :vartype source_computer_id: str + :ivar start_time: Start time of the software update configuration machine + run. + :vartype start_time: datetime + :ivar end_time: End time of the software update configuration machine run. + :vartype end_time: datetime + :ivar configured_duration: configured duration for the software update + configuration run. + :vartype configured_duration: str + :param job: Job associated with the software update configuration machine + run + :type job: ~azure.mgmt.automation.models.JobNavigation + :ivar creation_time: Creation time of the resource, which only appears in + the response. + :vartype creation_time: datetime + :ivar created_by: createdBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time: Last time resource was modified, which only + appears in the response. + :vartype last_modified_time: datetime + :ivar last_modified_by: lastModifiedBy property, which only appears in the + response. + :vartype last_modified_by: str + :param error: Details of provisioning error + :type error: ~azure.mgmt.automation.models.ErrorResponse + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target_computer': {'readonly': True}, + 'target_computer_type': {'readonly': True}, + 'status': {'readonly': True}, + 'os_type': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'source_computer_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'configured_duration': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'target_computer': {'key': 'properties.targetComputer', 'type': 'str'}, + 'target_computer_type': {'key': 'properties.targetComputerType', 'type': 'str'}, + 'software_update_configuration': {'key': 'properties.softwareUpdateConfiguration', 'type': 'UpdateConfigurationNavigation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'source_computer_id': {'key': 'properties.sourceComputerId', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'configured_duration': {'key': 'properties.configuredDuration', 'type': 'str'}, + 'job': {'key': 'properties.job', 'type': 'JobNavigation'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, software_update_configuration=None, job=None, error=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationMachineRun, self).__init__(**kwargs) + self.name = None + self.id = None + self.target_computer = None + self.target_computer_type = None + self.software_update_configuration = software_update_configuration + self.status = None + self.os_type = None + self.correlation_id = None + self.source_computer_id = None + self.start_time = None + self.end_time = None + self.configured_duration = None + self.job = job + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None + self.error = error + + +class SoftwareUpdateConfigurationMachineRunListResult(Model): + """result of listing all software update configuration machine runs. + + :param value: outer object returned when listing all software update + configuration machine runs + :type value: + list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRun] + :param next_link: link to next page of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationMachineRun]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationMachineRunListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SoftwareUpdateConfigurationRun(Model): + """Software update configuration Run properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration run. + :vartype name: str + :ivar id: Resource Id of the software update configuration run + :vartype id: str + :param software_update_configuration: software update configuration + triggered this run + :type software_update_configuration: + ~azure.mgmt.automation.models.UpdateConfigurationNavigation + :ivar status: Status of the software update configuration run. + :vartype status: str + :ivar configured_duration: Configured duration for the software update + configuration run. + :vartype configured_duration: str + :ivar os_type: Operating system target of the software update + configuration triggered this run + :vartype os_type: str + :ivar start_time: Start time of the software update configuration run. + :vartype start_time: datetime + :ivar end_time: End time of the software update configuration run. + :vartype end_time: datetime + :ivar computer_count: Number of computers in the software update + configuration run. + :vartype computer_count: int + :ivar failed_count: Number of computers with failed status. + :vartype failed_count: int + :ivar creation_time: Creation time of the resource, which only appears in + the response. + :vartype creation_time: datetime + :ivar created_by: CreatedBy property, which only appears in the response. + :vartype created_by: str + :ivar last_modified_time: Last time resource was modified, which only + appears in the response. + :vartype last_modified_time: datetime + :ivar last_modified_by: LastModifiedBy property, which only appears in the + response. + :vartype last_modified_by: str + :param tasks: Software update configuration tasks triggered in this run + :type tasks: + ~azure.mgmt.automation.models.SoftareUpdateConfigurationRunTasks + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'status': {'readonly': True}, + 'configured_duration': {'readonly': True}, + 'os_type': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'computer_count': {'readonly': True}, + 'failed_count': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'created_by': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'software_update_configuration': {'key': 'properties.softwareUpdateConfiguration', 'type': 'UpdateConfigurationNavigation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'configured_duration': {'key': 'properties.configuredDuration', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'computer_count': {'key': 'properties.computerCount', 'type': 'int'}, + 'failed_count': {'key': 'properties.failedCount', 'type': 'int'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'tasks': {'key': 'properties.tasks', 'type': 'SoftareUpdateConfigurationRunTasks'}, + } + + def __init__(self, *, software_update_configuration=None, tasks=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationRun, self).__init__(**kwargs) + self.name = None + self.id = None + self.software_update_configuration = software_update_configuration + self.status = None + self.configured_duration = None + self.os_type = None + self.start_time = None + self.end_time = None + self.computer_count = None + self.failed_count = None + self.creation_time = None + self.created_by = None + self.last_modified_time = None + self.last_modified_by = None + self.tasks = tasks + + +class SoftwareUpdateConfigurationRunListResult(Model): + """result of listing all software update configuration runs. + + :param value: outer object returned when listing all software update + configuration runs + :type value: + list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationRun] + :param next_link: link to next page of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SoftwareUpdateConfigurationRun]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationRunListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SoftwareUpdateConfigurationTasks(Model): + """Task properties of the software update configuration. + + :param pre_task: Pre task properties. + :type pre_task: ~azure.mgmt.automation.models.TaskProperties + :param post_task: Post task properties. + :type post_task: ~azure.mgmt.automation.models.TaskProperties + """ + + _attribute_map = { + 'pre_task': {'key': 'preTask', 'type': 'TaskProperties'}, + 'post_task': {'key': 'postTask', 'type': 'TaskProperties'}, + } + + def __init__(self, *, pre_task=None, post_task=None, **kwargs) -> None: + super(SoftwareUpdateConfigurationTasks, self).__init__(**kwargs) + self.pre_task = pre_task + self.post_task = post_task + + +class SourceControl(ProxyResource): + """Definition of the source control. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param repo_url: The repo url of the source control. + :type repo_url: str + :param branch: The repo branch of the source control. Include branch as + empty string for VsoTfvc. + :type branch: str + :param folder_path: The folder path of the source control. + :type folder_path: str + :param auto_sync: The auto sync of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is + true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, + GitHub. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param description: The description. + :type description: str + :param creation_time: The creation time. + :type creation_time: datetime + :param last_modified_time: The last modified time. + :type last_modified_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'source_type': {'key': 'properties.sourceType', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, repo_url: str=None, branch: str=None, folder_path: str=None, auto_sync: bool=None, publish_runbook: bool=None, source_type=None, description: str=None, creation_time=None, last_modified_time=None, **kwargs) -> None: + super(SourceControl, self).__init__(**kwargs) + self.repo_url = repo_url + self.branch = branch + self.folder_path = folder_path + self.auto_sync = auto_sync + self.publish_runbook = publish_runbook + self.source_type = source_type + self.description = description + self.creation_time = creation_time + self.last_modified_time = last_modified_time + + +class SourceControlCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update source control operation. + + :param repo_url: The repo url of the source control. + :type repo_url: str + :param branch: The repo branch of the source control. Include branch as + empty string for VsoTfvc. + :type branch: str + :param folder_path: The folder path of the source control. Path must be + relative. + :type folder_path: str + :param auto_sync: The auto async of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is + true. + :type publish_runbook: bool + :param source_type: The source type. Must be one of VsoGit, VsoTfvc, + GitHub, case sensitive. Possible values include: 'VsoGit', 'VsoTfvc', + 'GitHub' + :type source_type: str or ~azure.mgmt.automation.models.SourceType + :param security_token: The authorization token for the repo of the source + control. + :type security_token: + ~azure.mgmt.automation.models.SourceControlSecurityTokenProperties + :param description: The user description of the source control. + :type description: str + """ + + _validation = { + 'repo_url': {'max_length': 2000}, + 'branch': {'max_length': 255}, + 'folder_path': {'max_length': 255}, + 'description': {'max_length': 512}, + } + + _attribute_map = { + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'source_type': {'key': 'properties.sourceType', 'type': 'str'}, + 'security_token': {'key': 'properties.securityToken', 'type': 'SourceControlSecurityTokenProperties'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, repo_url: str=None, branch: str=None, folder_path: str=None, auto_sync: bool=None, publish_runbook: bool=None, source_type=None, security_token=None, description: str=None, **kwargs) -> None: + super(SourceControlCreateOrUpdateParameters, self).__init__(**kwargs) + self.repo_url = repo_url + self.branch = branch + self.folder_path = folder_path + self.auto_sync = auto_sync + self.publish_runbook = publish_runbook + self.source_type = source_type + self.security_token = security_token + self.description = description + + +class SourceControlSecurityTokenProperties(Model): + """SourceControlSecurityTokenProperties. + + :param access_token: The access token. + :type access_token: str + :param refresh_token: The refresh token. + :type refresh_token: str + :param token_type: The token type. Must be either PersonalAccessToken or + Oauth. Possible values include: 'PersonalAccessToken', 'Oauth' + :type token_type: str or ~azure.mgmt.automation.models.TokenType + """ + + _validation = { + 'access_token': {'max_length': 1024}, + 'refresh_token': {'max_length': 1024}, + } + + _attribute_map = { + 'access_token': {'key': 'accessToken', 'type': 'str'}, + 'refresh_token': {'key': 'refreshToken', 'type': 'str'}, + 'token_type': {'key': 'tokenType', 'type': 'str'}, + } + + def __init__(self, *, access_token: str=None, refresh_token: str=None, token_type=None, **kwargs) -> None: + super(SourceControlSecurityTokenProperties, self).__init__(**kwargs) + self.access_token = access_token + self.refresh_token = refresh_token + self.token_type = token_type + + +class SourceControlSyncJob(Model): + """Definition of the source control sync job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: The provisioning state of the job. Possible + values include: 'Completed', 'Failed', 'Running' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ProvisioningState + :ivar start_time: The start time of the job. + :vartype start_time: datetime + :ivar end_time: The end time of the job. + :vartype end_time: datetime + :param sync_type: The sync type. Possible values include: 'PartialSync', + 'FullSync' + :type sync_type: str or ~azure.mgmt.automation.models.SyncType + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_id': {'key': 'properties.sourceControlSyncJobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'sync_type': {'key': 'properties.syncType', 'type': 'str'}, + } + + def __init__(self, *, source_control_sync_job_id: str=None, provisioning_state=None, sync_type=None, **kwargs) -> None: + super(SourceControlSyncJob, self).__init__(**kwargs) + self.name = None + self.type = None + self.id = None + self.source_control_sync_job_id = source_control_sync_job_id + self.creation_time = None + self.provisioning_state = provisioning_state + self.start_time = None + self.end_time = None + self.sync_type = sync_type + + +class SourceControlSyncJobById(Model): + """Definition of the source control sync job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: The id of the job. + :type id: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: The creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: The provisioning state of the job. Possible + values include: 'Completed', 'Failed', 'Running' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ProvisioningState + :ivar start_time: The start time of the job. + :vartype start_time: datetime + :ivar end_time: The end time of the job. + :vartype end_time: datetime + :param sync_type: The sync type. Possible values include: 'PartialSync', + 'FullSync' + :type sync_type: str or ~azure.mgmt.automation.models.SyncType + :param exception: The exceptions that occurred while running the sync job. + :type exception: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_id': {'key': 'properties.sourceControlSyncJobId', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'sync_type': {'key': 'properties.syncType', 'type': 'str'}, + 'exception': {'key': 'properties.exception', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, source_control_sync_job_id: str=None, provisioning_state=None, sync_type=None, exception: str=None, **kwargs) -> None: + super(SourceControlSyncJobById, self).__init__(**kwargs) + self.id = id + self.source_control_sync_job_id = source_control_sync_job_id + self.creation_time = None + self.provisioning_state = provisioning_state + self.start_time = None + self.end_time = None + self.sync_type = sync_type + self.exception = exception + + +class SourceControlSyncJobCreateParameters(Model): + """The parameters supplied to the create source control sync job operation. + + All required parameters must be populated in order to send to Azure. + + :param commit_id: Required. The commit id of the source control sync job. + If not syncing to a commitId, enter an empty string. + :type commit_id: str + """ + + _validation = { + 'commit_id': {'required': True, 'min_length': 0}, + } + + _attribute_map = { + 'commit_id': {'key': 'properties.commitId', 'type': 'str'}, + } + + def __init__(self, *, commit_id: str, **kwargs) -> None: + super(SourceControlSyncJobCreateParameters, self).__init__(**kwargs) + self.commit_id = commit_id + + +class SourceControlSyncJobStream(Model): + """Definition of the source control sync job stream. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_stream_id: The sync job stream id. + :type source_control_sync_job_stream_id: str + :param summary: The summary of the sync job stream. + :type summary: str + :ivar time: The time of the sync job stream. + :vartype time: datetime + :param stream_type: The type of the sync job stream. Possible values + include: 'Error', 'Output' + :type stream_type: str or ~azure.mgmt.automation.models.StreamType + """ + + _validation = { + 'id': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_stream_id': {'key': 'properties.sourceControlSyncJobStreamId', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + } + + def __init__(self, *, source_control_sync_job_stream_id: str=None, summary: str=None, stream_type=None, **kwargs) -> None: + super(SourceControlSyncJobStream, self).__init__(**kwargs) + self.id = None + self.source_control_sync_job_stream_id = source_control_sync_job_stream_id + self.summary = summary + self.time = None + self.stream_type = stream_type + + +class SourceControlSyncJobStreamById(Model): + """Definition of the source control sync job stream by id. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource id. + :vartype id: str + :param source_control_sync_job_stream_id: The sync job stream id. + :type source_control_sync_job_stream_id: str + :param summary: The summary of the sync job stream. + :type summary: str + :ivar time: The time of the sync job stream. + :vartype time: datetime + :param stream_type: The type of the sync job stream. Possible values + include: 'Error', 'Output' + :type stream_type: str or ~azure.mgmt.automation.models.StreamType + :param stream_text: The text of the sync job stream. + :type stream_text: str + :param value: The values of the job stream. + :type value: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_control_sync_job_stream_id': {'key': 'properties.sourceControlSyncJobStreamId', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'stream_type': {'key': 'properties.streamType', 'type': 'str'}, + 'stream_text': {'key': 'properties.streamText', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': '{object}'}, + } + + def __init__(self, *, source_control_sync_job_stream_id: str=None, summary: str=None, stream_type=None, stream_text: str=None, value=None, **kwargs) -> None: + super(SourceControlSyncJobStreamById, self).__init__(**kwargs) + self.id = None + self.source_control_sync_job_stream_id = source_control_sync_job_stream_id + self.summary = summary + self.time = None + self.stream_type = stream_type + self.stream_text = stream_text + self.value = value + + +class SourceControlUpdateParameters(Model): + """The parameters supplied to the update source control operation. + + :param branch: The repo branch of the source control. + :type branch: str + :param folder_path: The folder path of the source control. Path must be + relative. + :type folder_path: str + :param auto_sync: The auto sync of the source control. Default is false. + :type auto_sync: bool + :param publish_runbook: The auto publish of the source control. Default is + true. + :type publish_runbook: bool + :param security_token: The authorization token for the repo of the source + control. + :type security_token: + ~azure.mgmt.automation.models.SourceControlSecurityTokenProperties + :param description: The user description of the source control. + :type description: str + """ + + _attribute_map = { + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'auto_sync': {'key': 'properties.autoSync', 'type': 'bool'}, + 'publish_runbook': {'key': 'properties.publishRunbook', 'type': 'bool'}, + 'security_token': {'key': 'properties.securityToken', 'type': 'SourceControlSecurityTokenProperties'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, branch: str=None, folder_path: str=None, auto_sync: bool=None, publish_runbook: bool=None, security_token=None, description: str=None, **kwargs) -> None: + super(SourceControlUpdateParameters, self).__init__(**kwargs) + self.branch = branch + self.folder_path = folder_path + self.auto_sync = auto_sync + self.publish_runbook = publish_runbook + self.security_token = security_token + self.description = description + + +class Statistics(Model): + """Definition of the statistic. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar counter_property: Gets the property value of the statistic. + :vartype counter_property: str + :ivar counter_value: Gets the value of the statistic. + :vartype counter_value: long + :ivar start_time: Gets the startTime of the statistic. + :vartype start_time: datetime + :ivar end_time: Gets the endTime of the statistic. + :vartype end_time: datetime + :ivar id: Gets the id. + :vartype id: str + """ + + _validation = { + 'counter_property': {'readonly': True}, + 'counter_value': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'counter_property': {'key': 'counterProperty', 'type': 'str'}, + 'counter_value': {'key': 'counterValue', 'type': 'long'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Statistics, self).__init__(**kwargs) + self.counter_property = None + self.counter_value = None + self.start_time = None + self.end_time = None + self.id = None + + +class TagSettingsProperties(Model): + """Tag filter information for the VM. + + :param tags: Dictionary of tags with its list of values. + :type tags: dict[str, list[str]] + :param filter_operator: Filter VMs by Any or All specified tags. Possible + values include: 'All', 'Any' + :type filter_operator: str or ~azure.mgmt.automation.models.TagOperators + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{[str]}'}, + 'filter_operator': {'key': 'filterOperator', 'type': 'TagOperators'}, + } + + def __init__(self, *, tags=None, filter_operator=None, **kwargs) -> None: + super(TagSettingsProperties, self).__init__(**kwargs) + self.tags = tags + self.filter_operator = filter_operator + + +class TargetProperties(Model): + """Group specific to the update configuration. + + :param azure_queries: List of Azure queries in the software update + configuration. + :type azure_queries: + list[~azure.mgmt.automation.models.AzureQueryProperties] + :param non_azure_queries: List of non Azure queries in the software update + configuration. + :type non_azure_queries: + list[~azure.mgmt.automation.models.NonAzureQueryProperties] + """ + + _attribute_map = { + 'azure_queries': {'key': 'azureQueries', 'type': '[AzureQueryProperties]'}, + 'non_azure_queries': {'key': 'nonAzureQueries', 'type': '[NonAzureQueryProperties]'}, + } + + def __init__(self, *, azure_queries=None, non_azure_queries=None, **kwargs) -> None: + super(TargetProperties, self).__init__(**kwargs) + self.azure_queries = azure_queries + self.non_azure_queries = non_azure_queries + + +class TaskProperties(Model): + """Task properties of the software update configuration. + + :param parameters: Gets or sets the parameters of the task. + :type parameters: dict[str, str] + :param source: Gets or sets the name of the runbook. + :type source: str + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'source': {'key': 'source', 'type': 'str'}, + } + + def __init__(self, *, parameters=None, source: str=None, **kwargs) -> None: + super(TaskProperties, self).__init__(**kwargs) + self.parameters = parameters + self.source = source + + +class TestJob(Model): + """Definition of the test job. + + :param creation_time: Gets or sets the creation time of the test job. + :type creation_time: datetime + :param status: Gets or sets the status of the test job. + :type status: str + :param status_details: Gets or sets the status details of the test job. + :type status_details: str + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + :param start_time: Gets or sets the start time of the test job. + :type start_time: datetime + :param end_time: Gets or sets the end time of the test job. + :type end_time: datetime + :param exception: Gets or sets the exception of the test job. + :type exception: str + :param last_modified_time: Gets or sets the last modified time of the test + job. + :type last_modified_time: datetime + :param last_status_modified_time: Gets or sets the last status modified + time of the test job. + :type last_status_modified_time: datetime + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param log_activity_trace: The activity-level tracing options of the + runbook. + :type log_activity_trace: int + """ + + _attribute_map = { + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_details': {'key': 'statusDetails', 'type': 'str'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'exception': {'key': 'exception', 'type': 'str'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'last_status_modified_time': {'key': 'lastStatusModifiedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'log_activity_trace': {'key': 'logActivityTrace', 'type': 'int'}, + } + + def __init__(self, *, creation_time=None, status: str=None, status_details: str=None, run_on: str=None, start_time=None, end_time=None, exception: str=None, last_modified_time=None, last_status_modified_time=None, parameters=None, log_activity_trace: int=None, **kwargs) -> None: + super(TestJob, self).__init__(**kwargs) + self.creation_time = creation_time + self.status = status + self.status_details = status_details + self.run_on = run_on + self.start_time = start_time + self.end_time = end_time + self.exception = exception + self.last_modified_time = last_modified_time + self.last_status_modified_time = last_status_modified_time + self.parameters = parameters + self.log_activity_trace = log_activity_trace + + +class TestJobCreateParameters(Model): + """The parameters supplied to the create test job operation. + + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name where + the job is to be executed. + :type run_on: str + """ + + _attribute_map = { + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + } + + def __init__(self, *, parameters=None, run_on: str=None, **kwargs) -> None: + super(TestJobCreateParameters, self).__init__(**kwargs) + self.parameters = parameters + self.run_on = run_on + + +class TypeField(Model): + """Information about a field of a type. + + :param name: Gets or sets the name of the field. + :type name: str + :param type: Gets or sets the type of the field. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type: str=None, **kwargs) -> None: + super(TypeField, self).__init__(**kwargs) + self.name = name + self.type = type + + +class UpdateConfiguration(Model): + """Update specific properties of the software update configuration. + + All required parameters must be populated in order to send to Azure. + + :param operating_system: Required. operating system of target machines. + Possible values include: 'Windows', 'Linux' + :type operating_system: str or + ~azure.mgmt.automation.models.OperatingSystemType + :param windows: Windows specific update configuration. + :type windows: ~azure.mgmt.automation.models.WindowsProperties + :param linux: Linux specific update configuration. + :type linux: ~azure.mgmt.automation.models.LinuxProperties + :param duration: Maximum time allowed for the software update + configuration run. Duration needs to be specified using the format + PT[n]H[n]M[n]S as per ISO8601 + :type duration: timedelta + :param azure_virtual_machines: List of azure resource Ids for azure + virtual machines targeted by the software update configuration. + :type azure_virtual_machines: list[str] + :param non_azure_computer_names: List of names of non-azure machines + targeted by the software update configuration. + :type non_azure_computer_names: list[str] + :param targets: Group targets for the software update configuration. + :type targets: ~azure.mgmt.automation.models.TargetProperties + """ + + _validation = { + 'operating_system': {'required': True}, + } + + _attribute_map = { + 'operating_system': {'key': 'operatingSystem', 'type': 'OperatingSystemType'}, + 'windows': {'key': 'windows', 'type': 'WindowsProperties'}, + 'linux': {'key': 'linux', 'type': 'LinuxProperties'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'azure_virtual_machines': {'key': 'azureVirtualMachines', 'type': '[str]'}, + 'non_azure_computer_names': {'key': 'nonAzureComputerNames', 'type': '[str]'}, + 'targets': {'key': 'targets', 'type': 'TargetProperties'}, + } + + def __init__(self, *, operating_system, windows=None, linux=None, duration=None, azure_virtual_machines=None, non_azure_computer_names=None, targets=None, **kwargs) -> None: + super(UpdateConfiguration, self).__init__(**kwargs) + self.operating_system = operating_system + self.windows = windows + self.linux = linux + self.duration = duration + self.azure_virtual_machines = azure_virtual_machines + self.non_azure_computer_names = non_azure_computer_names + self.targets = targets + + +class UpdateConfigurationNavigation(Model): + """Software update configuration Run Navigation model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the software update configuration triggered the + software update configuration run + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateConfigurationNavigation, self).__init__(**kwargs) + self.name = None + + +class Usage(Model): + """Definition of Usage. + + :param id: Gets or sets the id of the resource. + :type id: str + :param name: Gets or sets the usage counter name. + :type name: ~azure.mgmt.automation.models.UsageCounterName + :param unit: Gets or sets the usage unit name. + :type unit: str + :param current_value: Gets or sets the current usage value. + :type current_value: float + :param limit: Gets or sets max limit. -1 for unlimited + :type limit: long + :param throttle_status: Gets or sets the throttle status. + :type throttle_status: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'UsageCounterName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'throttle_status': {'key': 'throttleStatus', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name=None, unit: str=None, current_value: float=None, limit: int=None, throttle_status: str=None, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.id = id + self.name = name + self.unit = unit + self.current_value = current_value + self.limit = limit + self.throttle_status = throttle_status + + +class UsageCounterName(Model): + """Definition of usage counter name. + + :param value: Gets or sets the usage counter name. + :type value: str + :param localized_value: Gets or sets the localized usage counter name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageCounterName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value + + +class Variable(ProxyResource): + """Definition of the variable. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param value: Gets or sets the value of the variable. + :type value: str + :param is_encrypted: Gets or sets the encrypted flag of the variable. + :type is_encrypted: bool + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'is_encrypted': {'key': 'properties.isEncrypted', 'type': 'bool'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, is_encrypted: bool=None, creation_time=None, last_modified_time=None, description: str=None, **kwargs) -> None: + super(Variable, self).__init__(**kwargs) + self.value = value + self.is_encrypted = is_encrypted + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description + + +class VariableCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update variable operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the variable. + :type name: str + :param value: Gets or sets the value of the variable. + :type value: str + :param description: Gets or sets the description of the variable. + :type description: str + :param is_encrypted: Gets or sets the encrypted flag of the variable. + :type is_encrypted: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_encrypted': {'key': 'properties.isEncrypted', 'type': 'bool'}, + } + + def __init__(self, *, name: str, value: str=None, description: str=None, is_encrypted: bool=None, **kwargs) -> None: + super(VariableCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.value = value + self.description = description + self.is_encrypted = is_encrypted + + +class VariableUpdateParameters(Model): + """The parameters supplied to the update variable operation. + + :param name: Gets or sets the name of the variable. + :type name: str + :param value: Gets or sets the value of the variable. + :type value: str + :param description: Gets or sets the description of the variable. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, value: str=None, description: str=None, **kwargs) -> None: + super(VariableUpdateParameters, self).__init__(**kwargs) + self.name = name + self.value = value + self.description = description + + +class Watcher(TrackedResource): + """Definition of the watcher type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The Azure Region where the resource lives + :type location: str + :param execution_frequency_in_seconds: Gets or sets the frequency at which + the watcher is invoked. + :type execution_frequency_in_seconds: long + :param script_name: Gets or sets the name of the script the watcher is + attached to, i.e. the name of an existing runbook. + :type script_name: str + :param script_parameters: Gets or sets the parameters of the script. + :type script_parameters: dict[str, str] + :param script_run_on: Gets or sets the name of the hybrid worker group the + watcher will run on. + :type script_run_on: str + :ivar status: Gets the current status of the watcher. + :vartype status: str + :ivar creation_time: Gets or sets the creation time. + :vartype creation_time: datetime + :ivar last_modified_time: Gets or sets the last modified time. + :vartype last_modified_time: datetime + :ivar last_modified_by: Details of the user who last modified the watcher. + :vartype last_modified_by: str + :param description: Gets or sets the description. + :type description: str + :param etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'execution_frequency_in_seconds': {'key': 'properties.executionFrequencyInSeconds', 'type': 'long'}, + 'script_name': {'key': 'properties.scriptName', 'type': 'str'}, + 'script_parameters': {'key': 'properties.scriptParameters', 'type': '{str}'}, + 'script_run_on': {'key': 'properties.scriptRunOn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, tags=None, location: str=None, execution_frequency_in_seconds: int=None, script_name: str=None, script_parameters=None, script_run_on: str=None, description: str=None, etag: str=None, **kwargs) -> None: + super(Watcher, self).__init__(tags=tags, location=location, **kwargs) + self.execution_frequency_in_seconds = execution_frequency_in_seconds + self.script_name = script_name + self.script_parameters = script_parameters + self.script_run_on = script_run_on + self.status = None + self.creation_time = None + self.last_modified_time = None + self.last_modified_by = None + self.description = description + self.etag = etag + + +class WatcherUpdateParameters(Model): + """WatcherUpdateParameters. + + :param execution_frequency_in_seconds: Gets or sets the frequency at which + the watcher is invoked. + :type execution_frequency_in_seconds: long + :param name: Gets or sets the name of the resource. + :type name: str + """ + + _attribute_map = { + 'execution_frequency_in_seconds': {'key': 'properties.executionFrequencyInSeconds', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, execution_frequency_in_seconds: int=None, name: str=None, **kwargs) -> None: + super(WatcherUpdateParameters, self).__init__(**kwargs) + self.execution_frequency_in_seconds = execution_frequency_in_seconds + self.name = name + + +class Webhook(ProxyResource): + """Definition of the webhook type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param is_enabled: Gets or sets the value of the enabled flag of the + webhook. Default value: False . + :type is_enabled: bool + :param uri: Gets or sets the webhook uri. + :type uri: str + :param expiry_time: Gets or sets the expiry time. + :type expiry_time: datetime + :param last_invoked_time: Gets or sets the last invoked time. + :type last_invoked_time: datetime + :param parameters: Gets or sets the parameters of the job that is created + when the webhook calls the runbook it is associated with. + :type parameters: dict[str, str] + :param runbook: Gets or sets the runbook the webhook is associated with. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the name of the hybrid worker group the + webhook job will run on. + :type run_on: str + :param creation_time: Gets or sets the creation time. + :type creation_time: datetime + :param last_modified_time: Gets or sets the last modified time. + :type last_modified_time: datetime + :param last_modified_by: Details of the user who last modified the Webhook + :type last_modified_by: str + :param description: Gets or sets the description. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'last_invoked_time': {'key': 'properties.lastInvokedTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, is_enabled: bool=False, uri: str=None, expiry_time=None, last_invoked_time=None, parameters=None, runbook=None, run_on: str=None, creation_time=None, last_modified_time=None, last_modified_by: str=None, description: str=None, **kwargs) -> None: + super(Webhook, self).__init__(**kwargs) + self.is_enabled = is_enabled + self.uri = uri + self.expiry_time = expiry_time + self.last_invoked_time = last_invoked_time + self.parameters = parameters + self.runbook = runbook + self.run_on = run_on + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.last_modified_by = last_modified_by + self.description = description + + +class WebhookCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update webhook operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the name of the webhook. + :type name: str + :param is_enabled: Gets or sets the value of the enabled flag of webhook. + :type is_enabled: bool + :param uri: Gets or sets the uri. + :type uri: str + :param expiry_time: Gets or sets the expiry time. + :type expiry_time: datetime + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param runbook: Gets or sets the runbook. + :type runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty + :param run_on: Gets or sets the name of the hybrid worker group the + webhook job will run on. + :type run_on: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'expiry_time': {'key': 'properties.expiryTime', 'type': 'iso-8601'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + } + + def __init__(self, *, name: str, is_enabled: bool=None, uri: str=None, expiry_time=None, parameters=None, runbook=None, run_on: str=None, **kwargs) -> None: + super(WebhookCreateOrUpdateParameters, self).__init__(**kwargs) + self.name = name + self.is_enabled = is_enabled + self.uri = uri + self.expiry_time = expiry_time + self.parameters = parameters + self.runbook = runbook + self.run_on = run_on + + +class WebhookUpdateParameters(Model): + """The parameters supplied to the update webhook operation. + + :param name: Gets or sets the name of the webhook. + :type name: str + :param is_enabled: Gets or sets the value of the enabled flag of webhook. + :type is_enabled: bool + :param run_on: Gets or sets the name of the hybrid worker group the + webhook job will run on. + :type run_on: str + :param parameters: Gets or sets the parameters of the job. + :type parameters: dict[str, str] + :param description: Gets or sets the description of the webhook. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, is_enabled: bool=None, run_on: str=None, parameters=None, description: str=None, **kwargs) -> None: + super(WebhookUpdateParameters, self).__init__(**kwargs) + self.name = name + self.is_enabled = is_enabled + self.run_on = run_on + self.parameters = parameters + self.description = description + + +class WindowsProperties(Model): + """Windows specific update configuration. + + :param included_update_classifications: Update classification included in + the software update configuration. A comma separated string with required + values. Possible values include: 'Unclassified', 'Critical', 'Security', + 'UpdateRollup', 'FeaturePack', 'ServicePack', 'Definition', 'Tools', + 'Updates' + :type included_update_classifications: str or + ~azure.mgmt.automation.models.WindowsUpdateClasses + :param excluded_kb_numbers: KB numbers excluded from the software update + configuration. + :type excluded_kb_numbers: list[str] + :param included_kb_numbers: KB numbers included from the software update + configuration. + :type included_kb_numbers: list[str] + :param reboot_setting: Reboot setting for the software update + configuration. + :type reboot_setting: str + """ + + _attribute_map = { + 'included_update_classifications': {'key': 'includedUpdateClassifications', 'type': 'str'}, + 'excluded_kb_numbers': {'key': 'excludedKbNumbers', 'type': '[str]'}, + 'included_kb_numbers': {'key': 'includedKbNumbers', 'type': '[str]'}, + 'reboot_setting': {'key': 'rebootSetting', 'type': 'str'}, + } + + def __init__(self, *, included_update_classifications=None, excluded_kb_numbers=None, included_kb_numbers=None, reboot_setting: str=None, **kwargs) -> None: + super(WindowsProperties, self).__init__(**kwargs) + self.included_update_classifications = included_update_classifications + self.excluded_kb_numbers = excluded_kb_numbers + self.included_kb_numbers = included_kb_numbers + self.reboot_setting = reboot_setting diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_paged_models.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_paged_models.py new file mode 100644 index 000000000000..41ae6c399cc3 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_paged_models.py @@ -0,0 +1,378 @@ +# 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 AutomationAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`AutomationAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AutomationAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(AutomationAccountPaged, self).__init__(*args, **kwargs) +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class StatisticsPaged(Paged): + """ + A paging container for iterating over a list of :class:`Statistics ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Statistics]'} + } + + def __init__(self, *args, **kwargs): + + super(StatisticsPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) +class CertificatePaged(Paged): + """ + A paging container for iterating over a list of :class:`Certificate ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Certificate]'} + } + + def __init__(self, *args, **kwargs): + + super(CertificatePaged, self).__init__(*args, **kwargs) +class ConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`Connection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Connection]'} + } + + def __init__(self, *args, **kwargs): + + super(ConnectionPaged, self).__init__(*args, **kwargs) +class ConnectionTypePaged(Paged): + """ + A paging container for iterating over a list of :class:`ConnectionType ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ConnectionType]'} + } + + def __init__(self, *args, **kwargs): + + super(ConnectionTypePaged, self).__init__(*args, **kwargs) +class CredentialPaged(Paged): + """ + A paging container for iterating over a list of :class:`Credential ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Credential]'} + } + + def __init__(self, *args, **kwargs): + + super(CredentialPaged, self).__init__(*args, **kwargs) +class DscConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`DscConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DscConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(DscConfigurationPaged, self).__init__(*args, **kwargs) +class HybridRunbookWorkerGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`HybridRunbookWorkerGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[HybridRunbookWorkerGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(HybridRunbookWorkerGroupPaged, self).__init__(*args, **kwargs) +class JobSchedulePaged(Paged): + """ + A paging container for iterating over a list of :class:`JobSchedule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobSchedule]'} + } + + def __init__(self, *args, **kwargs): + + super(JobSchedulePaged, self).__init__(*args, **kwargs) +class ActivityPaged(Paged): + """ + A paging container for iterating over a list of :class:`Activity ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Activity]'} + } + + def __init__(self, *args, **kwargs): + + super(ActivityPaged, self).__init__(*args, **kwargs) +class ModulePaged(Paged): + """ + A paging container for iterating over a list of :class:`Module ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Module]'} + } + + def __init__(self, *args, **kwargs): + + super(ModulePaged, self).__init__(*args, **kwargs) +class TypeFieldPaged(Paged): + """ + A paging container for iterating over a list of :class:`TypeField ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TypeField]'} + } + + def __init__(self, *args, **kwargs): + + super(TypeFieldPaged, self).__init__(*args, **kwargs) +class SchedulePaged(Paged): + """ + A paging container for iterating over a list of :class:`Schedule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Schedule]'} + } + + def __init__(self, *args, **kwargs): + + super(SchedulePaged, self).__init__(*args, **kwargs) +class VariablePaged(Paged): + """ + A paging container for iterating over a list of :class:`Variable ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Variable]'} + } + + def __init__(self, *args, **kwargs): + + super(VariablePaged, self).__init__(*args, **kwargs) +class WebhookPaged(Paged): + """ + A paging container for iterating over a list of :class:`Webhook ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Webhook]'} + } + + def __init__(self, *args, **kwargs): + + super(WebhookPaged, self).__init__(*args, **kwargs) +class WatcherPaged(Paged): + """ + A paging container for iterating over a list of :class:`Watcher ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Watcher]'} + } + + def __init__(self, *args, **kwargs): + + super(WatcherPaged, self).__init__(*args, **kwargs) +class SourceControlPaged(Paged): + """ + A paging container for iterating over a list of :class:`SourceControl ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SourceControl]'} + } + + def __init__(self, *args, **kwargs): + + super(SourceControlPaged, self).__init__(*args, **kwargs) +class SourceControlSyncJobPaged(Paged): + """ + A paging container for iterating over a list of :class:`SourceControlSyncJob ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SourceControlSyncJob]'} + } + + def __init__(self, *args, **kwargs): + + super(SourceControlSyncJobPaged, self).__init__(*args, **kwargs) +class SourceControlSyncJobStreamPaged(Paged): + """ + A paging container for iterating over a list of :class:`SourceControlSyncJobStream ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SourceControlSyncJobStream]'} + } + + def __init__(self, *args, **kwargs): + + super(SourceControlSyncJobStreamPaged, self).__init__(*args, **kwargs) +class JobCollectionItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`JobCollectionItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobCollectionItem]'} + } + + def __init__(self, *args, **kwargs): + + super(JobCollectionItemPaged, self).__init__(*args, **kwargs) +class JobStreamPaged(Paged): + """ + A paging container for iterating over a list of :class:`JobStream ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobStream]'} + } + + def __init__(self, *args, **kwargs): + + super(JobStreamPaged, self).__init__(*args, **kwargs) +class DscNodePaged(Paged): + """ + A paging container for iterating over a list of :class:`DscNode ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DscNode]'} + } + + def __init__(self, *args, **kwargs): + + super(DscNodePaged, self).__init__(*args, **kwargs) +class DscNodeReportPaged(Paged): + """ + A paging container for iterating over a list of :class:`DscNodeReport ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DscNodeReport]'} + } + + def __init__(self, *args, **kwargs): + + super(DscNodeReportPaged, self).__init__(*args, **kwargs) +class DscCompilationJobPaged(Paged): + """ + A paging container for iterating over a list of :class:`DscCompilationJob ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DscCompilationJob]'} + } + + def __init__(self, *args, **kwargs): + + super(DscCompilationJobPaged, self).__init__(*args, **kwargs) +class DscNodeConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`DscNodeConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DscNodeConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(DscNodeConfigurationPaged, self).__init__(*args, **kwargs) +class RunbookPaged(Paged): + """ + A paging container for iterating over a list of :class:`Runbook ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Runbook]'} + } + + def __init__(self, *args, **kwargs): + + super(RunbookPaged, self).__init__(*args, **kwargs) diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py index 6d2361041121..76d697d61d78 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py @@ -9,47 +9,47 @@ # regenerated. # -------------------------------------------------------------------------- -from .automation_account_operations import AutomationAccountOperations -from .operations import Operations -from .statistics_operations import StatisticsOperations -from .usages_operations import UsagesOperations -from .keys_operations import KeysOperations -from .certificate_operations import CertificateOperations -from .connection_operations import ConnectionOperations -from .connection_type_operations import ConnectionTypeOperations -from .credential_operations import CredentialOperations -from .dsc_configuration_operations import DscConfigurationOperations -from .hybrid_runbook_worker_group_operations import HybridRunbookWorkerGroupOperations -from .job_schedule_operations import JobScheduleOperations -from .linked_workspace_operations import LinkedWorkspaceOperations -from .activity_operations import ActivityOperations -from .module_operations import ModuleOperations -from .object_data_types_operations import ObjectDataTypesOperations -from .fields_operations import FieldsOperations -from .schedule_operations import ScheduleOperations -from .variable_operations import VariableOperations -from .webhook_operations import WebhookOperations -from .watcher_operations import WatcherOperations -from .software_update_configurations_operations import SoftwareUpdateConfigurationsOperations -from .software_update_configuration_runs_operations import SoftwareUpdateConfigurationRunsOperations -from .software_update_configuration_machine_runs_operations import SoftwareUpdateConfigurationMachineRunsOperations -from .source_control_operations import SourceControlOperations -from .source_control_sync_job_operations import SourceControlSyncJobOperations -from .source_control_sync_job_streams_operations import SourceControlSyncJobStreamsOperations -from .job_operations import JobOperations -from .job_stream_operations import JobStreamOperations -from .agent_registration_information_operations import AgentRegistrationInformationOperations -from .dsc_node_operations import DscNodeOperations -from .node_reports_operations import NodeReportsOperations -from .dsc_compilation_job_operations import DscCompilationJobOperations -from .dsc_compilation_job_stream_operations import DscCompilationJobStreamOperations -from .dsc_node_configuration_operations import DscNodeConfigurationOperations -from .node_count_information_operations import NodeCountInformationOperations -from .runbook_draft_operations import RunbookDraftOperations -from .runbook_operations import RunbookOperations -from .test_job_streams_operations import TestJobStreamsOperations -from .test_job_operations import TestJobOperations -from .python2_package_operations import Python2PackageOperations +from ._automation_account_operations import AutomationAccountOperations +from ._operations import Operations +from ._statistics_operations import StatisticsOperations +from ._usages_operations import UsagesOperations +from ._keys_operations import KeysOperations +from ._certificate_operations import CertificateOperations +from ._connection_operations import ConnectionOperations +from ._connection_type_operations import ConnectionTypeOperations +from ._credential_operations import CredentialOperations +from ._dsc_configuration_operations import DscConfigurationOperations +from ._hybrid_runbook_worker_group_operations import HybridRunbookWorkerGroupOperations +from ._job_schedule_operations import JobScheduleOperations +from ._linked_workspace_operations import LinkedWorkspaceOperations +from ._activity_operations import ActivityOperations +from ._module_operations import ModuleOperations +from ._object_data_types_operations import ObjectDataTypesOperations +from ._fields_operations import FieldsOperations +from ._schedule_operations import ScheduleOperations +from ._variable_operations import VariableOperations +from ._webhook_operations import WebhookOperations +from ._watcher_operations import WatcherOperations +from ._software_update_configurations_operations import SoftwareUpdateConfigurationsOperations +from ._software_update_configuration_runs_operations import SoftwareUpdateConfigurationRunsOperations +from ._software_update_configuration_machine_runs_operations import SoftwareUpdateConfigurationMachineRunsOperations +from ._source_control_operations import SourceControlOperations +from ._source_control_sync_job_operations import SourceControlSyncJobOperations +from ._source_control_sync_job_streams_operations import SourceControlSyncJobStreamsOperations +from ._job_operations import JobOperations +from ._job_stream_operations import JobStreamOperations +from ._agent_registration_information_operations import AgentRegistrationInformationOperations +from ._dsc_node_operations import DscNodeOperations +from ._node_reports_operations import NodeReportsOperations +from ._dsc_compilation_job_operations import DscCompilationJobOperations +from ._dsc_compilation_job_stream_operations import DscCompilationJobStreamOperations +from ._dsc_node_configuration_operations import DscNodeConfigurationOperations +from ._node_count_information_operations import NodeCountInformationOperations +from ._runbook_draft_operations import RunbookDraftOperations +from ._runbook_operations import RunbookOperations +from ._test_job_streams_operations import TestJobStreamsOperations +from ._test_job_operations import TestJobOperations +from ._python2_package_operations import Python2PackageOperations __all__ = [ 'AutomationAccountOperations', diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_activity_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_activity_operations.py new file mode 100644 index 000000000000..8c8e7f04c6ff --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_activity_operations.py @@ -0,0 +1,180 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ActivityOperations(object): + """ActivityOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def get( + self, resource_group_name, automation_account_name, module_name, activity_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the activity in the module identified by module name and + activity name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param activity_name: The name of activity. + :type activity_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Activity or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Activity or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'activityName': self._serialize.url("activity_name", activity_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Activity', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities/{activityName}'} + + def list_by_module( + self, resource_group_name, automation_account_name, module_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of activities in the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Activity + :rtype: + ~azure.mgmt.automation.models.ActivityPaged[~azure.mgmt.automation.models.Activity] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_module.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ActivityPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_agent_registration_information_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_agent_registration_information_operations.py new file mode 100644 index 000000000000..ebac4830af98 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_agent_registration_information_operations.py @@ -0,0 +1,169 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AgentRegistrationInformationOperations(object): + """AgentRegistrationInformationOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + def get( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the automation agent registration information. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AgentRegistration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.AgentRegistration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AgentRegistration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation'} + + def regenerate_key( + self, resource_group_name, automation_account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerate a primary or secondary agent registration key. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param key_name: Gets or sets the agent registration key name - + primary or secondary. Possible values include: 'primary', 'secondary' + :type key_name: str or + ~azure.mgmt.automation.models.AgentRegistrationKeyName + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AgentRegistration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.AgentRegistration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.AgentRegistrationRegenerateKeyParameter(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'AgentRegistrationRegenerateKeyParameter') + + # Construct and send request + 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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AgentRegistration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_automation_account_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_automation_account_operations.py new file mode 100644 index 000000000000..55c33de77664 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_automation_account_operations.py @@ -0,0 +1,424 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class AutomationAccountOperations(object): + """AutomationAccountOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def update( + self, resource_group_name, automation_account_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update an automation account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param parameters: Parameters supplied to the update automation + account. + :type parameters: + ~azure.mgmt.automation.models.AutomationAccountUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AutomationAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.AutomationAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'AutomationAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AutomationAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update automation account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param parameters: Parameters supplied to the create or update + automation account. + :type parameters: + ~azure.mgmt.automation.models.AutomationAccountCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AutomationAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.AutomationAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'AutomationAccountCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AutomationAccount', response) + if response.status_code == 201: + deserialized = self._deserialize('AutomationAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def delete( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Delete an automation account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def get( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Get information about an Automation Account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AutomationAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.AutomationAccount or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AutomationAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of accounts within a given resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AutomationAccount + :rtype: + ~azure.mgmt.automation.models.AutomationAccountPaged[~azure.mgmt.automation.models.AutomationAccount] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AutomationAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the Automation Accounts within an Azure subscription. + + Retrieve a list of accounts within a given subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AutomationAccount + :rtype: + ~azure.mgmt.automation.models.AutomationAccountPaged[~azure.mgmt.automation.models.AutomationAccount] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AutomationAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_certificate_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_certificate_operations.py new file mode 100644 index 000000000000..0b4679a6d408 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_certificate_operations.py @@ -0,0 +1,376 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class CertificateOperations(object): + """CertificateOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, certificate_name, custom_headers=None, raw=False, **operation_config): + """Delete the certificate. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param certificate_name: The name of certificate. + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def get( + self, resource_group_name, automation_account_name, certificate_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the certificate identified by certificate name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param certificate_name: The name of certificate. + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Certificate or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Certificate or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Certificate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, certificate_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a certificate. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param certificate_name: The parameters supplied to the create or + update certificate operation. + :type certificate_name: str + :param parameters: The parameters supplied to the create or update + certificate operation. + :type parameters: + ~azure.mgmt.automation.models.CertificateCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Certificate or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Certificate or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'CertificateCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Certificate', response) + if response.status_code == 201: + deserialized = self._deserialize('Certificate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def update( + self, resource_group_name, automation_account_name, certificate_name, name=None, description=None, custom_headers=None, raw=False, **operation_config): + """Update a certificate. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param certificate_name: The parameters supplied to the update + certificate operation. + :type certificate_name: str + :param name: Gets or sets the name of the certificate. + :type name: str + :param description: Gets or sets the description of the certificate. + :type description: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Certificate or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Certificate or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.CertificateUpdateParameters(name=name, description=description) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'CertificateUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Certificate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of certificates. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Certificate + :rtype: + ~azure.mgmt.automation.models.CertificatePaged[~azure.mgmt.automation.models.Certificate] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.CertificatePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_operations.py new file mode 100644 index 000000000000..4c52d60bc62f --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_operations.py @@ -0,0 +1,382 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ConnectionOperations(object): + """ConnectionOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, connection_name, custom_headers=None, raw=False, **operation_config): + """Delete the connection. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_name: The name of connection. + :type connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Connection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Connection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Connection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def get( + self, resource_group_name, automation_account_name, connection_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the connection identified by connection name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_name: The name of connection. + :type connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Connection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Connection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Connection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update a connection. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_name: The parameters supplied to the create or + update connection operation. + :type connection_name: str + :param parameters: The parameters supplied to the create or update + connection operation. + :type parameters: + ~azure.mgmt.automation.models.ConnectionCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Connection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Connection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'ConnectionCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Connection', response) + if response.status_code == 201: + deserialized = self._deserialize('Connection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def update( + self, resource_group_name, automation_account_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a connection. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_name: The parameters supplied to the update a + connection operation. + :type connection_name: str + :param parameters: The parameters supplied to the update a connection + operation. + :type parameters: + ~azure.mgmt.automation.models.ConnectionUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Connection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Connection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'ConnectionUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Connection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of connections. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Connection + :rtype: + ~azure.mgmt.automation.models.ConnectionPaged[~azure.mgmt.automation.models.Connection] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_type_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_type_operations.py new file mode 100644 index 000000000000..86038176596c --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_type_operations.py @@ -0,0 +1,302 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ConnectionTypeOperations(object): + """ConnectionTypeOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, connection_type_name, custom_headers=None, raw=False, **operation_config): + """Delete the connection type. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_type_name: The name of connection type. + :type connection_type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionTypeName': self._serialize.url("connection_type_name", connection_type_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'} + + def get( + self, resource_group_name, automation_account_name, connection_type_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the connection type identified by connection type name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_type_name: The name of connection type. + :type connection_type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectionType or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.ConnectionType or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionTypeName': self._serialize.url("connection_type_name", connection_type_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ConnectionType', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, connection_type_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a connection type. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param connection_type_name: The parameters supplied to the create or + update connection type operation. + :type connection_type_name: str + :param parameters: The parameters supplied to the create or update + connection type operation. + :type parameters: + ~azure.mgmt.automation.models.ConnectionTypeCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectionType or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.ConnectionType or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'connectionTypeName': self._serialize.url("connection_type_name", connection_type_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'ConnectionTypeCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201, 409]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('ConnectionType', response) + if response.status_code == 409: + deserialized = self._deserialize('ConnectionType', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of connection types. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConnectionType + :rtype: + ~azure.mgmt.automation.models.ConnectionTypePaged[~azure.mgmt.automation.models.ConnectionType] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ConnectionTypePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_credential_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_credential_operations.py new file mode 100644 index 000000000000..f27012a4192c --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_credential_operations.py @@ -0,0 +1,376 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class CredentialOperations(object): + """CredentialOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, credential_name, custom_headers=None, raw=False, **operation_config): + """Delete the credential. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param credential_name: The name of credential. + :type credential_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def get( + self, resource_group_name, automation_account_name, credential_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the credential identified by credential name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param credential_name: The name of credential. + :type credential_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Credential or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Credential or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Credential', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, credential_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a credential. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param credential_name: The parameters supplied to the create or + update credential operation. + :type credential_name: str + :param parameters: The parameters supplied to the create or update + credential operation. + :type parameters: + ~azure.mgmt.automation.models.CredentialCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Credential or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Credential or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'CredentialCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Credential', response) + if response.status_code == 201: + deserialized = self._deserialize('Credential', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def update( + self, resource_group_name, automation_account_name, credential_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a credential. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param credential_name: The parameters supplied to the Update + credential operation. + :type credential_name: str + :param parameters: The parameters supplied to the Update credential + operation. + :type parameters: + ~azure.mgmt.automation.models.CredentialUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Credential or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Credential or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'credentialName': self._serialize.url("credential_name", credential_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'CredentialUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Credential', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of credentials. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Credential + :rtype: + ~azure.mgmt.automation.models.CredentialPaged[~azure.mgmt.automation.models.Credential] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.CredentialPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_operations.py new file mode 100644 index 000000000000..6315ab388f5e --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_operations.py @@ -0,0 +1,350 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DscCompilationJobOperations(object): + """DscCompilationJobOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + + def _create_initial( + self, resource_group_name, automation_account_name, compilation_job_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'compilationJobName': self._serialize.url("compilation_job_name", compilation_job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'DscCompilationJobCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('DscCompilationJob', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, automation_account_name, compilation_job_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates the Dsc compilation job of the configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param compilation_job_name: The DSC configuration Id. + :type compilation_job_name: str + :param parameters: The parameters supplied to the create compilation + job operation. + :type parameters: + ~azure.mgmt.automation.models.DscCompilationJobCreateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DscCompilationJob or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.automation.models.DscCompilationJob] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.automation.models.DscCompilationJob]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + compilation_job_name=compilation_job_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DscCompilationJob', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}'} + + def get( + self, resource_group_name, automation_account_name, compilation_job_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc configuration compilation job identified by job id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param compilation_job_name: The DSC configuration Id. + :type compilation_job_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscCompilationJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscCompilationJob or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'compilationJobName': self._serialize.url("compilation_job_name", compilation_job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DscCompilationJob', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of dsc compilation jobs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DscCompilationJob + :rtype: + ~azure.mgmt.automation.models.DscCompilationJobPaged[~azure.mgmt.automation.models.DscCompilationJob] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DscCompilationJobPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs'} + + def get_stream( + self, resource_group_name, automation_account_name, job_id, job_stream_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the job stream identified by job stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_id: The job id. + :type job_id: str + :param job_stream_id: The job stream id. + :type job_stream_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobStream or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.JobStream or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_stream.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, 'str'), + 'jobStreamId': self._serialize.url("job_stream_id", job_stream_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobStream', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_stream.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_stream_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_stream_operations.py new file mode 100644 index 000000000000..fc1f4a7428bf --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_stream_operations.py @@ -0,0 +1,102 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class DscCompilationJobStreamOperations(object): + """DscCompilationJobStreamOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + def list_by_job( + self, resource_group_name, automation_account_name, job_id, custom_headers=None, raw=False, **operation_config): + """Retrieve all the job streams for the compilation Job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_id: The job id. + :type job_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobStreamListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.JobStreamListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobStreamListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_configuration_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_configuration_operations.py new file mode 100644 index 000000000000..f8355b95d270 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_configuration_operations.py @@ -0,0 +1,458 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DscConfigurationOperations(object): + """DscConfigurationOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, configuration_name, custom_headers=None, raw=False, **operation_config): + """Delete the dsc configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The configuration name. + :type configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + def get( + self, resource_group_name, automation_account_name, configuration_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The configuration name. + :type configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DscConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, configuration_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create the configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The create or update parameters for + configuration. + :type configuration_name: str + :param parameters: The create or update parameters for configuration. + :type parameters: + ~azure.mgmt.automation.models.DscConfigurationCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'DscConfigurationCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DscConfiguration', response) + if response.status_code == 201: + deserialized = self._deserialize('DscConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + def update( + self, resource_group_name, automation_account_name, configuration_name, parameters=None, custom_headers=None, raw=False, **operation_config): + """Create the configuration identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The create or update parameters for + configuration. + :type configuration_name: str + :param parameters: The create or update parameters for configuration. + :type parameters: + ~azure.mgmt.automation.models.DscConfigurationUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 parameters is not None: + body_content = self._serialize.body(parameters, 'DscConfigurationUpdateParameters') + else: + body_content = None + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DscConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'} + + def get_content( + self, resource_group_name, automation_account_name, configuration_name, custom_headers=None, raw=False, callback=None, **operation_config): + """Retrieve the configuration script identified by configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param configuration_name: The configuration name. + :type configuration_name: str + :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`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'text/powershell' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, 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 + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, skip=None, top=None, inlinecount=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of configurations. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param skip: The number of rows to skip. + :type skip: int + :param top: The number of rows to take. + :type top: int + :param inlinecount: Return total rows. + :type inlinecount: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DscConfiguration + :rtype: + ~azure.mgmt.automation.models.DscConfigurationPaged[~azure.mgmt.automation.models.DscConfiguration] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if inlinecount is not None: + query_parameters['$inlinecount'] = self._serialize.query("inlinecount", inlinecount, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DscConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_configuration_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_configuration_operations.py new file mode 100644 index 000000000000..4bd8d8fbf356 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_configuration_operations.py @@ -0,0 +1,350 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DscNodeConfigurationOperations(object): + """DscNodeConfigurationOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, node_configuration_name, custom_headers=None, raw=False, **operation_config): + """Delete the Dsc node configurations by node configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_configuration_name: The Dsc node configuration name. + :type node_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeConfigurationName': self._serialize.url("node_configuration_name", node_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + def get( + self, resource_group_name, automation_account_name, node_configuration_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc node configurations by node configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_configuration_name: The Dsc node configuration name. + :type node_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscNodeConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscNodeConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeConfigurationName': self._serialize.url("node_configuration_name", node_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DscNodeConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + + def _create_or_update_initial( + self, resource_group_name, automation_account_name, node_configuration_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeConfigurationName': self._serialize.url("node_configuration_name", node_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'DscNodeConfigurationCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('DscNodeConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, automation_account_name, node_configuration_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create the node configuration identified by node configuration name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_configuration_name: The Dsc node configuration name. + :type node_configuration_name: str + :param parameters: The create or update parameters for configuration. + :type parameters: + ~azure.mgmt.automation.models.DscNodeConfigurationCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DscNodeConfiguration or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.automation.models.DscNodeConfiguration] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.automation.models.DscNodeConfiguration]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + node_configuration_name=node_configuration_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DscNodeConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, skip=None, top=None, inlinecount=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of dsc node configurations. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param skip: The number of rows to skip. + :type skip: int + :param top: The number of rows to take. + :type top: int + :param inlinecount: Return total rows. + :type inlinecount: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DscNodeConfiguration + :rtype: + ~azure.mgmt.automation.models.DscNodeConfigurationPaged[~azure.mgmt.automation.models.DscNodeConfiguration] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if inlinecount is not None: + query_parameters['$inlinecount'] = self._serialize.query("inlinecount", inlinecount, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DscNodeConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_operations.py new file mode 100644 index 000000000000..6b3a759d4d47 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_operations.py @@ -0,0 +1,326 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class DscNodeOperations(object): + """DscNodeOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, node_id, custom_headers=None, raw=False, **operation_config): + """Delete the dsc node identified by node id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The node id. + :type node_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscNode or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscNode or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DscNode', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'} + + def get( + self, resource_group_name, automation_account_name, node_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the dsc node identified by node id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The node id. + :type node_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscNode or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscNode or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DscNode', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'} + + def update( + self, resource_group_name, automation_account_name, node_id, node_id1=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Update the dsc node. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: Parameters supplied to the update dsc node. + :type node_id: str + :param node_id1: Gets or sets the id of the dsc node. + :type node_id1: str + :param properties: + :type properties: + ~azure.mgmt.automation.models.DscNodeUpdateParametersProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscNode or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscNode or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + dsc_node_update_parameters = models.DscNodeUpdateParameters(node_id=node_id1, properties=properties) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(dsc_node_update_parameters, 'DscNodeUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DscNode', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, skip=None, top=None, inlinecount=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of dsc nodes. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param skip: The number of rows to skip. + :type skip: int + :param top: The number of rows to take. + :type top: int + :param inlinecount: Return total rows. + :type inlinecount: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DscNode + :rtype: + ~azure.mgmt.automation.models.DscNodePaged[~azure.mgmt.automation.models.DscNode] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if inlinecount is not None: + query_parameters['$inlinecount'] = self._serialize.query("inlinecount", inlinecount, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DscNodePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_fields_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_fields_operations.py new file mode 100644 index 000000000000..8a96c72752cf --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_fields_operations.py @@ -0,0 +1,116 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class FieldsOperations(object): + """FieldsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def list_by_type( + self, resource_group_name, automation_account_name, module_name, type_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of fields of a given type identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param type_name: The name of type. + :type type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TypeField + :rtype: + ~azure.mgmt.automation.models.TypeFieldPaged[~azure.mgmt.automation.models.TypeField] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'typeName': self._serialize.url("type_name", type_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/types/{typeName}/fields'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_hybrid_runbook_worker_group_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_hybrid_runbook_worker_group_operations.py new file mode 100644 index 000000000000..244238e832b3 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_hybrid_runbook_worker_group_operations.py @@ -0,0 +1,307 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class HybridRunbookWorkerGroupOperations(object): + """HybridRunbookWorkerGroupOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, hybrid_runbook_worker_group_name, custom_headers=None, raw=False, **operation_config): + """Delete a hybrid runbook worker group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param hybrid_runbook_worker_group_name: The hybrid runbook worker + group name + :type hybrid_runbook_worker_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'hybridRunbookWorkerGroupName': self._serialize.url("hybrid_runbook_worker_group_name", hybrid_runbook_worker_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'} + + def get( + self, resource_group_name, automation_account_name, hybrid_runbook_worker_group_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a hybrid runbook worker group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param hybrid_runbook_worker_group_name: The hybrid runbook worker + group name + :type hybrid_runbook_worker_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: HybridRunbookWorkerGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.HybridRunbookWorkerGroup or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'hybridRunbookWorkerGroupName': self._serialize.url("hybrid_runbook_worker_group_name", hybrid_runbook_worker_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HybridRunbookWorkerGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'} + + def update( + self, resource_group_name, automation_account_name, hybrid_runbook_worker_group_name, credential=None, custom_headers=None, raw=False, **operation_config): + """Update a hybrid runbook worker group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param hybrid_runbook_worker_group_name: The hybrid runbook worker + group name + :type hybrid_runbook_worker_group_name: str + :param credential: Sets the credential of a worker group. + :type credential: + ~azure.mgmt.automation.models.RunAsCredentialAssociationProperty + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: HybridRunbookWorkerGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.HybridRunbookWorkerGroup or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.HybridRunbookWorkerGroupUpdateParameters(credential=credential) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'hybridRunbookWorkerGroupName': self._serialize.url("hybrid_runbook_worker_group_name", hybrid_runbook_worker_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'HybridRunbookWorkerGroupUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HybridRunbookWorkerGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of hybrid runbook worker groups. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of HybridRunbookWorkerGroup + :rtype: + ~azure.mgmt.automation.models.HybridRunbookWorkerGroupPaged[~azure.mgmt.automation.models.HybridRunbookWorkerGroup] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.HybridRunbookWorkerGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_operations.py new file mode 100644 index 000000000000..af3e1c07ee0f --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_operations.py @@ -0,0 +1,576 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class JobOperations(object): + """JobOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def get_output( + 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. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The name of the job to be created. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :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`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_output.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'text/plain' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, 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 + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + 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, 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. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :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`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_runbook_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_runbook_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/runbookContent'} + + def suspend( + self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Suspend the job identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.suspend.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/suspend'} + + def stop( + self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Stop the job identified by jobName. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/stop'} + + def get( + self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Retrieve the job identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Job or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Job or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Job', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}'} + + def create( + self, resource_group_name, automation_account_name, job_name, parameters, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Create a job of the runbook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param parameters: The parameters supplied to the create job + operation. + :type parameters: ~azure.mgmt.automation.models.JobCreateParameters + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Job or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Job or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 + body_content = self._serialize.body(parameters, 'JobCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('Job', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of jobs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobCollectionItem + :rtype: + ~azure.mgmt.automation.models.JobCollectionItemPaged[~azure.mgmt.automation.models.JobCollectionItem] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.JobCollectionItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs'} + + def resume( + self, resource_group_name, automation_account_name, job_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Resume the job identified by jobName. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.resume.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/resume'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_schedule_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_schedule_operations.py new file mode 100644 index 000000000000..1a055b069013 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_schedule_operations.py @@ -0,0 +1,303 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class JobScheduleOperations(object): + """JobScheduleOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, job_schedule_id, custom_headers=None, raw=False, **operation_config): + """Delete the job schedule identified by job schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_schedule_id: The job schedule name. + :type job_schedule_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobScheduleId': self._serialize.url("job_schedule_id", job_schedule_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'} + + def get( + self, resource_group_name, automation_account_name, job_schedule_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the job schedule identified by job schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_schedule_id: The job schedule name. + :type job_schedule_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobSchedule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.JobSchedule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobScheduleId': self._serialize.url("job_schedule_id", job_schedule_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobSchedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'} + + def create( + self, resource_group_name, automation_account_name, job_schedule_id, parameters, custom_headers=None, raw=False, **operation_config): + """Create a job schedule. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_schedule_id: The job schedule name. + :type job_schedule_id: str + :param parameters: The parameters supplied to the create job schedule + operation. + :type parameters: + ~azure.mgmt.automation.models.JobScheduleCreateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobSchedule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.JobSchedule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobScheduleId': self._serialize.url("job_schedule_id", job_schedule_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'JobScheduleCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('JobSchedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of job schedules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobSchedule + :rtype: + ~azure.mgmt.automation.models.JobSchedulePaged[~azure.mgmt.automation.models.JobSchedule] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.JobSchedulePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_stream_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_stream_operations.py new file mode 100644 index 000000000000..f0a1b855a965 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_stream_operations.py @@ -0,0 +1,191 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class JobStreamOperations(object): + """JobStreamOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def get( + self, resource_group_name, automation_account_name, job_name, job_stream_id, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Retrieve the job stream identified by job stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param job_stream_id: The job stream id. + :type job_stream_id: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobStream or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.JobStream or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'jobStreamId': self._serialize.url("job_stream_id", job_stream_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobStream', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams/{jobStreamId}'} + + def list_by_job( + self, resource_group_name, automation_account_name, job_name, filter=None, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of jobs streams identified by job name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param job_name: The job name. + :type job_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobStream + :rtype: + ~azure.mgmt.automation.models.JobStreamPaged[~azure.mgmt.automation.models.JobStream] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.JobStreamPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_keys_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_keys_operations.py new file mode 100644 index 000000000000..bfc45cb09690 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_keys_operations.py @@ -0,0 +1,99 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class KeysOperations(object): + """KeysOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the automation keys for an account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.KeyListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('KeyListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_linked_workspace_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_linked_workspace_operations.py new file mode 100644 index 000000000000..818c38016d8f --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_linked_workspace_operations.py @@ -0,0 +1,99 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class LinkedWorkspaceOperations(object): + """LinkedWorkspaceOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def get( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the linked workspace for the account id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LinkedWorkspace or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.LinkedWorkspace or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LinkedWorkspace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/linkedWorkspace'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_module_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_module_operations.py new file mode 100644 index 000000000000..a5e1afd21a51 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_module_operations.py @@ -0,0 +1,369 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ModuleOperations(object): + """ModuleOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, module_name, custom_headers=None, raw=False, **operation_config): + """Delete the module by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The module name. + :type module_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def get( + self, resource_group_name, automation_account_name, module_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The module name. + :type module_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Module or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Module or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Module', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, module_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or Update the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param parameters: The create or update parameters for module. + :type parameters: + ~azure.mgmt.automation.models.ModuleCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Module or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Module or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'ModuleCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Module', response) + if response.status_code == 201: + deserialized = self._deserialize('Module', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def update( + self, resource_group_name, automation_account_name, module_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update the module identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param parameters: The update parameters for module. + :type parameters: ~azure.mgmt.automation.models.ModuleUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Module or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Module or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'ModuleUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Module', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of modules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Module + :rtype: + ~azure.mgmt.automation.models.ModulePaged[~azure.mgmt.automation.models.Module] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ModulePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_count_information_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_count_information_operations.py new file mode 100644 index 000000000000..1b562951cd6d --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_count_information_operations.py @@ -0,0 +1,103 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class NodeCountInformationOperations(object): + """NodeCountInformationOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + def get( + self, resource_group_name, automation_account_name, count_type, custom_headers=None, raw=False, **operation_config): + """Retrieve counts for Dsc Nodes. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param count_type: The type of counts to retrieve. Possible values + include: 'status', 'nodeconfiguration' + :type count_type: str or ~azure.mgmt.automation.models.CountType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NodeCounts or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.NodeCounts or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'countType': self._serialize.url("count_type", count_type, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NodeCounts', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodecounts/{countType}'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_reports_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_reports_operations.py new file mode 100644 index 000000000000..db8da21ad20e --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_reports_operations.py @@ -0,0 +1,248 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class NodeReportsOperations(object): + """NodeReportsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-01-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-15" + + self.config = config + + def list_by_node( + self, resource_group_name, automation_account_name, node_id, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc node report list by node id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The parameters supplied to the list operation. + :type node_id: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DscNodeReport + :rtype: + ~azure.mgmt.automation.models.DscNodeReportPaged[~azure.mgmt.automation.models.DscNodeReport] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_node.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DscNodeReportPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_node.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports'} + + def get( + self, resource_group_name, automation_account_name, node_id, report_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc node report data by node id and report id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The Dsc node id. + :type node_id: str + :param report_id: The report id. + :type report_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DscNodeReport or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscNodeReport or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'reportId': self._serialize.url("report_id", report_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DscNodeReport', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}'} + + def get_content( + self, resource_group_name, automation_account_name, node_id, report_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc node reports by node id and report id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param node_id: The Dsc node id. + :type node_id: str + :param report_id: The report id. + :type report_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'nodeId': self._serialize.url("node_id", node_id, 'str'), + 'reportId': self._serialize.url("report_id", report_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}/content'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_object_data_types_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_object_data_types_operations.py new file mode 100644 index 000000000000..50b4141dacf6 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_object_data_types_operations.py @@ -0,0 +1,191 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ObjectDataTypesOperations(object): + """ObjectDataTypesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def list_fields_by_module_and_type( + self, resource_group_name, automation_account_name, module_name, type_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of fields of a given type identified by module name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param module_name: The name of module. + :type module_name: str + :param type_name: The name of type. + :type type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TypeField + :rtype: + ~azure.mgmt.automation.models.TypeFieldPaged[~azure.mgmt.automation.models.TypeField] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_fields_by_module_and_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'moduleName': self._serialize.url("module_name", module_name, 'str'), + 'typeName': self._serialize.url("type_name", type_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_fields_by_module_and_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/objectDataTypes/{typeName}/fields'} + + def list_fields_by_type( + self, resource_group_name, automation_account_name, type_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of fields of a given type across all accessible + modules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param type_name: The name of type. + :type type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TypeField + :rtype: + ~azure.mgmt.automation.models.TypeFieldPaged[~azure.mgmt.automation.models.TypeField] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_fields_by_type.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'typeName': self._serialize.url("type_name", type_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_fields_by_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_operations.py new file mode 100644 index 000000000000..6d53424bbf58 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_operations.py @@ -0,0 +1,100 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Automation REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.automation.models.OperationPaged[~azure.mgmt.automation.models.Operation] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Automation/operations'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_python2_package_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_python2_package_operations.py new file mode 100644 index 000000000000..4e3948f761db --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_python2_package_operations.py @@ -0,0 +1,374 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Python2PackageOperations(object): + """Python2PackageOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-06-30". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-30" + + self.config = config + + def delete( + self, resource_group_name, automation_account_name, package_name, custom_headers=None, raw=False, **operation_config): + """Delete the python 2 package by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param package_name: The python package name. + :type package_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'packageName': self._serialize.url("package_name", package_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'} + + def get( + self, resource_group_name, automation_account_name, package_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the python 2 package identified by package name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param package_name: The python package name. + :type package_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Module or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Module or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'packageName': self._serialize.url("package_name", package_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Module', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, package_name, content_link, tags=None, custom_headers=None, raw=False, **operation_config): + """Create or Update the python 2 package identified by package name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param package_name: The name of python package. + :type package_name: str + :param content_link: Gets or sets the module content link. + :type content_link: ~azure.mgmt.automation.models.ContentLink + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Module or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Module or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.PythonPackageCreateParameters(content_link=content_link, tags=tags) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'packageName': self._serialize.url("package_name", package_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'PythonPackageCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Module', response) + if response.status_code == 201: + deserialized = self._deserialize('Module', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'} + + def update( + self, resource_group_name, automation_account_name, package_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Update the python 2 package identified by package name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param package_name: The name of python package. + :type package_name: str + :param tags: Gets or sets the tags attached to the resource. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Module or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Module or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.PythonPackageUpdateParameters(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'packageName': self._serialize.url("package_name", package_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'PythonPackageUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Module', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of python 2 packages. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Module + :rtype: + ~azure.mgmt.automation.models.ModulePaged[~azure.mgmt.automation.models.Module] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ModulePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_draft_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_draft_operations.py new file mode 100644 index 000000000000..959a92b70c57 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_draft_operations.py @@ -0,0 +1,346 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class RunbookDraftOperations(object): + """RunbookDraftOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-06-30". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-30" + + self.config = config + + def get_content( + 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. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :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`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'text/powershell' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, 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 + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'} + + + def _replace_content_initial( + 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 = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'text/powershell' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 + body_content = upload_gen(runbook_content) + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('object', response) + header_dict = { + 'location': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def replace_content( + self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, callback=None, polling=True, **operation_config): + """Replaces the runbook draft content. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param runbook_content: The runbook draft content. + :type runbook_content: Generator + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns object or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[Generator] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[Generator]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._replace_content_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + runbook_content=runbook_content, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'location': 'str', + } + deserialized = self._deserialize('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + replace_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'} + + def get( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the runbook draft identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RunbookDraft or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.RunbookDraft or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RunbookDraft', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft'} + + def undo_edit( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Undo draft edit to last known published state identified by runbook + name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RunbookDraftUndoEditResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.RunbookDraftUndoEditResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.undo_edit.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RunbookDraftUndoEditResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + undo_edit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/undoEdit'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_operations.py new file mode 100644 index 000000000000..fd386a52fdb9 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_operations.py @@ -0,0 +1,531 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class RunbookOperations(object): + """RunbookOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-06-30". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-30" + + self.config = config + + + def _publish_initial( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.publish.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'location': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def publish( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Publish runbook draft. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The parameters supplied to the publish runbook + operation. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._publish_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + runbook_name=runbook_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'location': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + publish.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/publish'} + + def get_content( + 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. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :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`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_content.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'text/powershell' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, 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 + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_content.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/content'} + + def get( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Runbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Runbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Runbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, runbook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create the runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param parameters: The create or update parameters for runbook. + Provide either content link for a published runbook or draft, not + both. + :type parameters: + ~azure.mgmt.automation.models.RunbookCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Runbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Runbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'RunbookCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Runbook', response) + if response.status_code == 201: + deserialized = self._deserialize('Runbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def update( + self, resource_group_name, automation_account_name, runbook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update the runbook identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param parameters: The update parameters for runbook. + :type parameters: + ~azure.mgmt.automation.models.RunbookUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Runbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Runbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'RunbookUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Runbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def delete( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Delete the runbook by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of runbooks. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Runbook + :rtype: + ~azure.mgmt.automation.models.RunbookPaged[~azure.mgmt.automation.models.Runbook] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RunbookPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_schedule_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_schedule_operations.py new file mode 100644 index 000000000000..ae205a84ce62 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_schedule_operations.py @@ -0,0 +1,372 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ScheduleOperations(object): + """ScheduleOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def create_or_update( + self, resource_group_name, automation_account_name, schedule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a schedule. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :param parameters: The parameters supplied to the create or update + schedule operation. + :type parameters: + ~azure.mgmt.automation.models.ScheduleCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Schedule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Schedule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'ScheduleCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 409]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Schedule', response) + if response.status_code == 201: + deserialized = self._deserialize('Schedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def update( + self, resource_group_name, automation_account_name, schedule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update the schedule identified by schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :param parameters: The parameters supplied to the update schedule + operation. + :type parameters: + ~azure.mgmt.automation.models.ScheduleUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Schedule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Schedule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'ScheduleUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Schedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def get( + self, resource_group_name, automation_account_name, schedule_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the schedule identified by schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Schedule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Schedule or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Schedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def delete( + self, resource_group_name, automation_account_name, schedule_name, custom_headers=None, raw=False, **operation_config): + """Delete the schedule identified by schedule name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param schedule_name: The schedule name. + :type schedule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'scheduleName': self._serialize.url("schedule_name", schedule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of schedules. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Schedule + :rtype: + ~azure.mgmt.automation.models.SchedulePaged[~azure.mgmt.automation.models.Schedule] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SchedulePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_machine_runs_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_machine_runs_operations.py new file mode 100644 index 000000000000..5bc366f2d713 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_machine_runs_operations.py @@ -0,0 +1,191 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class SoftwareUpdateConfigurationMachineRunsOperations(object): + """SoftwareUpdateConfigurationMachineRunsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def get_by_id( + self, resource_group_name, automation_account_name, software_update_configuration_machine_run_id, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Get a single software update configuration machine run by Id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_machine_run_id: The Id of the + software update configuration machine run. + :type software_update_configuration_machine_run_id: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfigurationMachineRun or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRun or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationMachineRunId': self._serialize.url("software_update_configuration_machine_run_id", software_update_configuration_machine_run_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfigurationMachineRun', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId}'} + + def list( + self, resource_group_name, automation_account_name, client_request_id=None, filter=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Return list of software update configuration machine runs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param filter: The filter to apply on the operation. You can use the + following filters: 'properties/osType', 'properties/status', + 'properties/startTime', and + 'properties/softwareUpdateConfiguration/name' + :type filter: str + :param skip: number of entries you skip before returning results + :type skip: str + :param top: Maximum number of entries returned in the results + collection + :type top: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfigurationMachineRunListResult or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.automation.models.SoftwareUpdateConfigurationMachineRunListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfigurationMachineRunListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_runs_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_runs_operations.py new file mode 100644 index 000000000000..a377e25bcad4 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_runs_operations.py @@ -0,0 +1,190 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class SoftwareUpdateConfigurationRunsOperations(object): + """SoftwareUpdateConfigurationRunsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def get_by_id( + self, resource_group_name, automation_account_name, software_update_configuration_run_id, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Get a single software update configuration Run by Id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_run_id: The Id of the software + update configuration run. + :type software_update_configuration_run_id: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfigurationRun or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationRun + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_id.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationRunId': self._serialize.url("software_update_configuration_run_id", software_update_configuration_run_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfigurationRun', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_id.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId}'} + + def list( + self, resource_group_name, automation_account_name, client_request_id=None, filter=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Return list of software update configuration runs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param filter: The filter to apply on the operation. You can use the + following filters: 'properties/osType', 'properties/status', + 'properties/startTime', and + 'properties/softwareUpdateConfiguration/name' + :type filter: str + :param skip: Number of entries you skip before returning results + :type skip: str + :param top: Maximum number of entries returned in the results + collection + :type top: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfigurationRunListResult or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.automation.models.SoftwareUpdateConfigurationRunListResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfigurationRunListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configurations_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configurations_operations.py new file mode 100644 index 000000000000..8305a6b8ea2c --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configurations_operations.py @@ -0,0 +1,315 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class SoftwareUpdateConfigurationsOperations(object): + """SoftwareUpdateConfigurationsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def create( + self, resource_group_name, automation_account_name, software_update_configuration_name, parameters, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Create a new software update configuration with the name given in the + URI. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_name: The name of the software + update configuration to be created. + :type software_update_configuration_name: str + :param parameters: Request body. + :type parameters: + ~azure.mgmt.automation.models.SoftwareUpdateConfiguration + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationName': self._serialize.url("software_update_configuration_name", software_update_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 + body_content = self._serialize.body(parameters, 'SoftwareUpdateConfiguration') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfiguration', response) + if response.status_code == 201: + deserialized = self._deserialize('SoftwareUpdateConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'} + + def get_by_name( + self, resource_group_name, automation_account_name, software_update_configuration_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """Get a single software update configuration by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_name: The name of the software + update configuration to be created. + :type software_update_configuration_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationName': self._serialize.url("software_update_configuration_name", software_update_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'} + + def delete( + self, resource_group_name, automation_account_name, software_update_configuration_name, client_request_id=None, custom_headers=None, raw=False, **operation_config): + """delete a specific software update configuration. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param software_update_configuration_name: The name of the software + update configuration to be created. + :type software_update_configuration_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'softwareUpdateConfigurationName': self._serialize.url("software_update_configuration_name", software_update_configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'} + + def list( + self, resource_group_name, automation_account_name, client_request_id=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Get all software update configurations for the account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SoftwareUpdateConfigurationListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.automation.models.SoftwareUpdateConfigurationListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("client_request_id", client_request_id, 'str') + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SoftwareUpdateConfigurationListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_operations.py new file mode 100644 index 000000000000..c4d1caca2d00 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_operations.py @@ -0,0 +1,376 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class SourceControlOperations(object): + """SourceControlOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def create_or_update( + self, resource_group_name, automation_account_name, source_control_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param parameters: The parameters supplied to the create or update + source control operation. + :type parameters: + ~azure.mgmt.automation.models.SourceControlCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControl or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SourceControl or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'SourceControlCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SourceControl', response) + if response.status_code == 201: + deserialized = self._deserialize('SourceControl', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def update( + self, resource_group_name, automation_account_name, source_control_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param parameters: The parameters supplied to the update source + control operation. + :type parameters: + ~azure.mgmt.automation.models.SourceControlUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControl or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SourceControl or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'SourceControlUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SourceControl', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def delete( + self, resource_group_name, automation_account_name, source_control_name, custom_headers=None, raw=False, **operation_config): + """Delete the source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The name of source control. + :type source_control_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def get( + self, resource_group_name, automation_account_name, source_control_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the source control identified by source control name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The name of source control. + :type source_control_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControl or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SourceControl or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SourceControl', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of source controls. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SourceControl + :rtype: + ~azure.mgmt.automation.models.SourceControlPaged[~azure.mgmt.automation.models.SourceControl] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SourceControlPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_operations.py new file mode 100644 index 000000000000..95a9458fda3d --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_operations.py @@ -0,0 +1,258 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class SourceControlSyncJobOperations(object): + """SourceControlSyncJobOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def create( + self, resource_group_name, automation_account_name, source_control_name, source_control_sync_job_id, commit_id, custom_headers=None, raw=False, **operation_config): + """Creates the sync job for a source control. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :param commit_id: The commit id of the source control sync job. If not + syncing to a commitId, enter an empty string. + :type commit_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControlSyncJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJob or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.SourceControlSyncJobCreateParameters(commit_id=commit_id) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'SourceControlSyncJobCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('SourceControlSyncJob', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}'} + + def get( + self, resource_group_name, automation_account_name, source_control_name, source_control_sync_job_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the source control sync job identified by job id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControlSyncJobById or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJobById or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SourceControlSyncJobById', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, source_control_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of source control sync jobs. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SourceControlSyncJob + :rtype: + ~azure.mgmt.automation.models.SourceControlSyncJobPaged[~azure.mgmt.automation.models.SourceControlSyncJob] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SourceControlSyncJobPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_streams_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_streams_operations.py new file mode 100644 index 000000000000..8fc41d751fda --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_streams_operations.py @@ -0,0 +1,190 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class SourceControlSyncJobStreamsOperations(object): + """SourceControlSyncJobStreamsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-05-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-05-15-preview" + + self.config = config + + def list_by_sync_job( + self, resource_group_name, automation_account_name, source_control_name, source_control_sync_job_id, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of sync job streams identified by sync job id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SourceControlSyncJobStream + :rtype: + ~azure.mgmt.automation.models.SourceControlSyncJobStreamPaged[~azure.mgmt.automation.models.SourceControlSyncJobStream] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_sync_job.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SourceControlSyncJobStreamPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_sync_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams'} + + def get( + self, resource_group_name, automation_account_name, source_control_name, source_control_sync_job_id, stream_id, custom_headers=None, raw=False, **operation_config): + """Retrieve a sync job stream identified by stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param source_control_name: The source control name. + :type source_control_name: str + :param source_control_sync_job_id: The source control sync job id. + :type source_control_sync_job_id: str + :param stream_id: The id of the sync job stream. + :type stream_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControlSyncJobStreamById or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJobStreamById + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'sourceControlName': self._serialize.url("source_control_name", source_control_name, 'str'), + 'sourceControlSyncJobId': self._serialize.url("source_control_sync_job_id", source_control_sync_job_id, 'str'), + 'streamId': self._serialize.url("stream_id", stream_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SourceControlSyncJobStreamById', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams/{streamId}'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_statistics_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_statistics_operations.py new file mode 100644 index 000000000000..f28b9e991bc4 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_statistics_operations.py @@ -0,0 +1,114 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class StatisticsOperations(object): + """StatisticsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve the statistics for the account. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Statistics + :rtype: + ~azure.mgmt.automation.models.StatisticsPaged[~azure.mgmt.automation.models.Statistics] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.StatisticsPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/statistics'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_operations.py new file mode 100644 index 000000000000..5e2a24cb64b9 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_operations.py @@ -0,0 +1,342 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TestJobOperations(object): + """TestJobOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-06-30". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-30" + + self.config = config + + def create( + self, resource_group_name, automation_account_name, runbook_name, parameters=None, run_on=None, custom_headers=None, raw=False, **operation_config): + """Create a test job of the runbook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The parameters supplied to the create test job + operation. + :type runbook_name: str + :param parameters: Gets or sets the parameters of the test job. + :type parameters: dict[str, str] + :param run_on: Gets or sets the runOn which specifies the group name + where the job is to be executed. + :type run_on: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TestJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.TestJob or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters1 = models.TestJobCreateParameters(parameters=parameters, run_on=run_on) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters1, 'TestJobCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('TestJob', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob'} + + def get( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the test job for the specified runbook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TestJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.TestJob or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TestJob', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob'} + + def resume( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Resume the test job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.resume.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/resume'} + + def stop( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Stop the test job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/stop'} + + def suspend( + self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Suspend the test job. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.suspend.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/suspend'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_streams_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_streams_operations.py new file mode 100644 index 000000000000..52f9f5a4dd9c --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_streams_operations.py @@ -0,0 +1,184 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TestJobStreamsOperations(object): + """TestJobStreamsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-06-30". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-30" + + self.config = config + + def get( + self, resource_group_name, automation_account_name, runbook_name, job_stream_id, custom_headers=None, raw=False, **operation_config): + """Retrieve a test job stream of the test job identified by runbook name + and stream id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param job_stream_id: The job stream id. + :type job_stream_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: JobStream or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.JobStream or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str'), + 'jobStreamId': self._serialize.url("job_stream_id", job_stream_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobStream', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams/{jobStreamId}'} + + def list_by_test_job( + self, resource_group_name, automation_account_name, runbook_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of test job streams identified by runbook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param runbook_name: The runbook name. + :type runbook_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JobStream + :rtype: + ~azure.mgmt.automation.models.JobStreamPaged[~azure.mgmt.automation.models.JobStream] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_test_job.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.JobStreamPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_test_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_usages_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_usages_operations.py new file mode 100644 index 000000000000..2d193aba5e1b --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_usages_operations.py @@ -0,0 +1,110 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class UsagesOperations(object): + """UsagesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the usage for the account id. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Usage + :rtype: + ~azure.mgmt.automation.models.UsagePaged[~azure.mgmt.automation.models.Usage] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/usages'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_variable_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_variable_operations.py new file mode 100644 index 000000000000..a6e2522655e4 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_variable_operations.py @@ -0,0 +1,372 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class VariableOperations(object): + """VariableOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def create_or_update( + self, resource_group_name, automation_account_name, variable_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a variable. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param variable_name: The variable name. + :type variable_name: str + :param parameters: The parameters supplied to the create or update + variable operation. + :type parameters: + ~azure.mgmt.automation.models.VariableCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Variable or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Variable or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'VariableCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Variable', response) + if response.status_code == 201: + deserialized = self._deserialize('Variable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def update( + self, resource_group_name, automation_account_name, variable_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a variable. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param variable_name: The variable name. + :type variable_name: str + :param parameters: The parameters supplied to the update variable + operation. + :type parameters: + ~azure.mgmt.automation.models.VariableUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Variable or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Variable or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'VariableUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Variable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def delete( + self, resource_group_name, automation_account_name, variable_name, custom_headers=None, raw=False, **operation_config): + """Delete the variable. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param variable_name: The name of variable. + :type variable_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def get( + self, resource_group_name, automation_account_name, variable_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the variable identified by variable name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param variable_name: The name of variable. + :type variable_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Variable or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Variable or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'variableName': self._serialize.url("variable_name", variable_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Variable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of variables. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Variable + :rtype: + ~azure.mgmt.automation.models.VariablePaged[~azure.mgmt.automation.models.Variable] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.VariablePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_watcher_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_watcher_operations.py new file mode 100644 index 000000000000..ee47228d2e0f --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_watcher_operations.py @@ -0,0 +1,487 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class WatcherOperations(object): + """WatcherOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def create_or_update( + self, resource_group_name, automation_account_name, watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :param parameters: The create or update parameters for watcher. + :type parameters: ~azure.mgmt.automation.models.Watcher + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Watcher or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Watcher or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'Watcher') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Watcher', response) + if response.status_code == 201: + deserialized = self._deserialize('Watcher', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}'} + + def get( + self, resource_group_name, automation_account_name, watcher_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Watcher or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Watcher or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Watcher', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}'} + + def update( + self, resource_group_name, automation_account_name, watcher_name, execution_frequency_in_seconds=None, name=None, custom_headers=None, raw=False, **operation_config): + """Update the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :param execution_frequency_in_seconds: Gets or sets the frequency at + which the watcher is invoked. + :type execution_frequency_in_seconds: long + :param name: Gets or sets the name of the resource. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Watcher or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Watcher or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.WatcherUpdateParameters(execution_frequency_in_seconds=execution_frequency_in_seconds, name=name) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'WatcherUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Watcher', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}'} + + def delete( + self, resource_group_name, automation_account_name, watcher_name, custom_headers=None, raw=False, **operation_config): + """Delete the watcher by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}'} + + def start( + self, resource_group_name, automation_account_name, watcher_name, custom_headers=None, raw=False, **operation_config): + """Resume the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.start.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}/start'} + + def stop( + self, resource_group_name, automation_account_name, watcher_name, custom_headers=None, raw=False, **operation_config): + """Resume the watcher identified by watcher name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param watcher_name: The watcher name. + :type watcher_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'watcherName': self._serialize.url("watcher_name", watcher_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}/stop'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of watchers. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Watcher + :rtype: + ~azure.mgmt.automation.models.WatcherPaged[~azure.mgmt.automation.models.Watcher] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WatcherPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers'} diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_webhook_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_webhook_operations.py new file mode 100644 index 000000000000..c68899b4bf14 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_webhook_operations.py @@ -0,0 +1,433 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class WebhookOperations(object): + """WebhookOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-10-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-10-31" + + self.config = config + + def generate_uri( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Generates a Uri for use in creating a webhook. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.generate_uri.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + generate_uri.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri'} + + def delete( + self, resource_group_name, automation_account_name, webhook_name, custom_headers=None, raw=False, **operation_config): + """Delete the webhook by name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def get( + self, resource_group_name, automation_account_name, webhook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the webhook identified by webhook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Webhook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Webhook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Webhook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def create_or_update( + self, resource_group_name, automation_account_name, webhook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create the webhook identified by webhook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :param parameters: The create or update parameters for webhook. + :type parameters: + ~azure.mgmt.automation.models.WebhookCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Webhook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Webhook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'WebhookCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Webhook', response) + if response.status_code == 201: + deserialized = self._deserialize('Webhook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def update( + self, resource_group_name, automation_account_name, webhook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update the webhook identified by webhook name. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param webhook_name: The webhook name. + :type webhook_name: str + :param parameters: The update parameters for webhook. + :type parameters: + ~azure.mgmt.automation.models.WebhookUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Webhook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Webhook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'webhookName': self._serialize.url("webhook_name", webhook_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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: + header_parameters.update(custom_headers) + 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 + body_content = self._serialize.body(parameters, 'WebhookUpdateParameters') + + # Construct and send request + request = self._client.patch(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) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Webhook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'} + + def list_by_automation_account( + self, resource_group_name, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of webhooks. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param filter: The filter to apply on the operation. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Webhook + :rtype: + ~azure.mgmt.automation.models.WebhookPaged[~azure.mgmt.automation.models.Webhook] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_automation_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + 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 and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WebhookPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_automation_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks'}