diff --git a/azure-mgmt-automation/azure/mgmt/automation/__init__.py b/azure-mgmt-automation/azure/mgmt/automation/__init__.py new file mode 100644 index 000000000000..583531e6aca2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/__init__.py @@ -0,0 +1,18 @@ +# 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 .automation_client import AutomationClient +from .version import VERSION + +__all__ = ['AutomationClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-automation/azure/mgmt/automation/automation_client.py b/azure-mgmt-automation/azure/mgmt/automation/automation_client.py new file mode 100644 index 000000000000..4a18da92a74f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/automation_client.py @@ -0,0 +1,268 @@ +# 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 ServiceClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.automation_account_operations import AutomationAccountOperations +from .operations.operations import Operations +from .operations.statistics_operations import StatisticsOperations +from .operations.usages_operations import UsagesOperations +from .operations.certificate_operations import CertificateOperations +from .operations.connection_operations import ConnectionOperations +from .operations.connection_type_operations import ConnectionTypeOperations +from .operations.credential_operations import CredentialOperations +from .operations.dsc_compilation_job_operations import DscCompilationJobOperations +from .operations.dsc_configuration_operations import DscConfigurationOperations +from .operations.agent_registration_information_operations import AgentRegistrationInformationOperations +from .operations.dsc_node_operations import DscNodeOperations +from .operations.node_reports_operations import NodeReportsOperations +from .operations.dsc_node_configuration_operations import DscNodeConfigurationOperations +from .operations.hybrid_runbook_worker_group_operations import HybridRunbookWorkerGroupOperations +from .operations.job_operations import JobOperations +from .operations.job_stream_operations import JobStreamOperations +from .operations.job_schedule_operations import JobScheduleOperations +from .operations.activity_operations import ActivityOperations +from .operations.module_operations import ModuleOperations +from .operations.object_data_types_operations import ObjectDataTypesOperations +from .operations.fields_operations import FieldsOperations +from .operations.runbook_draft_operations import RunbookDraftOperations +from .operations.runbook_operations import RunbookOperations +from .operations.test_job_streams_operations import TestJobStreamsOperations +from .operations.test_jobs_operations import TestJobsOperations +from .operations.schedule_operations import ScheduleOperations +from .operations.variable_operations import VariableOperations +from .operations.webhook_operations import WebhookOperations +from .operations.software_update_configurations_operations import SoftwareUpdateConfigurationsOperations +from .operations.software_update_configuration_runs_operations import SoftwareUpdateConfigurationRunsOperations +from .operations.software_update_configuration_machine_runs_operations import SoftwareUpdateConfigurationMachineRunsOperations +from .operations.source_control_operations import SourceControlOperations +from .operations.source_control_sync_job_operations import SourceControlSyncJobOperations +from . import models + + +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 resource_group_name: The resource group name. + :type resource_group_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, resource_group_name, automation_account_name, client_request_id=None, 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 resource_group_name is None: + raise ValueError("Parameter 'resource_group_name' must not be None.") + if automation_account_name is None: + raise ValueError("Parameter 'automation_account_name' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(AutomationClientConfiguration, self).__init__(base_url) + + 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 + self.resource_group_name = resource_group_name + self.client_request_id = client_request_id + self.automation_account_name = automation_account_name + + +class AutomationClient(object): + """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 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_compilation_job: DscCompilationJob operations + :vartype dsc_compilation_job: azure.mgmt.automation.operations.DscCompilationJobOperations + :ivar dsc_configuration: DscConfiguration operations + :vartype dsc_configuration: azure.mgmt.automation.operations.DscConfigurationOperations + :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_node_configuration: DscNodeConfiguration operations + :vartype dsc_node_configuration: azure.mgmt.automation.operations.DscNodeConfigurationOperations + :ivar hybrid_runbook_worker_group: HybridRunbookWorkerGroup operations + :vartype hybrid_runbook_worker_group: azure.mgmt.automation.operations.HybridRunbookWorkerGroupOperations + :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 job_schedule: JobSchedule operations + :vartype job_schedule: azure.mgmt.automation.operations.JobScheduleOperations + :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 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_jobs: TestJobs operations + :vartype test_jobs: azure.mgmt.automation.operations.TestJobsOperations + :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 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 + + :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 resource_group_name: The resource group name. + :type resource_group_name: str + :param client_request_id: Identifies this specific client request. + :type client_request_id: str + :param automation_account_name: The name of the automation account. + :type automation_account_name: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, resource_group_name, automation_account_name, client_request_id=None, base_url=None): + + self.config = AutomationClientConfiguration(credentials, subscription_id, resource_group_name, automation_account_name, client_request_id, base_url) + self._client = ServiceClient(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.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_compilation_job = DscCompilationJobOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dsc_configuration = DscConfigurationOperations( + 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_node_configuration = DscNodeConfigurationOperations( + self._client, self.config, self._serialize, self._deserialize) + self.hybrid_runbook_worker_group = HybridRunbookWorkerGroupOperations( + 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.job_schedule = JobScheduleOperations( + 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.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_jobs = TestJobsOperations( + 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.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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py b/azure-mgmt-automation/azure/mgmt/automation/models/__init__.py new file mode 100644 index 000000000000..8f07551154df --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/__init__.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. +# -------------------------------------------------------------------------- + +from .error_response import ErrorResponse, ErrorResponseException +from .usage_counter_name import UsageCounterName +from .usage import Usage +from .statistics import Statistics +from .runbook_parameter import RunbookParameter +from .content_hash import ContentHash +from .content_link import ContentLink +from .runbook_draft import RunbookDraft +from .runbook import Runbook +from .module_error_info import ModuleErrorInfo +from .module import Module +from .dsc_node_extension_handler_association_property import DscNodeExtensionHandlerAssociationProperty +from .dsc_node_configuration_association_property import DscNodeConfigurationAssociationProperty +from .dsc_node import DscNode +from .content_source import ContentSource +from .dsc_configuration_parameter import DscConfigurationParameter +from .dsc_configuration import DscConfiguration +from .resource import Resource +from .sku import Sku +from .automation_account import AutomationAccount +from .operation_display import OperationDisplay +from .operation import Operation +from .automation_account_create_or_update_parameters import AutomationAccountCreateOrUpdateParameters +from .automation_account_update_parameters import AutomationAccountUpdateParameters +from .certificate import Certificate +from .certificate_update_parameters import CertificateUpdateParameters +from .certificate_create_or_update_parameters import CertificateCreateOrUpdateParameters +from .connection_type_association_property import ConnectionTypeAssociationProperty +from .connection import Connection +from .connection_update_parameters import ConnectionUpdateParameters +from .connection_create_or_update_parameters import ConnectionCreateOrUpdateParameters +from .field_definition import FieldDefinition +from .connection_type import ConnectionType +from .connection_type_create_or_update_parameters import ConnectionTypeCreateOrUpdateParameters +from .credential import Credential +from .credential_update_parameters import CredentialUpdateParameters +from .credential_create_or_update_parameters import CredentialCreateOrUpdateParameters +from .activity_parameter import ActivityParameter +from .activity_parameter_set import ActivityParameterSet +from .activity_output_type import ActivityOutputType +from .activity import Activity +from .advanced_schedule_monthly_occurrence import AdvancedScheduleMonthlyOccurrence +from .advanced_schedule import AdvancedSchedule +from .agent_registration_keys import AgentRegistrationKeys +from .agent_registration import AgentRegistration +from .agent_registration_regenerate_key_parameter import AgentRegistrationRegenerateKeyParameter +from .dsc_configuration_association_property import DscConfigurationAssociationProperty +from .dsc_compilation_job_create_parameters import DscCompilationJobCreateParameters +from .dsc_compilation_job import DscCompilationJob +from .dsc_configuration_create_or_update_parameters import DscConfigurationCreateOrUpdateParameters +from .dsc_meta_configuration import DscMetaConfiguration +from .dsc_node_configuration_create_or_update_parameters import DscNodeConfigurationCreateOrUpdateParameters +from .dsc_node_configuration import DscNodeConfiguration +from .dsc_node_update_parameters import DscNodeUpdateParameters +from .dsc_report_error import DscReportError +from .dsc_report_resource_navigation import DscReportResourceNavigation +from .dsc_report_resource import DscReportResource +from .dsc_node_report import DscNodeReport +from .hybrid_runbook_worker import HybridRunbookWorker +from .run_as_credential_association_property import RunAsCredentialAssociationProperty +from .hybrid_runbook_worker_group import HybridRunbookWorkerGroup +from .hybrid_runbook_worker_group_update_parameters import HybridRunbookWorkerGroupUpdateParameters +from .runbook_association_property import RunbookAssociationProperty +from .job import Job +from .job_create_parameters import JobCreateParameters +from .schedule_association_property import ScheduleAssociationProperty +from .job_schedule_create_parameters import JobScheduleCreateParameters +from .job_schedule import JobSchedule +from .job_stream import JobStream +from .module_create_or_update_parameters import ModuleCreateOrUpdateParameters +from .module_update_parameters import ModuleUpdateParameters +from .runbook_draft_undo_edit_result import RunbookDraftUndoEditResult +from .runbook_create_or_update_parameters import RunbookCreateOrUpdateParameters +from .runbook_create_or_update_draft_properties import RunbookCreateOrUpdateDraftProperties +from .runbook_create_or_update_draft_parameters import RunbookCreateOrUpdateDraftParameters +from .runbook_update_parameters import RunbookUpdateParameters +from .schedule_create_or_update_parameters import ScheduleCreateOrUpdateParameters +from .schedule_properties import ScheduleProperties +from .schedule import Schedule +from .schedule_update_parameters import ScheduleUpdateParameters +from .sub_resource import SubResource +from .test_job_create_parameters import TestJobCreateParameters +from .test_job import TestJob +from .type_field import TypeField +from .variable_create_or_update_parameters import VariableCreateOrUpdateParameters +from .variable import Variable +from .variable_update_parameters import VariableUpdateParameters +from .webhook_create_or_update_parameters import WebhookCreateOrUpdateParameters +from .webhook import Webhook +from .webhook_update_parameters import WebhookUpdateParameters +from .collection_item_update_configuration import CollectionItemUpdateConfiguration +from .software_update_configuration_collection_item import SoftwareUpdateConfigurationCollectionItem +from .software_update_configuration_list_result import SoftwareUpdateConfigurationListResult +from .linux_properties import LinuxProperties +from .windows_properties import WindowsProperties +from .update_configuration import UpdateConfiguration +from .software_update_configuration import SoftwareUpdateConfiguration +from .update_configuration_navigation import UpdateConfigurationNavigation +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_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_by_id_errors import SourceControlSyncJobByIdErrors +from .source_control_sync_job_by_id import SourceControlSyncJobById +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_compilation_job_paged import DscCompilationJobPaged +from .dsc_configuration_paged import DscConfigurationPaged +from .dsc_node_paged import DscNodePaged +from .dsc_node_report_paged import DscNodeReportPaged +from .dsc_node_configuration_paged import DscNodeConfigurationPaged +from .hybrid_runbook_worker_group_paged import HybridRunbookWorkerGroupPaged +from .job_paged import JobPaged +from .job_stream_paged import JobStreamPaged +from .job_schedule_paged import JobSchedulePaged +from .activity_paged import ActivityPaged +from .module_paged import ModulePaged +from .type_field_paged import TypeFieldPaged +from .runbook_paged import RunbookPaged +from .schedule_paged import SchedulePaged +from .variable_paged import VariablePaged +from .webhook_paged import WebhookPaged +from .source_control_paged import SourceControlPaged +from .source_control_sync_job_paged import SourceControlSyncJobPaged +from .automation_client_enums import ( + RunbookTypeEnum, + RunbookState, + RunbookProvisioningState, + ModuleProvisioningState, + ContentSourceType, + DscConfigurationProvisioningState, + DscConfigurationState, + SkuNameEnum, + AutomationAccountState, + ScheduleDay, + AgentRegistrationKeyName, + JobStatus, + JobStreamType, + HttpStatusCode, + ScheduleFrequency, + LinuxUpdateClasses, + WindowsUpdateClasses, + OperatingSystemType, + SourceType, + ProvisioningState, +) + +__all__ = [ + 'ErrorResponse', 'ErrorResponseException', + 'UsageCounterName', + 'Usage', + 'Statistics', + 'RunbookParameter', + 'ContentHash', + 'ContentLink', + 'RunbookDraft', + 'Runbook', + 'ModuleErrorInfo', + 'Module', + 'DscNodeExtensionHandlerAssociationProperty', + 'DscNodeConfigurationAssociationProperty', + 'DscNode', + 'ContentSource', + 'DscConfigurationParameter', + 'DscConfiguration', + 'Resource', + 'Sku', + 'AutomationAccount', + 'OperationDisplay', + 'Operation', + 'AutomationAccountCreateOrUpdateParameters', + 'AutomationAccountUpdateParameters', + 'Certificate', + 'CertificateUpdateParameters', + 'CertificateCreateOrUpdateParameters', + 'ConnectionTypeAssociationProperty', + 'Connection', + 'ConnectionUpdateParameters', + 'ConnectionCreateOrUpdateParameters', + 'FieldDefinition', + 'ConnectionType', + 'ConnectionTypeCreateOrUpdateParameters', + 'Credential', + 'CredentialUpdateParameters', + 'CredentialCreateOrUpdateParameters', + 'ActivityParameter', + 'ActivityParameterSet', + 'ActivityOutputType', + 'Activity', + 'AdvancedScheduleMonthlyOccurrence', + 'AdvancedSchedule', + 'AgentRegistrationKeys', + 'AgentRegistration', + 'AgentRegistrationRegenerateKeyParameter', + 'DscConfigurationAssociationProperty', + 'DscCompilationJobCreateParameters', + 'DscCompilationJob', + 'DscConfigurationCreateOrUpdateParameters', + 'DscMetaConfiguration', + 'DscNodeConfigurationCreateOrUpdateParameters', + 'DscNodeConfiguration', + 'DscNodeUpdateParameters', + 'DscReportError', + 'DscReportResourceNavigation', + 'DscReportResource', + 'DscNodeReport', + 'HybridRunbookWorker', + 'RunAsCredentialAssociationProperty', + 'HybridRunbookWorkerGroup', + 'HybridRunbookWorkerGroupUpdateParameters', + 'RunbookAssociationProperty', + 'Job', + 'JobCreateParameters', + 'ScheduleAssociationProperty', + 'JobScheduleCreateParameters', + 'JobSchedule', + 'JobStream', + 'ModuleCreateOrUpdateParameters', + 'ModuleUpdateParameters', + 'RunbookDraftUndoEditResult', + 'RunbookCreateOrUpdateParameters', + 'RunbookCreateOrUpdateDraftProperties', + 'RunbookCreateOrUpdateDraftParameters', + 'RunbookUpdateParameters', + 'ScheduleCreateOrUpdateParameters', + 'ScheduleProperties', + 'Schedule', + 'ScheduleUpdateParameters', + 'SubResource', + 'TestJobCreateParameters', + 'TestJob', + 'TypeField', + 'VariableCreateOrUpdateParameters', + 'Variable', + 'VariableUpdateParameters', + 'WebhookCreateOrUpdateParameters', + 'Webhook', + 'WebhookUpdateParameters', + 'CollectionItemUpdateConfiguration', + 'SoftwareUpdateConfigurationCollectionItem', + 'SoftwareUpdateConfigurationListResult', + 'LinuxProperties', + 'WindowsProperties', + 'UpdateConfiguration', + 'SoftwareUpdateConfiguration', + 'UpdateConfigurationNavigation', + 'SoftwareUpdateConfigurationRun', + 'SoftwareUpdateConfigurationRunListResult', + 'JobNavigation', + 'SoftwareUpdateConfigurationMachineRun', + 'SoftwareUpdateConfigurationMachineRunListResult', + 'SourceControl', + 'SourceControlUpdateParameters', + 'SourceControlCreateOrUpdateParameters', + 'SourceControlSyncJob', + 'SourceControlSyncJobByIdErrors', + 'SourceControlSyncJobById', + 'AutomationAccountPaged', + 'OperationPaged', + 'StatisticsPaged', + 'UsagePaged', + 'CertificatePaged', + 'ConnectionPaged', + 'ConnectionTypePaged', + 'CredentialPaged', + 'DscCompilationJobPaged', + 'DscConfigurationPaged', + 'DscNodePaged', + 'DscNodeReportPaged', + 'DscNodeConfigurationPaged', + 'HybridRunbookWorkerGroupPaged', + 'JobPaged', + 'JobStreamPaged', + 'JobSchedulePaged', + 'ActivityPaged', + 'ModulePaged', + 'TypeFieldPaged', + 'RunbookPaged', + 'SchedulePaged', + 'VariablePaged', + 'WebhookPaged', + 'SourceControlPaged', + 'SourceControlSyncJobPaged', + 'RunbookTypeEnum', + 'RunbookState', + 'RunbookProvisioningState', + 'ModuleProvisioningState', + 'ContentSourceType', + 'DscConfigurationProvisioningState', + 'DscConfigurationState', + 'SkuNameEnum', + 'AutomationAccountState', + 'ScheduleDay', + 'AgentRegistrationKeyName', + 'JobStatus', + 'JobStreamType', + 'HttpStatusCode', + 'ScheduleFrequency', + 'LinuxUpdateClasses', + 'WindowsUpdateClasses', + 'OperatingSystemType', + 'SourceType', + 'ProvisioningState', +] diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity.py new file mode 100644 index 000000000000..1ff41d5eb216 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, definition=None, parameter_sets=None, output_types=None, creation_time=None, last_modified_time=None, description=None): + super(Activity, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity_output_type.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity_output_type.py new file mode 100644 index 000000000000..3f7e1b1ebc79 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity_output_type.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, type=None): + super(ActivityOutputType, self).__init__() + self.name = name + self.type = type diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity_paged.py new file mode 100644 index 000000000000..2020f7cfa836 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter.py new file mode 100644 index 000000000000..dc52e9be4be9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +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: bool + :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 + """ + + _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': 'bool'}, + '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'}, + } + + def __init__(self, name=None, type=None, is_mandatory=None, is_dynamic=None, position=None, value_from_pipeline=None, value_from_pipeline_by_property_name=None, value_from_remaining_arguments=None): + super(ActivityParameter, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter_set.py b/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter_set.py new file mode 100644 index 000000000000..5d478a22facb --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/activity_parameter_set.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, parameters=None): + super(ActivityParameterSet, self).__init__() + self.name = name + self.parameters = parameters diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule.py b/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule.py new file mode 100644 index 000000000000..949b63aed170 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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): + super(AdvancedSchedule, self).__init__() + self.week_days = week_days + self.month_days = month_days + self.monthly_occurrences = monthly_occurrences diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule_monthly_occurrence.py b/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule_monthly_occurrence.py new file mode 100644 index 000000000000..e7efe9c378a1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/advanced_schedule_monthly_occurrence.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, day=None): + super(AdvancedScheduleMonthlyOccurrence, self).__init__() + self.occurrence = occurrence + self.day = day diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration.py b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration.py new file mode 100644 index 000000000000..11ea388ac79e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AgentRegistration(Model): + """Definition of the agent registration infomration 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=None, endpoint=None, keys=None, id=None): + super(AgentRegistration, self).__init__() + self.dsc_meta_configuration = dsc_meta_configuration + self.endpoint = endpoint + self.keys = keys + self.id = id diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_keys.py b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_keys.py new file mode 100644 index 000000000000..f08286d50033 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_keys.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, secondary=None): + super(AgentRegistrationKeys, self).__init__() + self.primary = primary + self.secondary = secondary diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_regenerate_key_parameter.py b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_regenerate_key_parameter.py new file mode 100644 index 000000000000..1cfb914bac5e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/agent_registration_regenerate_key_parameter.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AgentRegistrationRegenerateKeyParameter(Model): + """The parameters supplied to the regenerate keys operation. + + :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 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 = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, key_name, name=None, location=None, tags=None): + super(AgentRegistrationRegenerateKeyParameter, self).__init__() + self.key_name = key_name + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_account.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account.py new file mode 100644 index 000000000000..01edcf550a31 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account.py @@ -0,0 +1,82 @@ +# 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 .resource import Resource + + +class AutomationAccount(Resource): + """Definition of the automation account type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, 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}, + 'location': {'required': 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', '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, location, tags=None, sku=None, last_modified_by=None, description=None, etag=None): + super(AutomationAccount, self).__init__(location=location, tags=tags) + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_create_or_update_parameters.py new file mode 100644 index 000000000000..0518b0fde502 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_create_or_update_parameters.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, location=None, tags=None): + super(AutomationAccountCreateOrUpdateParameters, self).__init__() + self.sku = sku + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_paged.py new file mode 100644 index 000000000000..2ded30ea0c31 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_update_parameters.py new file mode 100644 index 000000000000..39aae93eb23f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_account_update_parameters.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, location=None, tags=None): + super(AutomationAccountUpdateParameters, self).__init__() + self.sku = sku + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/automation_client_enums.py b/azure-mgmt-automation/azure/mgmt/automation/models/automation_client_enums.py new file mode 100644 index 000000000000..0c9754602cbc --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/automation_client_enums.py @@ -0,0 +1,231 @@ +# 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 RunbookTypeEnum(Enum): + + script = "Script" + graph = "Graph" + power_shell_workflow = "PowerShellWorkflow" + power_shell = "PowerShell" + graph_power_shell_workflow = "GraphPowerShellWorkflow" + graph_power_shell = "GraphPowerShell" + + +class RunbookState(Enum): + + new = "New" + edit = "Edit" + published = "Published" + + +class RunbookProvisioningState(Enum): + + succeeded = "Succeeded" + + +class ModuleProvisioningState(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 ContentSourceType(Enum): + + embedded_content = "embeddedContent" + uri = "uri" + + +class DscConfigurationProvisioningState(Enum): + + succeeded = "Succeeded" + + +class DscConfigurationState(Enum): + + new = "New" + edit = "Edit" + published = "Published" + + +class SkuNameEnum(Enum): + + free = "Free" + basic = "Basic" + + +class AutomationAccountState(Enum): + + ok = "Ok" + unavailable = "Unavailable" + suspended = "Suspended" + + +class ScheduleDay(Enum): + + monday = "Monday" + tuesday = "Tuesday" + wednesday = "Wednesday" + thursday = "Thursday" + friday = "Friday" + saturday = "Saturday" + sunday = "Sunday" + + +class AgentRegistrationKeyName(Enum): + + primary = "Primary" + secondary = "Secondary" + + +class JobStatus(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 JobStreamType(Enum): + + progress = "Progress" + output = "Output" + warning = "Warning" + error = "Error" + debug = "Debug" + verbose = "Verbose" + any = "Any" + + +class HttpStatusCode(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 ScheduleFrequency(Enum): + + one_time = "OneTime" + day = "Day" + hour = "Hour" + week = "Week" + month = "Month" + + +class LinuxUpdateClasses(Enum): + + unclassified = "Unclassified" + critical = "Critical" + security = "Security" + other = "Other" + + +class WindowsUpdateClasses(Enum): + + unclassified = "Unclassified" + critical = "Critical" + security = "Security" + update_rollup = "UpdateRollup" + feature_pack = "FeaturePack" + service_pack = "ServicePack" + definition = "Definition" + tools = "Tools" + updates = "Updates" + + +class OperatingSystemType(Enum): + + windows = "Windows" + linux = "Linux" + + +class SourceType(Enum): + + vso_git = "VsoGit" + vso_tfvc = "VsoTfvc" + git_hub = "GitHub" + + +class ProvisioningState(Enum): + + succeeded = "Succeeded" + failed = "Failed" + running = "Running" diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/certificate.py b/azure-mgmt-automation/azure/mgmt/automation/models/certificate.py new file mode 100644 index 000000000000..39fbb98a84aa --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/certificate.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Certificate(Model): + """Definition of the certificate. + + 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 certificate. + :vartype name: 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}, + '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'}, + '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=None): + super(Certificate, self).__init__() + self.id = None + self.name = None + self.thumbprint = None + self.expiry_time = None + self.is_exportable = None + self.creation_time = None + self.last_modified_time = None + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/certificate_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_create_or_update_parameters.py new file mode 100644 index 000000000000..d3c1e9351573 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_create_or_update_parameters.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update or replace certificate + operation. + + :param name: Gets or sets the name of the certificate. + :type name: str + :param base64_value: 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, base64_value, description=None, thumbprint=None, is_exportable=None): + super(CertificateCreateOrUpdateParameters, self).__init__() + self.name = name + self.base64_value = base64_value + self.description = description + self.thumbprint = thumbprint + self.is_exportable = is_exportable diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/certificate_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_paged.py new file mode 100644 index 000000000000..bb13e8ce3b97 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/certificate_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_update_parameters.py new file mode 100644 index 000000000000..91c91a5c4968 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/certificate_update_parameters.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, name, description=None): + super(CertificateUpdateParameters, self).__init__() + self.name = name + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/collection_item_update_configuration.py b/azure-mgmt-automation/azure/mgmt/automation/models/collection_item_update_configuration.py new file mode 100644 index 000000000000..e56d70acff94 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/collection_item_update_configuration.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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): + super(CollectionItemUpdateConfiguration, self).__init__() + self.azure_virtual_machines = azure_virtual_machines + self.duration = duration diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection.py new file mode 100644 index 000000000000..2ea09a1610a7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Connection(Model): + """Definition of the connection. + + 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. + :vartype name: 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}, + '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'}, + '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=None): + super(Connection, self).__init__() + self.id = None + self.name = None + self.connection_type = connection_type + self.field_definition_values = None + self.creation_time = None + self.last_modified_time = None + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_create_or_update_parameters.py new file mode 100644 index 000000000000..57ea1095b86b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_create_or_update_parameters.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionCreateOrUpdateParameters(Model): + """The parameters supplied to the create or 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 connection_type: 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, connection_type, description=None, field_definition_values=None): + super(ConnectionCreateOrUpdateParameters, self).__init__() + self.name = name + self.description = description + self.connection_type = connection_type + self.field_definition_values = field_definition_values diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_paged.py new file mode 100644 index 000000000000..fcae5786fd0d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_type.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type.py new file mode 100644 index 000000000000..ac1f0ab8c99a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 + :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}, + 'field_definitions': {'readonly': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', '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=None, last_modified_time=None, description=None): + super(ConnectionType, self).__init__() + self.id = None + self.name = None + self.is_global = is_global + self.field_definitions = None + self.creation_time = None + self.last_modified_time = last_modified_time + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_association_property.py new file mode 100644 index 000000000000..e1f92d421bf2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_association_property.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None): + super(ConnectionTypeAssociationProperty, self).__init__() + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_create_or_update_parameters.py new file mode 100644 index 000000000000..6b2878927b90 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_create_or_update_parameters.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionTypeCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update connection type operation. + + :param name: 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: 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, field_definitions, is_global=None): + super(ConnectionTypeCreateOrUpdateParameters, self).__init__() + self.name = name + self.is_global = is_global + self.field_definitions = field_definitions diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_paged.py new file mode 100644 index 000000000000..1ffa5ec5f162 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_type_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/connection_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/connection_update_parameters.py new file mode 100644 index 000000000000..d05e97a5971d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/connection_update_parameters.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +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=None, description=None, field_definition_values=None): + super(ConnectionUpdateParameters, self).__init__() + self.name = name + self.description = description + self.field_definition_values = field_definition_values diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/content_hash.py b/azure-mgmt-automation/azure/mgmt/automation/models/content_hash.py new file mode 100644 index 000000000000..d06709b63cbc --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/content_hash.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ContentHash(Model): + """Definition of the runbook property type. + + :param algorithm: Gets or sets the content hash algorithm used to hash the + content. + :type algorithm: str + :param value: 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, value): + super(ContentHash, self).__init__() + self.algorithm = algorithm + self.value = value diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/content_link.py b/azure-mgmt-automation/azure/mgmt/automation/models/content_link.py new file mode 100644 index 000000000000..cb0a30eae01d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/content_link.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, content_hash=None, version=None): + super(ContentLink, self).__init__() + self.uri = uri + self.content_hash = content_hash + self.version = version diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/content_source.py b/azure-mgmt-automation/azure/mgmt/automation/models/content_source.py new file mode 100644 index 000000000000..c706b5f75efc --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/content_source.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, version=None): + super(ContentSource, self).__init__() + self.hash = hash + self.type = type + self.value = value + self.version = version diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/credential.py b/azure-mgmt-automation/azure/mgmt/automation/models/credential.py new file mode 100644 index 000000000000..c5ae1e8e14aa --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/credential.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Credential(Model): + """Definition of the credential. + + 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 + :param name: Gets the name of the credential. + :type name: 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}, + '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'}, + '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, name=None, description=None): + super(Credential, self).__init__() + self.id = None + self.name = name + self.user_name = None + self.creation_time = None + self.last_modified_time = None + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/credential_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/credential_create_or_update_parameters.py new file mode 100644 index 000000000000..6f8ec4b19083 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/credential_create_or_update_parameters.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CredentialCreateOrUpdateParameters(Model): + """The parameters supplied to the create or 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 + """ + + _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, user_name, password, description=None): + super(CredentialCreateOrUpdateParameters, self).__init__() + self.name = name + self.user_name = user_name + self.password = password + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/credential_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/credential_paged.py new file mode 100644 index 000000000000..75c5d852da17 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/credential_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/credential_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/credential_update_parameters.py new file mode 100644 index 000000000000..674dd933651d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/credential_update_parameters.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 + """ + + _validation = { + 'name': {'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, user_name=None, password=None, description=None): + super(CredentialUpdateParameters, self).__init__() + self.name = name + self.user_name = user_name + self.password = password + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job.py new file mode 100644 index 000000000000..091f3a5f8fe3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DscCompilationJob(Model): + """Definition of the Dsc Compilation job. + + 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 + :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 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}, + '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'}, + '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'}, + '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, status=None, status_details=None, parameters=None): + super(DscCompilationJob, self).__init__() + self.id = None + self.configuration = configuration + self.started_by = None + self.job_id = None + self.creation_time = None + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_create_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_create_parameters.py new file mode 100644 index 000000000000..6c98a5414eb1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_create_parameters.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DscCompilationJobCreateParameters(Model): + """The parameters supplied to the create compilation job operation. + + :param configuration: 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 new_node_configuration_build_version_required: If a new build + version of NodeConfiguration is required. + :type new_node_configuration_build_version_required: 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}'}, + 'new_node_configuration_build_version_required': {'key': 'properties.newNodeConfigurationBuildVersionRequired', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, configuration, parameters=None, new_node_configuration_build_version_required=None, name=None, location=None, tags=None): + super(DscCompilationJobCreateParameters, self).__init__() + self.configuration = configuration + self.parameters = parameters + self.new_node_configuration_build_version_required = new_node_configuration_build_version_required + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_paged.py new file mode 100644 index 000000000000..78ab64c92a77 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_compilation_job_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration.py new file mode 100644 index 000000000000..ac07b688daae --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration.py @@ -0,0 +1,93 @@ +# 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 .resource import Resource + + +class DscConfiguration(Resource): + """Definition of the configuration type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, 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 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}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', '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'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, location, tags=None, provisioning_state=None, job_count=None, parameters=None, source=None, state=None, log_verbose=None, creation_time=None, last_modified_time=None, description=None, etag=None): + super(DscConfiguration, self).__init__(location=location, tags=tags) + 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.description = description + self.etag = etag diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_association_property.py new file mode 100644 index 000000000000..176dfb9c18c0 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_association_property.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None): + super(DscConfigurationAssociationProperty, self).__init__() + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_create_or_update_parameters.py new file mode 100644 index 000000000000..21c747723470 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_create_or_update_parameters.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DscConfigurationCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update configuration operation. + + :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: 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=None, log_progress=None, parameters=None, description=None, name=None, location=None, tags=None): + super(DscConfigurationCreateOrUpdateParameters, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_paged.py new file mode 100644 index 000000000000..ff3e9a25d1d5 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_parameter.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_parameter.py new file mode 100644 index 000000000000..72f8f9d0c48a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_configuration_parameter.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 madatory 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=None, is_mandatory=None, position=None, default_value=None): + super(DscConfigurationParameter, self).__init__() + self.type = type + self.is_mandatory = is_mandatory + self.position = position + self.default_value = default_value diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_meta_configuration.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_meta_configuration.py new file mode 100644 index 000000000000..9e73c28ba8e7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_meta_configuration.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +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=None, reboot_node_if_needed=None, configuration_mode=None, action_after_reboot=None, certificate_id=None, refresh_frequency_mins=None, allow_module_overwrite=None): + super(DscMetaConfiguration, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node.py new file mode 100644 index 000000000000..6a954b75aca4 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node.py @@ -0,0 +1,88 @@ +# 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 .resource import Resource + + +class DscNode(Resource): + """Definition of the dsc node type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, 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 node_configuration: Gets or sets the configuration of the node. + :type node_configuration: + ~azure.mgmt.automation.models.DscNodeConfigurationAssociationProperty + :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 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}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'last_seen': {'key': 'lastSeen', 'type': 'iso-8601'}, + 'registration_time': {'key': 'registrationTime', 'type': 'iso-8601'}, + 'ip': {'key': 'ip', 'type': 'str'}, + 'account_id': {'key': 'accountId', 'type': 'str'}, + 'node_configuration': {'key': 'nodeConfiguration', 'type': 'DscNodeConfigurationAssociationProperty'}, + 'status': {'key': 'status', 'type': 'str'}, + 'node_id': {'key': 'nodeId', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'extension_handler': {'key': 'extensionHandler', 'type': '[DscNodeExtensionHandlerAssociationProperty]'}, + } + + def __init__(self, location, tags=None, last_seen=None, registration_time=None, ip=None, account_id=None, node_configuration=None, status=None, node_id=None, etag=None, extension_handler=None): + super(DscNode, self).__init__(location=location, tags=tags) + self.last_seen = last_seen + self.registration_time = registration_time + self.ip = ip + self.account_id = account_id + self.node_configuration = node_configuration + self.status = status + self.node_id = node_id + self.etag = etag + self.extension_handler = extension_handler diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration.py new file mode 100644 index 000000000000..88db191fcf6d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DscNodeConfiguration(Model): + """Definition of the dsc node configuration. + + :param name: Gets or sets the node configuration name. + :type name: 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 id: Gets or sets the id of the resource. + :type id: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'configuration': {'key': 'configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, name=None, last_modified_time=None, creation_time=None, configuration=None, id=None): + super(DscNodeConfiguration, self).__init__() + self.name = name + self.last_modified_time = last_modified_time + self.creation_time = creation_time + self.configuration = configuration + self.id = id diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_association_property.py new file mode 100644 index 000000000000..7f3061bead2b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_association_property.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DscNodeConfigurationAssociationProperty(Model): + """The dsc nodeconfiguration property associated with the entity. + + :param name: Gets or sets the name of the dsc nodeconfiguration. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, name=None): + super(DscNodeConfigurationAssociationProperty, self).__init__() + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_create_or_update_parameters.py new file mode 100644 index 000000000000..87665da540e5 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_create_or_update_parameters.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DscNodeConfigurationCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update node configuration + operation. + + :param source: Gets or sets the source. + :type source: ~azure.mgmt.automation.models.ContentSource + :param name: Gets or sets the type of the parameter. + :type name: str + :param configuration: Gets or sets the configuration of the node. + :type configuration: + ~azure.mgmt.automation.models.DscConfigurationAssociationProperty + :param new_node_configuration_build_version_required: If a new build + version of NodeConfiguration is required. + :type new_node_configuration_build_version_required: bool + """ + + _validation = { + 'source': {'required': True}, + 'name': {'required': True}, + 'configuration': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ContentSource'}, + 'name': {'key': 'name', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'DscConfigurationAssociationProperty'}, + 'new_node_configuration_build_version_required': {'key': 'newNodeConfigurationBuildVersionRequired', 'type': 'bool'}, + } + + def __init__(self, source, name, configuration, new_node_configuration_build_version_required=None): + super(DscNodeConfigurationCreateOrUpdateParameters, self).__init__() + self.source = source + self.name = name + self.configuration = configuration + self.new_node_configuration_build_version_required = new_node_configuration_build_version_required diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_paged.py new file mode 100644 index 000000000000..049da571883a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_configuration_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_extension_handler_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_extension_handler_association_property.py new file mode 100644 index 000000000000..e56fdb5e5edc --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_extension_handler_association_property.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, version=None): + super(DscNodeExtensionHandlerAssociationProperty, self).__init__() + self.name = name + self.version = version diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_paged.py new file mode 100644 index 000000000000..0a53a4874719 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report.py new file mode 100644 index 000000000000..613d8615443e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +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=None, report_id=None, status=None, refresh_mode=None, reboot_requested=None, report_format_version=None, configuration_version=None, id=None, errors=None, resources=None, meta_configuration=None, host_name=None, i_pv4_addresses=None, i_pv6_addresses=None, number_of_resources=None, raw_errors=None): + super(DscNodeReport, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report_paged.py new file mode 100644 index 000000000000..81a95f0c15a2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_report_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters.py new file mode 100644 index 000000000000..52d3e82c73a6 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_node_update_parameters.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 node_configuration: Gets or sets the configuration of the node. + :type node_configuration: + ~azure.mgmt.automation.models.DscNodeConfigurationAssociationProperty + """ + + _attribute_map = { + 'node_id': {'key': 'nodeId', 'type': 'str'}, + 'node_configuration': {'key': 'nodeConfiguration', 'type': 'DscNodeConfigurationAssociationProperty'}, + } + + def __init__(self, node_id=None, node_configuration=None): + super(DscNodeUpdateParameters, self).__init__() + self.node_id = node_id + self.node_configuration = node_configuration diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_error.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_error.py new file mode 100644 index 000000000000..fd7d091c879b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_error.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, resource_id=None, error_code=None, error_message=None, locale=None, error_details=None): + super(DscReportError, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource.py new file mode 100644 index 000000000000..0c2d3cfebcd7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, source_info=None, depends_on=None, module_name=None, module_version=None, resource_name=None, error=None, status=None, duration_in_seconds=None, start_date=None): + super(DscReportResource, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource_navigation.py b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource_navigation.py new file mode 100644 index 000000000000..30d8f9570a93 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/dsc_report_resource_navigation.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None): + super(DscReportResourceNavigation, self).__init__() + self.resource_id = resource_id diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/error_response.py b/azure-mgmt-automation/azure/mgmt/automation/models/error_response.py new file mode 100644 index 000000000000..9834b37071ce --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/error_response.py @@ -0,0 +1,45 @@ +# 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 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=None, message=None): + super(ErrorResponse, self).__init__() + 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/field_definition.py b/azure-mgmt-automation/azure/mgmt/automation/models/field_definition.py new file mode 100644 index 000000000000..dc53d93f43bc --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/field_definition.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FieldDefinition(Model): + """Definition of the connection fields. + + :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: 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, is_encrypted=None, is_optional=None): + super(FieldDefinition, self).__init__() + self.is_encrypted = is_encrypted + self.is_optional = is_optional + self.type = type diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker.py b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker.py new file mode 100644 index 000000000000..36e10615e0f0 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +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 + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ip': {'key': 'ip', 'type': 'str'}, + 'registration_time': {'key': 'registrationTime', 'type': 'iso-8601'}, + } + + def __init__(self, name=None, ip=None, registration_time=None): + super(HybridRunbookWorker, self).__init__() + self.name = name + self.ip = ip + self.registration_time = registration_time diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group.py b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group.py new file mode 100644 index 000000000000..142242b4f29b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'hybrid_runbook_workers': {'key': 'hybridRunbookWorkers', 'type': '[HybridRunbookWorker]'}, + 'credential': {'key': 'credential', 'type': 'RunAsCredentialAssociationProperty'}, + } + + def __init__(self, id=None, name=None, hybrid_runbook_workers=None, credential=None): + super(HybridRunbookWorkerGroup, self).__init__() + self.id = id + self.name = name + self.hybrid_runbook_workers = hybrid_runbook_workers + self.credential = credential diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_paged.py new file mode 100644 index 000000000000..0e13e4babe3b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_update_parameters.py new file mode 100644 index 000000000000..1358eea76584 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/hybrid_runbook_worker_group_update_parameters.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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): + super(HybridRunbookWorkerGroupUpdateParameters, self).__init__() + self.credential = credential diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job.py b/azure-mgmt-automation/azure/mgmt/automation/models/job.py new file mode 100644 index 000000000000..5433e56ea2c0 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Job(Model): + """Definition of the job. + + :param id: Gets or sets the id of the resource. + :type id: 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] + """ + + _attribute_map = { + 'id': {'key': 'id', '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}'}, + } + + def __init__(self, id=None, runbook=None, started_by=None, run_on=None, job_id=None, creation_time=None, status=None, status_details=None, start_time=None, end_time=None, exception=None, last_modified_time=None, last_status_modified_time=None, parameters=None): + super(Job, self).__init__() + self.id = id + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_create_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_create_parameters.py new file mode 100644 index 000000000000..52879fee68ab --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_create_parameters.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 + :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 = { + 'runbook': {'required': True}, + } + + _attribute_map = { + 'runbook': {'key': 'properties.runbook', 'type': 'RunbookAssociationProperty'}, + 'parameters': {'key': 'properties.parameters', 'type': '{str}'}, + 'run_on': {'key': 'properties.runOn', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, runbook, parameters=None, run_on=None, name=None, location=None, tags=None): + super(JobCreateParameters, self).__init__() + self.runbook = runbook + self.parameters = parameters + self.run_on = run_on + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_navigation.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_navigation.py new file mode 100644 index 000000000000..578dcd54efe6 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_navigation.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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): + super(JobNavigation, self).__init__() + self.id = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_paged.py new file mode 100644 index 000000000000..9e9730212179 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class JobPaged(Paged): + """ + A paging container for iterating over a list of :class:`Job ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Job]'} + } + + def __init__(self, *args, **kwargs): + + super(JobPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule.py new file mode 100644 index 000000000000..c934680ea80a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JobSchedule(Model): + """Definition of the job schedule. + + :param id: Gets or sets the id of the resource. + :type id: 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] + """ + + _attribute_map = { + 'id': {'key': 'id', '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, id=None, job_schedule_id=None, schedule=None, runbook=None, run_on=None, parameters=None): + super(JobSchedule, self).__init__() + self.id = id + self.job_schedule_id = job_schedule_id + self.schedule = schedule + self.runbook = runbook + self.run_on = run_on + self.parameters = parameters diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_create_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_create_parameters.py new file mode 100644 index 000000000000..47c6cb925071 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_create_parameters.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JobScheduleCreateParameters(Model): + """The parameters supplied to the create job schedule operation. + + :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 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=None, parameters=None): + super(JobScheduleCreateParameters, self).__init__() + self.schedule = schedule + self.runbook = runbook + self.run_on = run_on + self.parameters = parameters diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_paged.py new file mode 100644 index 000000000000..67dffa06782f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_schedule_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_stream.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream.py new file mode 100644 index 000000000000..3de6f9e25aa1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, job_stream_id=None, time=None, stream_type=None, stream_text=None, summary=None, value=None): + super(JobStream, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_paged.py new file mode 100644 index 000000000000..23a2b0883111 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/job_stream_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/linux_properties.py b/azure-mgmt-automation/azure/mgmt/automation/models/linux_properties.py new file mode 100644 index 000000000000..0157b1d3bcd9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/linux_properties.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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] + """ + + _attribute_map = { + 'included_package_classifications': {'key': 'includedPackageClassifications', 'type': 'str'}, + 'excluded_package_name_masks': {'key': 'excludedPackageNameMasks', 'type': '[str]'}, + } + + def __init__(self, included_package_classifications=None, excluded_package_name_masks=None): + super(LinuxProperties, self).__init__() + self.included_package_classifications = included_package_classifications + self.excluded_package_name_masks = excluded_package_name_masks diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module.py b/azure-mgmt-automation/azure/mgmt/automation/models/module.py new file mode 100644 index 000000000000..dd5a5cc7ed81 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module.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. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Module(Resource): + """Definition of the module type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, 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 etag: Gets or sets the etag of the resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', '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'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, location, tags=None, is_global=None, version=None, size_in_bytes=None, activity_count=None, provisioning_state=None, content_link=None, error=None, creation_time=None, last_modified_time=None, description=None, etag=None): + super(Module, self).__init__(location=location, tags=tags) + 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.etag = etag diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/module_create_or_update_parameters.py new file mode 100644 index 000000000000..2195a264c752 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module_create_or_update_parameters.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ModuleCreateOrUpdateParameters(Model): + """The parameters supplied to the create or 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] + """ + + _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=None, location=None, tags=None): + super(ModuleCreateOrUpdateParameters, self).__init__() + self.content_link = content_link + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module_error_info.py b/azure-mgmt-automation/azure/mgmt/automation/models/module_error_info.py new file mode 100644 index 000000000000..cbff961377c3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module_error_info.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, message=None): + super(ModuleErrorInfo, self).__init__() + self.code = code + self.message = message diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/module_paged.py new file mode 100644 index 000000000000..f0ef5b2596c3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/module_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/module_update_parameters.py new file mode 100644 index 000000000000..dfff9870e082 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/module_update_parameters.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, location=None, tags=None): + super(ModuleUpdateParameters, self).__init__() + self.content_link = content_link + self.name = name + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/operation.py b/azure-mgmt-automation/azure/mgmt/automation/models/operation.py new file mode 100644 index 000000000000..fe51878b8c54 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/operation.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, display=None): + super(Operation, self).__init__() + self.name = name + self.display = display diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/operation_display.py b/azure-mgmt-automation/azure/mgmt/automation/models/operation_display.py new file mode 100644 index 000000000000..1837b2248e44 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/operation_display.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +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=None, resource=None, operation=None): + super(OperationDisplay, self).__init__() + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/operation_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/operation_paged.py new file mode 100644 index 000000000000..54f994c4bc4c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/operation_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/resource.py b/azure-mgmt-automation/azure/mgmt/automation/models/resource.py new file mode 100644 index 000000000000..cbe8d5ab6585 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/resource.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """The Resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, location, tags=None): + super(Resource, self).__init__() + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/run_as_credential_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/run_as_credential_association_property.py new file mode 100644 index 000000000000..bbd88025324b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/run_as_credential_association_property.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None): + super(RunAsCredentialAssociationProperty, self).__init__() + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook.py new file mode 100644 index 000000000000..c609c309c3d9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook.py @@ -0,0 +1,121 @@ +# 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 .resource import Resource + + +class Runbook(Resource): + """Definition of the runbook type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, 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}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', '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, location, tags=None, runbook_type=None, publish_content_link=None, state=None, log_verbose=None, log_progress=None, log_activity_trace=None, job_count=None, parameters=None, output_types=None, draft=None, provisioning_state=None, last_modified_by=None, creation_time=None, last_modified_time=None, description=None, etag=None): + super(Runbook, self).__init__(location=location, tags=tags) + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_association_property.py new file mode 100644 index 000000000000..41894249b624 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_association_property.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None): + super(RunbookAssociationProperty, self).__init__() + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_parameters.py new file mode 100644 index 000000000000..cc11f3e40d0f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_parameters.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RunbookCreateOrUpdateDraftParameters(Model): + """The parameters supplied to the create or update runbook operation. + + :param runbook_content: 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): + super(RunbookCreateOrUpdateDraftParameters, self).__init__() + self.runbook_content = runbook_content diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_properties.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_properties.py new file mode 100644 index 000000000000..b086d06c2d2b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_draft_properties.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RunbookCreateOrUpdateDraftProperties(Model): + """The parameters supplied to the create or update dratft runbook properties. + + :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: 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 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=None, log_progress=None, description=None, log_activity_trace=None): + super(RunbookCreateOrUpdateDraftProperties, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_parameters.py new file mode 100644 index 000000000000..c18af0bbe406 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_create_or_update_parameters.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RunbookCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update runbook operation. + + :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: 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=None, log_progress=None, draft=None, publish_content_link=None, description=None, log_activity_trace=None, name=None, location=None, tags=None): + super(RunbookCreateOrUpdateParameters, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft.py new file mode 100644 index 000000000000..7f0449300a3b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft.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 msrest.serialization import Model + + +class RunbookDraft(Model): + """Definition of the runbook type. + + :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=None, draft_content_link=None, creation_time=None, last_modified_time=None, parameters=None, output_types=None): + super(RunbookDraft, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result.py new file mode 100644 index 000000000000..79311a873a77 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_draft_undo_edit_result.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RunbookDraftUndoEditResult(Model): + """The response model for the undoedit 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': 'HttpStatusCode'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + } + + def __init__(self, status_code=None, request_id=None): + super(RunbookDraftUndoEditResult, self).__init__() + self.status_code = status_code + self.request_id = request_id diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_paged.py new file mode 100644 index 000000000000..d17b5bda87ba --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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/azure-mgmt-automation/azure/mgmt/automation/models/runbook_parameter.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_parameter.py new file mode 100644 index 000000000000..6bc6a70c0387 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_parameter.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 madatory 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=None, is_mandatory=None, position=None, default_value=None): + super(RunbookParameter, self).__init__() + self.type = type + self.is_mandatory = is_mandatory + self.position = position + self.default_value = default_value diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/runbook_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_update_parameters.py new file mode 100644 index 000000000000..c09dc31e114e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/runbook_update_parameters.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, log_verbose=None, log_progress=None, log_activity_trace=None, name=None, location=None, tags=None): + super(RunbookUpdateParameters, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule.py new file mode 100644 index 000000000000..3f6844979b78 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule.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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Schedule(Model): + """Definition of the schedule. + + 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 + :param name: Gets or sets the name of the schedule. + :type name: 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: object + :param frequency: Gets or sets the frequency of the schedule. Possible + values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + :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 = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', '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': 'object'}, + '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, id=None, name=None, start_time=None, expiry_time=None, expiry_time_offset_minutes=None, is_enabled=False, next_run=None, next_run_offset_minutes=None, interval=None, frequency=None, time_zone=None, advanced_schedule=None, creation_time=None, last_modified_time=None, description=None): + super(Schedule, self).__init__() + self.id = id + self.name = name + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_association_property.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_association_property.py new file mode 100644 index 000000000000..6c15a59b4cde --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_association_property.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None): + super(ScheduleAssociationProperty, self).__init__() + self.name = name diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_create_or_update_parameters.py new file mode 100644 index 000000000000..b2fd80dedeb5 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_create_or_update_parameters.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ScheduleCreateOrUpdateParameters(Model): + """The parameters supplied to the create or 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 start_time: 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: Possible values include: 'OneTime', 'Day', 'Hour', + 'Week', 'Month' + :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, start_time, frequency, description=None, expiry_time=None, interval=None, time_zone=None, advanced_schedule=None): + super(ScheduleCreateOrUpdateParameters, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_paged.py new file mode 100644 index 000000000000..a19b966390c9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_properties.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_properties.py new file mode 100644 index 000000000000..5e3854eb5d56 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_properties.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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: object + :param frequency: Gets or sets the frequency of the schedule. Possible + values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + :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': 'object'}, + '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=None, is_enabled=False, next_run=None, next_run_offset_minutes=None, interval=None, frequency=None, time_zone=None, advanced_schedule=None, creation_time=None, last_modified_time=None, description=None): + super(ScheduleProperties, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/schedule_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_update_parameters.py new file mode 100644 index 000000000000..84ca43d8062f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/schedule_update_parameters.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__(self, name, description=None, is_enabled=None): + super(ScheduleUpdateParameters, self).__init__() + self.name = name + self.description = description + self.is_enabled = is_enabled diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/sku.py b/azure-mgmt-automation/azure/mgmt/automation/models/sku.py new file mode 100644 index 000000000000..6589e17e5e80 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/sku.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """The account SKU. + + :param name: 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=None, capacity=None): + super(Sku, self).__init__() + self.name = name + self.family = family + self.capacity = capacity diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration.py new file mode 100644 index 000000000000..893ec812ca57 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SoftwareUpdateConfiguration(Model): + """Software update configuration properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar id: Resource Id. + :vartype id: str + :ivar type: Resource type + :vartype type: str + :param update_configuration: update specific properties for the Software + update configuration + :type update_configuration: + ~azure.mgmt.automation.models.UpdateConfiguration + :param schedule_info: 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: detailes of provisioning error + :type error: ~azure.mgmt.automation.models.ErrorResponse + :ivar creation_time: Creation time of theresource, 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 + """ + + _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'}, + } + + def __init__(self, update_configuration, schedule_info, error=None): + super(SoftwareUpdateConfiguration, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_collection_item.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_collection_item.py new file mode 100644 index 000000000000..8403a11a5d84 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_collection_item.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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' + :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): + super(SoftwareUpdateConfigurationCollectionItem, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_list_result.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_list_result.py new file mode 100644 index 000000000000..48060c028f53 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_list_result.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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): + super(SoftwareUpdateConfigurationListResult, self).__init__() + self.value = value diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run.py new file mode 100644 index 000000000000..630238cb391b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 theresource, 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 + """ + + _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'}, + } + + def __init__(self, software_update_configuration=None, job=None): + super(SoftwareUpdateConfigurationMachineRun, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run_list_result.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run_list_result.py new file mode 100644 index 000000000000..99941ec539bf --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_machine_run_list_result.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None): + super(SoftwareUpdateConfigurationMachineRunListResult, self).__init__() + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run.py new file mode 100644 index 000000000000..9f7117d3ae9a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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: Etart 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 theresource, 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 + """ + + _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'}, + } + + def __init__(self, software_update_configuration=None): + super(SoftwareUpdateConfigurationRun, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run_list_result.py b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run_list_result.py new file mode 100644 index 000000000000..84ef0b940fb6 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/software_update_configuration_run_list_result.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None): + super(SoftwareUpdateConfigurationRunListResult, self).__init__() + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control.py new file mode 100644 index 000000000000..0d634777c7e4 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceControl(Model): + """Definition of the source control. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar id: Resource Id. + :vartype id: str + :ivar type: Resource type. + :vartype type: str + :param repo_url: Gets or sets the repo url of the source control. + :type repo_url: str + :param branch: Gets or sets the repo branch of the source control. Include + branch as empty string for VsoTfvc. + :type branch: str + :param folder_path: Gets or sets the folder path of the source control. + :type folder_path: str + :param auto_sync: Gets or sets auto async of the source control. Default + is false. + :type auto_sync: bool + :param publish_runbook: Gets or sets 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: Gets or sets the description. + :type description: 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 + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', '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=None, branch=None, folder_path=None, auto_sync=None, publish_runbook=None, source_type=None, description=None, creation_time=None, last_modified_time=None): + super(SourceControl, self).__init__() + self.name = None + self.id = None + self.type = None + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_create_or_update_parameters.py new file mode 100644 index 000000000000..cb2611af827a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_create_or_update_parameters.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceControlCreateOrUpdateParameters(Model): + """The parameters supplied to the create or update source control operation. + + :param repo_url: Gets or sets the repo url of the source control. + :type repo_url: str + :param branch: Gets or sets the repo branch of the source control. Include + branch as empty string for VsoTfvc. + :type branch: str + :param folder_path: Gets or sets the folder path of the source control. + Path must be relative. + :type folder_path: str + :param auto_sync: Gets or sets auto async of the source control. Default + is false. + :type auto_sync: bool + :param publish_runbook: Gets or sets 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: Gets or sets the authorization token for the repo + of the source control. + :type security_token: str + :param description: Gets or sets 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}, + 'security_token': {'max_length': 1024}, + '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': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, repo_url=None, branch=None, folder_path=None, auto_sync=None, publish_runbook=None, source_type=None, security_token=None, description=None): + super(SourceControlCreateOrUpdateParameters, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_paged.py new file mode 100644 index 000000000000..bf214640dd4e --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job.py new file mode 100644 index 000000000000..7b229deb95c8 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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: Gets the source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: Gets the creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: Gets the provisioning state of the job. + Possible values include: 'Succeeded', 'Failed', 'Running' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ProvisioningState + :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 + :param started_by: Gets the user who started the sync job. + :type started_by: str + """ + + _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'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + } + + def __init__(self, source_control_sync_job_id=None, provisioning_state=None, started_by=None): + super(SourceControlSyncJob, self).__init__() + 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.started_by = started_by diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id.py new file mode 100644 index 000000000000..89ce762286d1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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: Gets the id of the job. + :type id: str + :param source_control_sync_job_id: Gets the source control sync job id. + :type source_control_sync_job_id: str + :ivar creation_time: Gets the creation time of the job. + :vartype creation_time: datetime + :param provisioning_state: Gets the provisioning state of the job. + Possible values include: 'Succeeded', 'Failed', 'Running' + :type provisioning_state: str or + ~azure.mgmt.automation.models.ProvisioningState + :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 + :param started_by: Gets the user who started the sync job. + :type started_by: str + :param errors: Error details of the source control sync job. + :type errors: ~azure.mgmt.automation.models.SourceControlSyncJobByIdErrors + """ + + _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'}, + 'started_by': {'key': 'properties.startedBy', 'type': 'str'}, + 'errors': {'key': 'properties.errors', 'type': 'SourceControlSyncJobByIdErrors'}, + } + + def __init__(self, id=None, source_control_sync_job_id=None, provisioning_state=None, started_by=None, errors=None): + super(SourceControlSyncJobById, self).__init__() + 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.started_by = started_by + self.errors = errors diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id_errors.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id_errors.py new file mode 100644 index 000000000000..ea2f7161d272 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_by_id_errors.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceControlSyncJobByIdErrors(Model): + """Error details of the source control sync job. + + :param code: Gets the error code for the job. + :type code: str + :param message: Gets the error message for the job. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, code=None, message=None): + super(SourceControlSyncJobByIdErrors, self).__init__() + self.code = code + self.message = message diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_paged.py new file mode 100644 index 000000000000..db7622ff89a7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_sync_job_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/source_control_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_update_parameters.py new file mode 100644 index 000000000000..7cacc8d88618 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/source_control_update_parameters.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SourceControlUpdateParameters(Model): + """The parameters supplied to the update source control operation. + + :param branch: Gets or sets the repo branch of the source control. + :type branch: str + :param folder_path: Gets or sets the folder path of the source control. + Path must be relative. + :type folder_path: str + :param auto_sync: Gets or sets auto async of the source control. Default + is false. + :type auto_sync: bool + :param publish_runbook: Gets or sets the auto publish of the source + control. Default is true. + :type publish_runbook: bool + :param security_token: Gets or sets the authorization token for the repo + of the source control. + :type security_token: str + :param description: Gets or sets 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': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, branch=None, folder_path=None, auto_sync=None, publish_runbook=None, security_token=None, description=None): + super(SourceControlUpdateParameters, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/statistics.py b/azure-mgmt-automation/azure/mgmt/automation/models/statistics.py new file mode 100644 index 000000000000..c88e4aa78279 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/statistics.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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): + super(Statistics, self).__init__() + self.counter_property = None + self.counter_value = None + self.start_time = None + self.end_time = None + self.id = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/statistics_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/statistics_paged.py new file mode 100644 index 000000000000..64b736569df9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/statistics_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/sub_resource.py b/azure-mgmt-automation/azure/mgmt/automation/models/sub_resource.py new file mode 100644 index 000000000000..10b105bbb584 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/sub_resource.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """The Sub Resource definition. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, id=None): + super(SubResource, self).__init__() + self.id = id diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/test_job.py b/azure-mgmt-automation/azure/mgmt/automation/models/test_job.py new file mode 100644 index 000000000000..c54ca980cbf7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/test_job.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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] + """ + + _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}'}, + } + + def __init__(self, creation_time=None, status=None, status_details=None, run_on=None, start_time=None, end_time=None, exception=None, last_modified_time=None, last_status_modified_time=None, parameters=None): + super(TestJob, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/test_job_create_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/test_job_create_parameters.py new file mode 100644 index 000000000000..d614c236de9d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/test_job_create_parameters.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TestJobCreateParameters(Model): + """The parameters supplied to the create test job operation. + + :param runbook_name: Gets or sets the runbook name. + :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 + """ + + _validation = { + 'runbook_name': {'required': True}, + } + + _attribute_map = { + 'runbook_name': {'key': 'runbookName', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'run_on': {'key': 'runOn', 'type': 'str'}, + } + + def __init__(self, runbook_name, parameters=None, run_on=None): + super(TestJobCreateParameters, self).__init__() + self.runbook_name = runbook_name + self.parameters = parameters + self.run_on = run_on diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/type_field.py b/azure-mgmt-automation/azure/mgmt/automation/models/type_field.py new file mode 100644 index 000000000000..95f557d1a564 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/type_field.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, type=None): + super(TypeField, self).__init__() + self.name = name + self.type = type diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/type_field_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/type_field_paged.py new file mode 100644 index 000000000000..70c9702982e5 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/type_field_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration.py b/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration.py new file mode 100644 index 000000000000..813b73280c68 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UpdateConfiguration(Model): + """Update specifc properties of the software update configuration. + + :param operating_system: 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] + """ + + _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]'}, + } + + def __init__(self, operating_system, windows=None, linux=None, duration=None, azure_virtual_machines=None, non_azure_computer_names=None): + super(UpdateConfiguration, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration_navigation.py b/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration_navigation.py new file mode 100644 index 000000000000..d3439daf96f3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/update_configuration_navigation.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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): + super(UpdateConfigurationNavigation, self).__init__() + self.name = None diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/usage.py b/azure-mgmt-automation/azure/mgmt/automation/models/usage.py new file mode 100644 index 000000000000..573351e72087 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/usage.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, name=None, unit=None, current_value=None, limit=None, throttle_status=None): + super(Usage, self).__init__() + self.id = id + self.name = name + self.unit = unit + self.current_value = current_value + self.limit = limit + self.throttle_status = throttle_status diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/usage_counter_name.py b/azure-mgmt-automation/azure/mgmt/automation/models/usage_counter_name.py new file mode 100644 index 000000000000..21651edf6965 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/usage_counter_name.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, localized_value=None): + super(UsageCounterName, self).__init__() + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/usage_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/usage_paged.py new file mode 100644 index 000000000000..72d2f0a2d170 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/usage_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/variable.py b/azure-mgmt-automation/azure/mgmt/automation/models/variable.py new file mode 100644 index 000000000000..47aaa6561ed3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/variable.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Variable(Model): + """Definition of the varible. + + :param id: Gets or sets the id of the resource. + :type id: str + :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 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 + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', '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, id=None, name=None, value=None, is_encrypted=None, creation_time=None, last_modified_time=None, description=None): + super(Variable, self).__init__() + self.id = id + self.name = name + self.value = value + self.is_encrypted = is_encrypted + self.creation_time = creation_time + self.last_modified_time = last_modified_time + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/variable_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/variable_create_or_update_parameters.py new file mode 100644 index 000000000000..601552827f38 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/variable_create_or_update_parameters.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VariableCreateOrUpdateParameters(Model): + """The parameters supplied to the create or 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 + :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, value=None, description=None, is_encrypted=None): + super(VariableCreateOrUpdateParameters, self).__init__() + self.name = name + self.value = value + self.description = description + self.is_encrypted = is_encrypted diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/variable_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/variable_paged.py new file mode 100644 index 000000000000..8e3f82c98cba --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/variable_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/variable_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/variable_update_parameters.py new file mode 100644 index 000000000000..01382a03e625 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/variable_update_parameters.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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 + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, name, value=None, description=None): + super(VariableUpdateParameters, self).__init__() + self.name = name + self.value = value + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/webhook.py b/azure-mgmt-automation/azure/mgmt/automation/models/webhook.py new file mode 100644 index 000000000000..de6e7e5ea78d --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/webhook.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Webhook(Model): + """Definition of the webhook type. + + :param id: Gets or sets the id of the resource. + :type id: str + :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 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 description: Gets or sets the description. + :type description: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + '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'}, + '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'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__(self, id=None, name=None, is_enabled=False, uri=None, expiry_time=None, last_invoked_time=None, parameters=None, runbook=None, run_on=None, creation_time=None, last_modified_time=None, description=None): + super(Webhook, self).__init__() + self.id = id + self.name = name + 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.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/webhook_create_or_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_create_or_update_parameters.py new file mode 100644 index 000000000000..2acafb27e1a3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_create_or_update_parameters.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WebhookCreateOrUpdateParameters(Model): + """The parameters supplied to the create or 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 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, is_enabled=None, uri=None, expiry_time=None, parameters=None, runbook=None, run_on=None): + super(WebhookCreateOrUpdateParameters, self).__init__() + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/webhook_paged.py b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_paged.py new file mode 100644 index 000000000000..40429a9dd160 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class 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) diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/webhook_update_parameters.py b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_update_parameters.py new file mode 100644 index 000000000000..b3b5fc235c10 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/webhook_update_parameters.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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=None, is_enabled=None, run_on=None, parameters=None, description=None): + super(WebhookUpdateParameters, self).__init__() + self.name = name + self.is_enabled = is_enabled + self.run_on = run_on + self.parameters = parameters + self.description = description diff --git a/azure-mgmt-automation/azure/mgmt/automation/models/windows_properties.py b/azure-mgmt-automation/azure/mgmt/automation/models/windows_properties.py new file mode 100644 index 000000000000..8c357abac2a7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/models/windows_properties.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class 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] + """ + + _attribute_map = { + 'included_update_classifications': {'key': 'includedUpdateClassifications', 'type': 'str'}, + 'excluded_kb_numbers': {'key': 'excludedKbNumbers', 'type': '[str]'}, + } + + def __init__(self, included_update_classifications=None, excluded_kb_numbers=None): + super(WindowsProperties, self).__init__() + self.included_update_classifications = included_update_classifications + self.excluded_kb_numbers = excluded_kb_numbers diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py b/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py new file mode 100644 index 000000000000..915e99f7c5ba --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/__init__.py @@ -0,0 +1,82 @@ +# 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 .automation_account_operations import AutomationAccountOperations +from .operations import Operations +from .statistics_operations import StatisticsOperations +from .usages_operations import UsagesOperations +from .certificate_operations import CertificateOperations +from .connection_operations import ConnectionOperations +from .connection_type_operations import ConnectionTypeOperations +from .credential_operations import CredentialOperations +from .dsc_compilation_job_operations import DscCompilationJobOperations +from .dsc_configuration_operations import DscConfigurationOperations +from .agent_registration_information_operations import AgentRegistrationInformationOperations +from .dsc_node_operations import DscNodeOperations +from .node_reports_operations import NodeReportsOperations +from .dsc_node_configuration_operations import DscNodeConfigurationOperations +from .hybrid_runbook_worker_group_operations import HybridRunbookWorkerGroupOperations +from .job_operations import JobOperations +from .job_stream_operations import JobStreamOperations +from .job_schedule_operations import JobScheduleOperations +from .activity_operations import ActivityOperations +from .module_operations import ModuleOperations +from .object_data_types_operations import ObjectDataTypesOperations +from .fields_operations import FieldsOperations +from .runbook_draft_operations import RunbookDraftOperations +from .runbook_operations import RunbookOperations +from .test_job_streams_operations import TestJobStreamsOperations +from .test_jobs_operations import TestJobsOperations +from .schedule_operations import ScheduleOperations +from .variable_operations import VariableOperations +from .webhook_operations import WebhookOperations +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 + +__all__ = [ + 'AutomationAccountOperations', + 'Operations', + 'StatisticsOperations', + 'UsagesOperations', + 'CertificateOperations', + 'ConnectionOperations', + 'ConnectionTypeOperations', + 'CredentialOperations', + 'DscCompilationJobOperations', + 'DscConfigurationOperations', + 'AgentRegistrationInformationOperations', + 'DscNodeOperations', + 'NodeReportsOperations', + 'DscNodeConfigurationOperations', + 'HybridRunbookWorkerGroupOperations', + 'JobOperations', + 'JobStreamOperations', + 'JobScheduleOperations', + 'ActivityOperations', + 'ModuleOperations', + 'ObjectDataTypesOperations', + 'FieldsOperations', + 'RunbookDraftOperations', + 'RunbookOperations', + 'TestJobStreamsOperations', + 'TestJobsOperations', + 'ScheduleOperations', + 'VariableOperations', + 'WebhookOperations', + 'SoftwareUpdateConfigurationsOperations', + 'SoftwareUpdateConfigurationRunsOperations', + 'SoftwareUpdateConfigurationMachineRunsOperations', + 'SourceControlOperations', + 'SourceControlSyncJobOperations', +] diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/activity_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/activity_operations.py new file mode 100644 index 000000000000..cc4920cb2e26 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/activity_operations.py @@ -0,0 +1,172 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, 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 automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities/{activityName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def list_by_module( + self, 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 automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ActivityPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ActivityPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/agent_registration_information_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/agent_registration_information_operations.py new file mode 100644 index 000000000000..05b0ab93cd07 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/agent_registration_information_operations.py @@ -0,0 +1,161 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the automation agent registration information. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def regenerate_key( + self, automation_account_name, parameters, custom_headers=None, raw=False, **operation_config): + """Regenerate a primary or secondary agent registration key. + + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param parameters: The name of the agent registration key to be + regenerated + :type parameters: + ~azure.mgmt.automation.models.AgentRegistrationRegenerateKeyParameter + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/automation_account_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/automation_account_operations.py new file mode 100644 index 000000000000..6f4fe3f6540f --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/automation_account_operations.py @@ -0,0 +1,419 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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: The resource group name. + :type resource_group_name: str + :param automation_account_name: Automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + 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: The resource group name. + :type resource_group_name: str + :param automation_account_name: Parameters supplied to the create or + update 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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def delete( + self, resource_group_name, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Delete an automation account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param automation_account_name: Automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + 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: The resource group name. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + 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: The resource group name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.AutomationAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AutomationAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + 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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts' + 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.AutomationAccountPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AutomationAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/certificate_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/certificate_operations.py new file mode 100644 index 000000000000..7d68fdb58ef3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/certificate_operations.py @@ -0,0 +1,362 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, certificate_name, custom_headers=None, raw=False, **operation_config): + """Delete the certificate. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, certificate_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the certificate identified by certificate name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def create_or_update( + self, automation_account_name, certificate_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a certificate. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def update( + self, automation_account_name, certificate_name, name, description=None, custom_headers=None, raw=False, **operation_config): + """Update a certificate. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def list_by_automation_account( + self, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of certificates. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.CertificatePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CertificatePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/connection_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/connection_operations.py new file mode 100644 index 000000000000..b8ea0060f823 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/connection_operations.py @@ -0,0 +1,368 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, connection_name, custom_headers=None, raw=False, **operation_config): + """Delete the connection. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, connection_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the connection identified by connection name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def create_or_update( + self, automation_account_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update a connection. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def update( + self, automation_account_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a connection. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def list_by_automation_account( + self, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of connections. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ConnectionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/connection_type_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/connection_type_operations.py new file mode 100644 index 000000000000..4022075642ec --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/connection_type_operations.py @@ -0,0 +1,290 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, connection_type_name, custom_headers=None, raw=False, **operation_config): + """Delete the connectiontype. + + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param connection_type_name: The name of connectiontype. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, connection_type_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the connectiontype identified by connectiontype name. + + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param connection_type_name: The name of connectiontype. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def create_or_update( + self, automation_account_name, connection_type_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a connectiontype. + + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param connection_type_name: The parameters supplied to the create or + update connectiontype operation. + :type connection_type_name: str + :param parameters: The parameters supplied to the create or update + connectiontype 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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def list_by_automation_account( + self, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of connectiontypes. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ConnectionTypePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConnectionTypePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/credential_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/credential_operations.py new file mode 100644 index 000000000000..8349fc84f689 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/credential_operations.py @@ -0,0 +1,362 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, credential_name, custom_headers=None, raw=False, **operation_config): + """Delete the credential. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, credential_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the credential identified by credential name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def create_or_update( + self, automation_account_name, credential_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a credential. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def update( + self, automation_account_name, credential_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a credential. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def list_by_automation_account( + self, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of credentials. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, 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 + deserialized = models.CredentialPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CredentialPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_compilation_job_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_compilation_job_operations.py new file mode 100644 index 000000000000..a8ece65d2650 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_compilation_job_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 DscCompilationJobOperations(object): + """DscCompilationJobOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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( + self, automation_account_name, compilation_job_id, parameters, custom_headers=None, raw=False, **operation_config): + """Creates the Dsc compilation job of the configuration. + + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param compilation_job_id: The the DSC configuration Id. + :type compilation_job_id: 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: 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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'compilationJobId': self._serialize.url("compilation_job_id", compilation_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['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) + response = self._client.send( + request, header_parameters, body_content, 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 get( + self, automation_account_name, compilation_job_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc configuration compilation job identified by job id. + + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param compilation_job_id: The Dsc configuration compilation job id. + :type compilation_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: DscCompilationJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.DscCompilationJob or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'compilationJobId': self._serialize.url("compilation_job_id", compilation_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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def list_by_automation_account( + self, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of dsc compilation jobs. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DscCompilationJobPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DscCompilationJobPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def get_stream( + self, 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 automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_configuration_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_configuration_operations.py new file mode 100644 index 000000000000..79d7c7a0acb3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_configuration_operations.py @@ -0,0 +1,354 @@ +# 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 DscConfigurationOperations(object): + """DscConfigurationOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, configuration_name, custom_headers=None, raw=False, **operation_config): + """Delete the dsc configuration identified by configuration name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, configuration_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the configuration identified by configuration name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def create_or_update( + self, automation_account_name, configuration_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create the configuration identified by configuration name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def get_content( + self, automation_account_name, configuration_name, custom_headers=None, raw=False, callback=None, **operation_config): + """Retrieve the configuration script identified by configuration name. + + :param automation_account_name: The automation account name. + :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:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=True, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_by_automation_account( + self, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of configurations. + + :param automation_account_name: The automation account name. + :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 DscConfiguration + :rtype: + ~azure.mgmt.automation.models.DscConfigurationPaged[~azure.mgmt.automation.models.DscConfiguration] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DscConfigurationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DscConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_node_configuration_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_node_configuration_operations.py new file mode 100644 index 000000000000..4785e67f3f62 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_node_configuration_operations.py @@ -0,0 +1,293 @@ +# 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 DscNodeConfigurationOperations(object): + """DscNodeConfigurationOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, node_configuration_name, custom_headers=None, raw=False, **operation_config): + """Delete the Dsc node configurations by node configuration. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, node_configuration_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc node configurations by node configuration. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def create_or_update( + self, automation_account_name, node_configuration_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create the node configuration identified by node configuration name. + + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param node_configuration_name: The create or update parameters for + configuration. + :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: 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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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('DscNodeConfiguration', response) + 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 list_by_automation_account( + self, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of dsc node configurations. + + :param automation_account_name: The automation account name. + :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 DscNodeConfiguration + :rtype: + ~azure.mgmt.automation.models.DscNodeConfigurationPaged[~azure.mgmt.automation.models.DscNodeConfiguration] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DscNodeConfigurationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DscNodeConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_node_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_node_operations.py new file mode 100644 index 000000000000..b0f92ef785d2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/dsc_node_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 DscNodeOperations(object): + """DscNodeOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, node_id, custom_headers=None, raw=False, **operation_config): + """Delete the dsc node identified by node id. + + :param automation_account_name: Automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, node_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the dsc node identified by node id. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def update( + self, automation_account_name, node_id, node_id1=None, node_configuration=None, custom_headers=None, raw=False, **operation_config): + """Update the dsc node. + + :param automation_account_name: The automation account name. + :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 node_configuration: Gets or sets the configuration of the node. + :type node_configuration: + ~azure.mgmt.automation.models.DscNodeConfigurationAssociationProperty + :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` + """ + parameters = models.DscNodeUpdateParameters(node_configuration=node_configuration) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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, 'DscNodeUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, 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 + + def list_by_automation_account( + self, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of dsc nodes. + + :param automation_account_name: The automation account name. + :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 DscNode + :rtype: + ~azure.mgmt.automation.models.DscNodePaged[~azure.mgmt.automation.models.DscNode] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DscNodePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DscNodePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/fields_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/fields_operations.py new file mode 100644 index 000000000000..b2a1b4d1777c --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/fields_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 FieldsOperations(object): + """FieldsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, 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 automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/types/{typeName}/fields' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/hybrid_runbook_worker_group_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/hybrid_runbook_worker_group_operations.py new file mode 100644 index 000000000000..763df34d0ede --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/hybrid_runbook_worker_group_operations.py @@ -0,0 +1,291 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, hybrid_runbook_worker_group_name, custom_headers=None, raw=False, **operation_config): + """Delete a hybrid runbook worker group. + + :param automation_account_name: Automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, hybrid_runbook_worker_group_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a hybrid runbook worker group. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def update( + self, automation_account_name, hybrid_runbook_worker_group_name, credential=None, custom_headers=None, raw=False, **operation_config): + """Update a hybrid runbook worker group. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def list_by_automation_account( + self, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of hybrid runbook worker groups. + + :param automation_account_name: The automation account name. + :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 HybridRunbookWorkerGroup + :rtype: + ~azure.mgmt.automation.models.HybridRunbookWorkerGroupPaged[~azure.mgmt.automation.models.HybridRunbookWorkerGroup] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.HybridRunbookWorkerGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.HybridRunbookWorkerGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/job_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/job_operations.py new file mode 100644 index 000000000000..46366634de75 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/job_operations.py @@ -0,0 +1,526 @@ +# 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 JobOperations(object): + """JobOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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_output( + self, automation_account_name, job_id, custom_headers=None, raw=False, callback=None, **operation_config): + """Retrieve the job output identified by job id. + + :param automation_account_name: The automation account name. + :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 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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/output' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=True, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_runbook_content( + self, automation_account_name, job_id, custom_headers=None, raw=False, callback=None, **operation_config): + """Retrieve the runbook content of the job identified by job id. + + :param automation_account_name: The automation account name. + :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 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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/runbookContent' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=True, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def suspend( + self, automation_account_name, job_id, custom_headers=None, raw=False, **operation_config): + """Suspend the job identified by jobId. + + :param automation_account_name: The automation account name. + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/suspend' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def stop( + self, automation_account_name, job_id, custom_headers=None, raw=False, **operation_config): + """Stop the job identified by jobId. + + :param automation_account_name: The automation account name. + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/stop' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, job_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the job identified by job id. + + :param automation_account_name: The automation account name. + :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: Job or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.Job or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def create( + self, automation_account_name, job_id, parameters, custom_headers=None, raw=False, **operation_config): + """Create a job of the runbook. + + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param job_id: The job id. + :type job_id: str + :param parameters: The parameters supplied to the create job + operation. + :type parameters: ~azure.mgmt.automation.models.JobCreateParameters + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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, 'JobCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, 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 + + def list_by_automation_account( + self, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of jobs. + + :param automation_account_name: The automation account name. + :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 Job + :rtype: + ~azure.mgmt.automation.models.JobPaged[~azure.mgmt.automation.models.Job] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.JobPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def resume( + self, automation_account_name, job_id, custom_headers=None, raw=False, **operation_config): + """Resume the job identified by jobId. + + :param automation_account_name: The automation account name. + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/resume' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/job_schedule_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/job_schedule_operations.py new file mode 100644 index 000000000000..00fb7a158faf --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/job_schedule_operations.py @@ -0,0 +1,287 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, job_schedule_id, custom_headers=None, raw=False, **operation_config): + """Delete the job schedule identified by job schedule name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, job_schedule_id, custom_headers=None, raw=False, **operation_config): + """Retrieve the job schedule identified by job schedule name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def create( + self, automation_account_name, job_schedule_id, parameters, custom_headers=None, raw=False, **operation_config): + """Create a job schedule. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def list_by_automation_account( + self, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of job schedules. + + :param automation_account_name: The automation account name. + :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 JobSchedule + :rtype: + ~azure.mgmt.automation.models.JobSchedulePaged[~azure.mgmt.automation.models.JobSchedule] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.JobSchedulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobSchedulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/job_stream_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/job_stream_operations.py new file mode 100644 index 000000000000..e4c612c5c9ec --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/job_stream_operations.py @@ -0,0 +1,175 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, 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 automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/streams/{jobStreamId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def list_by_job( + self, automation_account_name, job_id, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of jobs streams identified by job id. + + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param job_id: The job Id. + :type 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 JobStream + :rtype: + ~azure.mgmt.automation.models.JobStreamPaged[~azure.mgmt.automation.models.JobStream] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/streams' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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 = {} + 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.JobStreamPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobStreamPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/module_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/module_operations.py new file mode 100644 index 000000000000..a70eb593f1c5 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/module_operations.py @@ -0,0 +1,355 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, module_name, custom_headers=None, raw=False, **operation_config): + """Delete the module by name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, module_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the module identified by module name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def create_or_update( + self, automation_account_name, module_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or Update the module identified by module name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def update( + self, automation_account_name, module_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update the module identified by module name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def list_by_automation_account( + self, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of modules. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ModulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ModulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/node_reports_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/node_reports_operations.py new file mode 100644 index 000000000000..62ff71156f9b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/node_reports_operations.py @@ -0,0 +1,243 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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_node( + self, automation_account_name, node_id, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve the Dsc node report list by node id. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DscNodeReportPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DscNodeReportPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def get( + self, 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 automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get_content( + self, automation_account_name, node_id, report_id, custom_headers=None, raw=False, callback=None, **operation_config): + """Retrieve the Dsc node reports by node id and report id. + + :param automation_account_name: The automation account name. + :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 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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}/content' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=True, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/object_data_types_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/object_data_types_operations.py new file mode 100644 index 000000000000..96409bc077de --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/object_data_types_operations.py @@ -0,0 +1,181 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, 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 automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/objectDataTypes/{typeName}/fields' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list_fields_by_type( + self, 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 automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TypeFieldPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/operations.py new file mode 100644 index 000000000000..d69c21812a40 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/operations.py @@ -0,0 +1,96 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/providers/Microsoft.Automation/operations' + + # 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py new file mode 100644 index 000000000000..413c1cb8b35b --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_draft_operations.py @@ -0,0 +1,438 @@ +# 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.exceptions import DeserializationError +from msrestazure.azure_operation import AzureOperationPoller + +from .. import models + + +class RunbookDraftOperations(object): + """RunbookDraftOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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_content( + self, 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 automation_account_name: The automation account name. + :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:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=True, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + + def _create_or_update_initial( + self, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, callback=None, **operation_config): + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 = upload_gen(runbook_content) + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def create_or_update( + self, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, callback=None, **operation_config): + """Updates the runbook draft with runbookStream as its content. + + :param automation_account_name: The automation account name. + :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: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + automation_account_name=automation_account_name, + runbook_name=runbook_name, + runbook_content=runbook_content, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + def get( + self, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the runbook draft identified by runbook name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + + def _publish_initial( + self, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/publish' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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 + + def publish( + self, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Publish runbook draft. + + :param automation_account_name: The automation account name. + :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: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns Runbook or + ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.automation.models.Runbook] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._publish_initial( + automation_account_name=automation_account_name, + runbook_name=runbook_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = self._deserialize('Runbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + def undo_edit( + self, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the runbook identified by runbook name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/undoEdit' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_operations.py new file mode 100644 index 000000000000..8b2a10292eee --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/runbook_operations.py @@ -0,0 +1,413 @@ +# 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 RunbookOperations(object): + """RunbookOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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_content( + self, automation_account_name, runbook_name, custom_headers=None, raw=False, callback=None, **operation_config): + """Retrieve the content of runbook identified by runbook name. + + :param automation_account_name: The automation account name. + :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:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/content' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=True, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get( + self, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the runbook identified by runbook name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def create_or_update( + self, automation_account_name, runbook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create the runbook identified by runbook name. + + :param automation_account_name: The automation account name. + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 400]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def update( + self, automation_account_name, runbook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update the runbook identified by runbook name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def delete( + self, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Delete the runbook by name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def list_by_automation_account( + self, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of runbooks. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.RunbookPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RunbookPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/schedule_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/schedule_operations.py new file mode 100644 index 000000000000..b6548defcee0 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/schedule_operations.py @@ -0,0 +1,356 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, schedule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a schedule. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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('Schedule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, automation_account_name, schedule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update the schedule identified by schedule name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def get( + self, automation_account_name, schedule_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the schedule identified by schedule name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def delete( + self, automation_account_name, schedule_name, custom_headers=None, raw=False, **operation_config): + """Delete the schedule identified by schedule name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def list_by_automation_account( + self, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of schedules. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SchedulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SchedulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configuration_machine_runs_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configuration_machine_runs_operations.py new file mode 100644 index 000000000000..51785bbba134 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configuration_machine_runs_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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SoftwareUpdateConfigurationMachineRunsOperations(object): + """SoftwareUpdateConfigurationMachineRunsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, software_update_configuration_machine_run_id, custom_headers=None, raw=False, **operation_config): + """Get a single software update configuration machine run by Id. + + :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 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:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("self.config.automation_account_name", self.config.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['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.client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("self.config.client_request_id", self.config.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) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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 + + def list( + self, filter=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Return list of software update configuration machine runs. + + :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:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("self.config.automation_account_name", self.config.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['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.client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("self.config.client_request_id", self.config.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) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configuration_runs_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configuration_runs_operations.py new file mode 100644 index 000000000000..7b13907cce60 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configuration_runs_operations.py @@ -0,0 +1,179 @@ +# 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 SoftwareUpdateConfigurationRunsOperations(object): + """SoftwareUpdateConfigurationRunsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, software_update_configuration_run_id, custom_headers=None, raw=False, **operation_config): + """Get a single software update configuration Run by Id. + + :param software_update_configuration_run_id: The Id of the software + update configuration run. + :type software_update_configuration_run_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:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("self.config.automation_account_name", self.config.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['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.client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("self.config.client_request_id", self.config.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) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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 + + def list( + self, filter=None, skip=None, top=None, custom_headers=None, raw=False, **operation_config): + """Return list of software update configuration runs. + + :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:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("self.config.automation_account_name", self.config.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['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.client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("self.config.client_request_id", self.config.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) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configurations_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configurations_operations.py new file mode 100644 index 000000000000..a75ae849e542 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/software_update_configurations_operations.py @@ -0,0 +1,294 @@ +# 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 SoftwareUpdateConfigurationsOperations(object): + """SoftwareUpdateConfigurationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, software_update_configuration_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a new software update configuration with the name given in the + URI. + + :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 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:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("self.config.automation_account_name", self.config.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['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.client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("self.config.client_request_id", self.config.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) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 400, 404, 409]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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 + + def get_by_name( + self, software_update_configuration_name, custom_headers=None, raw=False, **operation_config): + """Get a single software update configuration by name. + + :param software_update_configuration_name: The name of the software + update configuration to be created. + :type software_update_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: SoftwareUpdateConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SoftwareUpdateConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("self.config.automation_account_name", self.config.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['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.client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("self.config.client_request_id", self.config.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) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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 + + def delete( + self, software_update_configuration_name, custom_headers=None, raw=False, **operation_config): + """delete a specific software update configuration. + + :param software_update_configuration_name: The name of the software + update configuration to be created. + :type software_update_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:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("self.config.automation_account_name", self.config.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['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.client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("self.config.client_request_id", self.config.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) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def list( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """Get all software update configurations for the account. + + :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:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("self.config.automation_account_name", self.config.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['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.client_request_id is not None: + header_parameters['clientRequestId'] = self._serialize.header("self.config.client_request_id", self.config.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) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/source_control_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/source_control_operations.py new file mode 100644 index 000000000000..6300cb2f098a --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/source_control_operations.py @@ -0,0 +1,362 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, source_control_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a source control. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def update( + self, automation_account_name, source_control_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a source control. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def delete( + self, automation_account_name, source_control_name, custom_headers=None, raw=False, **operation_config): + """Delete the source control. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, source_control_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the source control identified by source control name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def list_by_automation_account( + self, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of source controls. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SourceControlPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SourceControlPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/source_control_sync_job_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/source_control_sync_job_operations.py new file mode 100644 index 000000000000..79fadd3bfded --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/source_control_sync_job_operations.py @@ -0,0 +1,239 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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( + self, automation_account_name, source_control_name, source_control_sync_job_id, custom_headers=None, raw=False, **operation_config): + """Creates the sync job for a source control. + + :param automation_account_name: The automation account name. + :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: SourceControlSyncJob or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.automation.models.SourceControlSyncJob or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.put(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, 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 automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def list_by_automation_account( + self, automation_account_name, source_control_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of source control sync jobs. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SourceControlSyncJobPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SourceControlSyncJobPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/statistics_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/statistics_operations.py new file mode 100644 index 000000000000..988efd3334f2 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/statistics_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 StatisticsOperations(object): + """StatisticsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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: The resource group name. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/statistics' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.StatisticsPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.StatisticsPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_streams_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_streams_operations.py new file mode 100644 index 000000000000..c6c8b73898bc --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/test_job_streams_operations.py @@ -0,0 +1,175 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, runbook_name, job_stream_id, custom_headers=None, raw=False, **operation_config): + """Retrieve a test job streams identified by runbook name and stream id. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams/{jobStreamId}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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'), + '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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def list_by_test_job( + self, 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 automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.JobStreamPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JobStreamPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/test_jobs_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/test_jobs_operations.py new file mode 100644 index 000000000000..ab88a50f25b3 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/test_jobs_operations.py @@ -0,0 +1,327 @@ +# 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 TestJobsOperations(object): + """TestJobsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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( + self, automation_account_name, runbook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a test job of the runbook. + + :param automation_account_name: The automation account name. + :type automation_account_name: str + :param runbook_name: The parameters supplied to the create test job + operation. + :type runbook_name: str + :param parameters: The parameters supplied to the create test job + operation. + :type parameters: + ~azure.mgmt.automation.models.TestJobCreateParameters + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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, 'TestJobCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, 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 + + def get( + self, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the test job for the specified runbook. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def resume( + self, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Resume the test job. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/resume' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def stop( + self, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Stop the test job. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/stop' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def suspend( + self, automation_account_name, runbook_name, custom_headers=None, raw=False, **operation_config): + """Suspend the test job. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/suspend' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', pattern=r'^[-\w\._]+$'), + 'automationAccountName': self._serialize.url("automation_account_name", automation_account_name, 'str'), + 'runbookName': self._serialize.url("runbook_name", runbook_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['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 and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, 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 diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/usages_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/usages_operations.py new file mode 100644 index 000000000000..a7d769eb53e1 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/usages_operations.py @@ -0,0 +1,106 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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: The resource group name. + :type resource_group_name: str + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/usages' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/variable_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/variable_operations.py new file mode 100644 index 000000000000..e9f56ce4c8b9 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/variable_operations.py @@ -0,0 +1,358 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, variable_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create a variable. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def update( + self, automation_account_name, variable_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update a variable. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def delete( + self, automation_account_name, variable_name, custom_headers=None, raw=False, **operation_config): + """Delete the variable. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, variable_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the variable identified by variable name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def list_by_automation_account( + self, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of variables. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VariablePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VariablePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/operations/webhook_operations.py b/azure-mgmt-automation/azure/mgmt/automation/operations/webhook_operations.py new file mode 100644 index 000000000000..5c6420925bd7 --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/operations/webhook_operations.py @@ -0,0 +1,417 @@ +# 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec 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, automation_account_name, custom_headers=None, raw=False, **operation_config): + """Generates a Uri for use in creating a webhook. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def delete( + self, automation_account_name, webhook_name, custom_headers=None, raw=False, **operation_config): + """Delete the webhook by name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def get( + self, automation_account_name, webhook_name, custom_headers=None, raw=False, **operation_config): + """Retrieve the webhook identified by webhook name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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 + + def create_or_update( + self, automation_account_name, webhook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create the webhook identified by webhook name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def update( + self, automation_account_name, webhook_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update the webhook identified by webhook name. + + :param automation_account_name: The automation account name. + :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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) + response = self._client.send( + request, header_parameters, body_content, 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 + + def list_by_automation_account( + self, automation_account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieve a list of webhooks. + + :param automation_account_name: The automation account name. + :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 internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks' + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.WebhookPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WebhookPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-automation/azure/mgmt/automation/version.py b/azure-mgmt-automation/azure/mgmt/automation/version.py new file mode 100644 index 000000000000..53a203f32aaf --- /dev/null +++ b/azure-mgmt-automation/azure/mgmt/automation/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "" +